@@ -2,48 +2,64 @@ import pluginEslintImport from 'eslint-plugin-import';
22import pluginTypescriptEslint from '@typescript-eslint/eslint-plugin' ;
33import tsParser from '@typescript-eslint/parser' ;
44
5- export default {
6- languageOptions : {
7- parser : tsParser ,
8- parserOptions : {
9- project : [ './tsconfig.eslint.json' ] ,
10- } ,
11- } ,
12- files : [ '{src,tests}/**/*.{js,ts,jsx,tsx,yml,yaml}' ] ,
13- plugins : {
14- '@typescript-eslint' : pluginTypescriptEslint ,
15- import : pluginEslintImport ,
5+ export default [
6+ {
7+ // the "ignores" patterns have to be defined as the only key of a config object
8+ // see: https://eslint.org/docs/latest/use/configure/ignore#ignoring-directories
9+ ignores : [ 'dist' , '.coverage' , '.vscode' , '.idea' ] ,
1610 } ,
17- rules : {
18- // Use the TypeScript port of 'no-unused-vars' to prevent false positives on abstract methods parameters
19- // while keeping consistency with TS native behavior of ignoring parameters starting with '_'.
20- // https://typescript-eslint.io/rules/no-unused-vars/
21- 'no-unused-vars' : 'off' ,
22- '@typescript-eslint/no-unused-vars' : [
23- 'error' ,
24- {
25- args : 'all' ,
26- argsIgnorePattern : '^_' ,
27- caughtErrors : 'all' ,
28- caughtErrorsIgnorePattern : '^_' ,
29- destructuredArrayIgnorePattern : '^_' ,
30- varsIgnorePattern : '^_' ,
31- ignoreRestSiblings : true ,
11+ {
12+ languageOptions : {
13+ parser : tsParser ,
14+ parserOptions : {
15+ project : [ './tsconfig.eslint.json' ] ,
3216 } ,
33- ] ,
17+ } ,
18+ files : [ '{src,tests}/**/*.{js,ts,yml,yaml}' ] ,
19+ plugins : {
20+ '@typescript-eslint' : pluginTypescriptEslint ,
21+ import : pluginEslintImport ,
22+ } ,
23+ rules : {
24+ // Use the TypeScript port of 'no-unused-vars' to prevent false positives on abstract methods parameters
25+ // while keeping consistency with TS native behavior of ignoring parameters starting with '_'.
26+ // https://typescript-eslint.io/rules/no-unused-vars/
27+ 'no-unused-vars' : 'off' ,
28+ '@typescript-eslint/no-unused-vars' : [
29+ 'error' ,
30+ {
31+ args : 'all' ,
32+ argsIgnorePattern : '^_' ,
33+ caughtErrors : 'all' ,
34+ caughtErrorsIgnorePattern : '^_' ,
35+ destructuredArrayIgnorePattern : '^_' ,
36+ varsIgnorePattern : '^_' ,
37+ ignoreRestSiblings : true ,
38+ } ,
39+ ] ,
3440
35- // eslint-plugin-import
36- 'import/no-default-export' : 'error' ,
37- 'import/consistent-type-specifier-style' : [ 'error' , 'prefer-top-level' ] ,
38- 'import/first' : [ 'error' ] ,
39- 'import/exports-last' : [ 'error' ] ,
40- 'import/order' : [
41- 'error' ,
42- {
43- groups : [ 'builtin' , 'external' , 'internal' , 'parent' , 'sibling' , 'index' , 'object' , 'type' ] ,
44- 'newlines-between' : 'always' ,
45- alphabetize : { order : 'asc' , caseInsensitive : true } ,
46- } ,
47- ] ,
41+ // eslint-plugin-import
42+ 'import/no-default-export' : 'error' ,
43+ 'import/consistent-type-specifier-style' : [ 'error' , 'prefer-top-level' ] ,
44+ 'import/first' : [ 'error' ] ,
45+ 'import/exports-last' : [ 'error' ] ,
46+ 'import/order' : [
47+ 'error' ,
48+ {
49+ groups : [
50+ 'builtin' ,
51+ 'external' ,
52+ 'internal' ,
53+ 'parent' ,
54+ 'sibling' ,
55+ 'index' ,
56+ 'object' ,
57+ 'type' ,
58+ ] ,
59+ 'newlines-between' : 'always' ,
60+ alphabetize : { order : 'asc' , caseInsensitive : true } ,
61+ } ,
62+ ] ,
63+ } ,
4864 } ,
49- } ;
65+ ] ;
0 commit comments