@@ -6,129 +6,23 @@ import perfectionist from 'eslint-plugin-perfectionist'
66import pluginVue from 'eslint-plugin-vue'
77import { defineConfig } from 'eslint/config'
88import neostandard , { plugins } from 'neostandard'
9+ import vueParser from 'vue-eslint-parser'
10+
11+ const GLOB_TS = [ '**/*.ts' , '**/*.tsx' , '**/*.mts' , '**/*.cts' ]
12+ const GLOB_TS_VUE = [ ...GLOB_TS , '**/*.vue' ]
13+ const GLOB_JS = [ '**/*.js' , '**/*.mjs' , '**/*.cjs' ]
914
1015export default defineConfig ( [
1116 {
1217 ignores : [ '**/dist/**' ] ,
1318 } ,
19+
20+ // Base configs
21+
1422 cspellConfigs . recommended ,
1523 {
1624 rules : {
17- '@cspell/spellchecker' : [
18- 'warn' ,
19- {
20- autoFix : true ,
21- cspell : {
22- words : [
23- 'DECI' ,
24- 'CENTI' ,
25- 'MILLI' ,
26- 'MILLIWATT' ,
27- 'Benoit' ,
28- 'catppuccin' ,
29- 'chargingstations' ,
30- 'ctrlr' ,
31- 'csms' ,
32- 'idtag' ,
33- 'idtags' ,
34- 'iccid' ,
35- 'imsi' ,
36- 'ocpp' ,
37- 'onconnection' ,
38- 'opencode' ,
39- 'evse' ,
40- 'evses' ,
41- 'kvar' ,
42- 'kvarh' ,
43- 'varh' ,
44- 'rfid' ,
45- 'workerset' ,
46- 'worktree' ,
47- 'dedup' ,
48- 'unpushed' ,
49- 'logform' ,
50- 'mnemonist' ,
51- 'poolifier' ,
52- 'measurand' ,
53- 'measurands' ,
54- 'mikro' ,
55- 'neostandard' ,
56- 'recurrency' ,
57- 'shutdowning' ,
58- 'VCAP' ,
59- 'workerd' ,
60- 'yxxx' ,
61- // OCPP 2.0.x domain terms
62- 'cppwm' ,
63- 'heartbeatinterval' ,
64- 'HEARTBEATINTERVAL' ,
65- 'websocketpinginterval' ,
66- 'WEBSOCKETPINGINTERVAL' ,
67- 'connectionurl' ,
68- 'CONNECTIONURL' ,
69- 'chargingstation' ,
70- 'CHARGINGSTATION' ,
71- 'authctrlr' ,
72- 'AUTHCTRLR' ,
73- 'recloser' ,
74- 'deauthorize' ,
75- 'Deauth' ,
76- 'DEAUTHORIZE' ,
77- 'deauthorized' ,
78- 'DEAUTHORIZED' ,
79- 'Deauthorization' ,
80- 'Selftest' ,
81- 'SECC' ,
82- 'Secc' ,
83- 'Overcurrent' ,
84- 'ocsp' ,
85- 'OCSP' ,
86- 'EMAID' ,
87- 'emaid' ,
88- 'IDTOKEN' ,
89- 'idtoken' ,
90- 'issuerkeyhash' ,
91- 'issuernamehash' ,
92- // OCPP SRPC
93- 'SRPC' ,
94- 'CALLRESULT' ,
95- 'CALLERROR' ,
96- 'CALLRESULTERROR' ,
97- 'reservability' ,
98- // VPN protocol acronyms
99- 'PPTP' ,
100- // UI server protocol acronyms
101- 'UIMCP' ,
102- 'Streamable' ,
103- 'modelcontextprotocol' ,
104- // Signed meter values
105- 'OCMF' ,
106- 'ocmf' ,
107- 'secp' ,
108- 'brainpool' ,
109- 'Eichrecht' ,
110- 'eichrecht' ,
111- 'signingmethod' ,
112- 'SIGNINGMETHOD' ,
113- 'encodingmethod' ,
114- 'ENCODINGMETHOD' ,
115- 'signedmeterdata' ,
116- 'SIGNEDMETERDATA' ,
117- 'fiscalmetering' ,
118- 'FISCALMETERING' ,
119- 'publickeywithsignedmetervalue' ,
120- 'PUBLICKEYWITHSIGNEDMETERVALUE' ,
121- 'sampleddatasignreadings' ,
122- 'SAMPLEDDATASIGNREADINGS' ,
123- // UI component terms
124- 'focusables' ,
125- 'Focusables' ,
126- // Test credential fragments
127- 'secret' ,
128- ] ,
129- } ,
130- } ,
131- ] ,
25+ '@cspell/spellchecker' : [ 'warn' , { autoFix : true } ] ,
13226 } ,
13327 } ,
13428 js . configs . recommended ,
@@ -146,27 +40,27 @@ export default defineConfig([
14640 ] ,
14741 } ,
14842 } ,
43+
44+ // neostandard
45+
46+ ...neostandard ( { ts : true } ) ,
47+
48+ // Vue
49+
14950 ...pluginVue . configs [ 'flat/recommended' ] ,
150- {
151- files : [ '**/*.vue' ] ,
152- languageOptions : {
153- globals : {
154- localStorage : 'readonly' ,
155- } ,
156- parserOptions : {
157- parser : '@typescript-eslint/parser' ,
158- } ,
159- } ,
160- } ,
51+
52+ // TypeScript
53+
16154 ...plugins [ 'typescript-eslint' ] . config (
16255 {
16356 extends : [
16457 ...plugins [ 'typescript-eslint' ] . configs . strictTypeChecked ,
16558 ...plugins [ 'typescript-eslint' ] . configs . stylisticTypeChecked ,
16659 ] ,
167- files : [ '**/*.ts' , '**/*.tsx' , '**/*.mts' , '**/*.cts' , '*/**.vue' ] ,
60+ files : GLOB_TS_VUE ,
16861 languageOptions : {
16962 parserOptions : {
63+ extraFileExtensions : [ '.vue' ] ,
17064 projectService : true ,
17165 // eslint-disable-next-line n/no-unsupported-features/node-builtins
17266 tsconfigRootDir : import . meta. dirname ,
@@ -186,22 +80,44 @@ export default defineConfig([
18680 } ,
18781 } ,
18882 {
189- files : [ '**/*.js' , '**/*.mjs' , '**/*.cjs' ] ,
83+ files : GLOB_JS ,
19084 ...plugins [ 'typescript-eslint' ] . configs . disableTypeChecked ,
19185 }
19286 ) ,
87+
88+ // Vue parser restoration
89+
90+ {
91+ files : [ '**/*.vue' ] ,
92+ languageOptions : {
93+ globals : {
94+ localStorage : 'readonly' ,
95+ } ,
96+ parser : vueParser ,
97+ parserOptions : {
98+ extraFileExtensions : [ '.vue' ] ,
99+ parser : plugins [ 'typescript-eslint' ] . parser ,
100+ projectService : true ,
101+ // eslint-disable-next-line n/no-unsupported-features/node-builtins
102+ tsconfigRootDir : import . meta. dirname ,
103+ } ,
104+ } ,
105+ } ,
106+
107+ // Perfectionist
108+
193109 perfectionist . configs [ 'recommended-natural' ] ,
194110 {
195111 files : [ '**/*.vue' ] ,
196112 rules : {
197113 'perfectionist/sort-vue-attributes' : 'off' ,
198114 } ,
199115 } ,
200- ... neostandard ( {
201- ts : true ,
202- } ) ,
116+
117+ // Rule overrides
118+
203119 {
204- files : [ '**/*.ts' , '**/*.tsx' , '**/*.mts' , '**/*.cts' , '**/*.vue' ] ,
120+ files : GLOB_TS_VUE ,
205121 rules : {
206122 '@typescript-eslint/no-unused-vars' : [
207123 'error' ,
0 commit comments