11import { defineConfig } from 'eslint/config' ;
2- import globals from 'globals' ;
3- import path from 'node:path' ;
4- import { fileURLToPath } from 'node:url' ;
52import js from '@eslint/js' ;
6- import { FlatCompat } from '@eslint/eslintrc' ;
7-
8- const __filename = fileURLToPath ( import . meta. url ) ;
9- const __dirname = path . dirname ( __filename ) ;
10- const compat = new FlatCompat ( {
11- baseDirectory : __dirname ,
12- recommendedConfig : js . configs . recommended ,
13- allConfig : js . configs . all
14- } ) ;
15-
16- export default defineConfig ( [ {
17- extends : compat . extends ( 'eslint:recommended' ) ,
3+ import stylistic from '@stylistic/eslint-plugin' ;
4+ import globals from 'globals' ;
185
19- languageOptions : {
20- globals : {
21- ...globals . browser ,
22- ...globals . commonjs ,
23- ...globals . es2015 ,
24- ...globals . node ,
25- ...globals . mocha ,
6+ export default defineConfig ( [
7+ js . configs . recommended ,
8+ {
9+ plugins : {
10+ '@stylistic' : stylistic ,
11+ } ,
12+ languageOptions : {
13+ globals : {
14+ ...globals . browser ,
15+ ...globals . commonjs ,
16+ ...globals . es2017 ,
17+ ...globals . node ,
18+ ...globals . mocha ,
19+ } ,
20+ ecmaVersion : 2017 ,
21+ sourceType : 'module' ,
22+ } ,
23+ rules : {
24+ 'no-console' : 'off' ,
25+ 'no-unused-vars' : 'off' ,
26+ '@stylistic/linebreak-style' : [ 'error' , 'unix' ] ,
27+ '@stylistic/quotes' : [ 'error' , 'single' ] ,
28+ '@stylistic/semi' : [ 'error' , 'always' ] ,
2629 } ,
27-
28- ecmaVersion : 8 ,
29- sourceType : 'module' ,
30- } ,
31-
32- ignores : [ '**/eslint.config.*' ] ,
33-
34- rules : {
35- 'linebreak-style' : [ 'error' , 'unix' ] ,
36- quotes : [ 'error' , 'single' ] ,
37- semi : [ 'error' , 'always' ] ,
38- 'no-console' : 0 ,
39- 'no-unused-vars' : 0 ,
4030 } ,
41- } ] ) ;
31+ {
32+ files : [ '**/eslint.config.*' ] ,
33+ languageOptions : {
34+ ecmaVersion : 2021 , // Node 18
35+ }
36+ }
37+ ] ) ;
0 commit comments