Skip to content

Commit bb678c8

Browse files
committed
fix: improve rules
1 parent c06de5d commit bb678c8

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.eslintrc.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ module.exports = {
5151
'no-caller': 'error',
5252
'no-cond-assign': 'error',
5353
'no-console': 'off',
54+
'no-constant-condition': ['error', { checkLoops: false }],
5455
'no-debugger': 'error',
5556
'no-duplicate-imports': 'error',
5657
'no-empty': 'error',
@@ -140,12 +141,15 @@ module.exports = {
140141
'react/no-this-in-sfc': 'error',
141142
'react/no-typos': 'error',
142143
'react/no-unescaped-entities': ['error', { forbid: ['>', '}'] }],
143-
'react/no-unsafe': 'error',
144+
'react/no-unsafe': ['error', { checkAliases: true }],
144145
'react/no-unused-state': 'error',
145-
'react/prefer-stateless-function': 'error',
146+
'react/prefer-stateless-function': ['error', { ignorePureComponents: true }],
146147
'react/require-render-return': 'error',
147148
'react/void-dom-elements-no-children': 'error',
148149
'react/prop-types': 'off', // Not needed with TypeScript
150+
151+
// Only in TS
152+
'@typescript-eslint/no-var-requires': 'off',
149153
},
150154
overrides: [
151155
{
@@ -204,12 +208,21 @@ module.exports = {
204208
'import/default': 'off',
205209
'import/named': 'off',
206210
'no-undef': 'off',
211+
'no-dupe-class-members': 'off',
207212
},
208213
},
209214
{
210215
files: '*.d.ts',
211216
rules: {
212217
'no-var': 'off',
218+
'@typescript-eslint/explicit-member-accessibility': 'off',
219+
'@typescript-eslint/no-use-before-define': 'off',
220+
},
221+
},
222+
{
223+
files: '*.test.ts?(x)',
224+
rules: {
225+
'react/jsx-no-bind': 'off',
213226
},
214227
},
215228
],

0 commit comments

Comments
 (0)