11import pluginVue from 'eslint-plugin-vue'
2- import vueTsEslintConfig from '@vue/eslint-config-typescript'
2+ import { defineConfigWithVueTs , vueTsConfigs } from '@vue/eslint-config-typescript'
33import pluginVitest from '@vitest/eslint-plugin'
4+ import pluginPlaywright from 'eslint-plugin-playwright'
5+ import i18nJsonPlugin from 'eslint-plugin-i18n-json'
6+ import path from 'path'
47
5- export default [
8+ export default defineConfigWithVueTs (
69 {
710 name : 'app/files-to-lint' ,
811 files : [ '**/*.{ts,mts,tsx,vue}' ] ,
@@ -13,9 +16,9 @@ export default [
1316 ignores : [ '**/dist/**' , '**/dist-ssr/**' , '**/coverage/**' ] ,
1417 } ,
1518
16- ... pluginVue . configs [ 'flat/essential' ] ,
17- ... vueTsEslintConfig ( ) ,
18-
19+ pluginVue . configs [ 'flat/essential' ] ,
20+ vueTsConfigs . recommended ,
21+
1922 {
2023 ...pluginVitest . configs . recommended ,
2124 files : [
@@ -27,4 +30,40 @@ export default [
2730 } ,
2831 } ,
2932
30- ]
33+ {
34+ ...pluginPlaywright . configs [ 'flat/recommended' ] ,
35+ files : [ 'tests/e2e/**/*.{test,spec}.{js,ts,jsx,tsx}' ] ,
36+ } ,
37+
38+ {
39+ files : [ 'src/locales/*.json' ] ,
40+ plugins : { 'i18n-json' : i18nJsonPlugin } ,
41+ processor : {
42+ meta : { name : '.json' } ,
43+ ...i18nJsonPlugin . processors [ '.json' ] ,
44+ } ,
45+ rules : {
46+ 'i18n-json/valid-json' : 2 ,
47+ 'i18n-json/identical-placeholders' : [ 2 , {
48+ filePath : path . resolve ( 'src/locales/en.json' ) ,
49+ ignoreTags : true ,
50+ } ] ,
51+ } ,
52+ } ,
53+ // ignore missing translation keys in incomplete locale files
54+ {
55+ files : [ 'src/locales/*.json' ] ,
56+ ignores : [ '**/ca.json' , '**/fr.json' , '**/nl.json' ] ,
57+ plugins : { 'i18n-json' : i18nJsonPlugin } ,
58+ processor : {
59+ meta : { name : '.json' } ,
60+ ...i18nJsonPlugin . processors [ '.json' ] ,
61+ } ,
62+ rules : {
63+ 'i18n-json/identical-keys' : [ 2 , {
64+ filePath : path . resolve ( 'src/locales/en.json' ) ,
65+ } ] ,
66+ } ,
67+ } ,
68+
69+ )
0 commit comments