@@ -11,116 +11,81 @@ ignorePatterns:
11
11
extends :
12
12
- ' eslint:recommended'
13
13
- ' plugin:react/recommended'
14
- parser : ' @babel/eslint-parser'
14
+ - ' plugin:@typescript-eslint/recommended' # Add TypeScript rules
15
+ - ' plugin:import/errors'
16
+ - ' plugin:import/warnings'
17
+ - ' plugin:import/typescript' # Import plugin with TypeScript support
18
+ - ' plugin:jsx-a11y/recommended'
19
+ - ' prettier' # If you use Prettier
20
+ parser : ' @typescript-eslint/parser' # Use the TypeScript parser
15
21
parserOptions :
16
22
ecmaFeatures :
17
- experimentalObjectRestSpread : true
18
23
jsx : true
19
- legacyDecorators : true
20
24
sourceType : module
25
+ project : ' ./tsconfig.json' # Required for full TypeScript support
21
26
plugins :
22
27
- react
23
28
- jsx-a11y
24
29
- import
30
+ - ' @typescript-eslint'
25
31
- simple-import-sort
26
32
- cypress
27
- - chai-friendly # See https://github.com/cypress-io/eslint-plugin-cypress#chai-and-no-unused-expressions
33
+ - chai-friendly
28
34
settings :
29
35
react :
30
36
version : detect
37
+ import/resolver :
38
+ typescript : {}
39
+ node :
40
+ extensions :
41
+ - .js
42
+ - .jsx
43
+ - .ts
44
+ - .tsx
45
+ paths :
46
+ - src
31
47
rules :
48
+ # Base rules
32
49
linebreak-style : ['error', 'unix']
33
50
quotes : ['warn', 'single', { avoidEscape: true }]
34
51
semi : ['error', 'never']
35
- import/first : ['warn']
36
- simple-import-sort/imports : ['error']
37
- no-else-return : off
38
- no-trailing-spaces : ['warn']
39
- no-continue : off
40
- no-plusplus : off
41
- radix : off
42
- eol-last : ['warn']
52
+ no-console : ['error']
43
53
prefer-const : ['warn']
44
- no-restricted-globals : ['error', 'event', 'fdescribe']
45
- no-mixed-operators : ['warn']
46
- # See https://github.com/cypress-io/eslint-plugin-cypress#chai-and-no-unused-expressions
47
- no-unused-expressions : 0
48
- chai-friendly/no-unused-expressions : 2
49
- # React
54
+ curly : ['error']
55
+ import/no-named-as-default-member : ['off']
56
+
57
+ # Import sorting
58
+ simple-import-sort/imports : ['error']
59
+ import/first : ['warn']
60
+
61
+ # TypeScript-specific rules
62
+ ' @typescript-eslint/no-unused-vars ' : ['warn', { argsIgnorePattern: '^_' }]
63
+ ' @typescript-eslint/no-explicit-any ' : ['warn']
64
+ ' @typescript-eslint/explicit-function-return-type ' : ['off']
65
+ ' @typescript-eslint/no-empty-function ' : ['warn']
66
+
67
+ # React rules
50
68
react/display-name : ['warn']
51
- react/destructuring-assignment : off
52
- react/jsx-indent-props : ['warn', 2]
53
- react/jsx-first-prop-new-line : ['warn']
54
- react/jsx-closing-bracket-location : ['warn']
55
- react/jsx-curly-spacing : ['warn']
56
- react/jsx-tag-spacing : ['warn', { beforeSelfClosing: 'allow' }]
57
- react/jsx-wrap-multilines : ['warn']
58
- react/no-unused-state : ['warn']
59
- react/jsx-max-props-per-line : ['warn', { when: 'multiline' }]
60
- react/jsx-closing-tag-location : ['warn']
61
- react/no-unescaped-entities : ['warn']
62
- react/no-unused-prop-types : ['warn']
63
- react/self-closing-comp : ['warn']
64
69
react/jsx-indent : ['warn', 2]
70
+ react/jsx-max-props-per-line : ['warn', { when: 'multiline' }]
65
71
react/no-array-index-key : ['warn']
66
- react/prefer-stateless-function : off
67
- react/forbid-prop-types : off
68
- # JSX
72
+ react/prop-types : [' off']
73
+
74
+ # Accessibility rules
69
75
jsx-a11y/anchor-is-valid :
70
76
- warn
71
77
- components : ['Link']
72
- specialLink : ['To']
73
- jsx-a11y/alt-text : ['warn']
74
- jsx-a11y/label-has-for : ['warn']
75
- jsx-a11y/label-has-associated-control :
76
- - warn
77
- - controlComponents :
78
- - ' Field'
79
- jsx-a11y/click-events-have-key-events : ['warn']
80
- jsx-a11y/no-static-element-interactions : ['warn']
78
+ specialLink : ['to']
79
+ jsx-a11y/label-has-associated-control : ['warn']
81
80
jsx-a11y/media-has-caption : ['warn']
82
- jsx-a11y/accessible-emoji : ['warn']
83
- jsx-a11y/anchor-has-content : off
84
- no-console : ['error']
85
- curly : ['error']
86
-
87
- # Following rule haves been disabled for compatibility with
88
- # existing code. Some of them should be re-activated in the future.
89
- no-shadow : off
90
- nonblock-statement-body-position : off
91
- object-curly-spacing : off
92
- object-curly-newline : off
93
- object-property-newline : off
94
- comma-dangle : off
95
- function-paren-newline : off
96
- arrow-parens : off
97
- arrow-body-style : off
98
- no-use-before-define : off
99
- no-param-reassign : off
100
- camelcase : off
101
- no-underscore-dangle : off
102
- no-restricted-syntax : off
103
- prefer-destructuring : off
104
- consistent-return : off
105
- class-methods-use-this : off
106
- prefer-promise-reject-errors : off
107
- import/prefer-default-export : off
108
- import/export : off
109
- block-spacing : off
110
- brace-style : off
111
- no-multi-spaces : off
112
- max-len : off # Handled by prettier
113
- # React-specific temporarily disabled rules
114
- react/prop-types : off
115
- react/no-string-refs : off
116
- react/react-in-jsx-scope : off # Generates erros in tests
117
- react/sort-comp : off
118
- react/require-default-props : off
119
- react/jsx-one-expression-per-line : off
120
- react/jsx-no-bind : off
81
+ react/no-unescaped-entities : ['warn']
121
82
83
+ overrides :
84
+ - files : ['**/__tests__/**/*.[jt]s?(x)', '**/*.test.[jt]s?(x)', '**/*.spec.[jt]s?(x)']
85
+ rules :
86
+ react/react-in-jsx-scope : ' off'
87
+ ' @typescript-eslint/no-unused-expressions ' : ' off'
122
88
globals :
123
- # For tests
124
89
snapshot : false
125
90
snapshotReducer : false
126
91
snapshotComponent : false
0 commit comments