@@ -28,6 +28,8 @@ import {builtinModules} from 'node:module';
28
28
import typescript from 'typescript-eslint' ;
29
29
30
30
invariant ( react . configs . flat , 'For typescript' ) ;
31
+ invariant ( react . configs . flat . recommended , 'For typescript' ) ;
32
+ invariant ( react . configs . flat [ 'jsx-runtime' ] , 'For typescript' ) ;
31
33
32
34
const restrictedImportPatterns = [
33
35
{
@@ -262,7 +264,7 @@ export default typescript.config([
262
264
'no-sequences' : 'error' ,
263
265
'no-throw-literal' : 'error' ,
264
266
'object-shorthand' : [ 'error' , 'properties' ] ,
265
- 'require-await' : 'error' , // TODO: see also @typescript -eslint/require-await
267
+ 'require-await' : 'error' , // Enabled in favor of @typescript -eslint/require-await, which requires type info
266
268
'spaced-comment' : [
267
269
'error' ,
268
270
'always' ,
@@ -316,8 +318,7 @@ export default typescript.config([
316
318
name : 'plugin/react' ,
317
319
// https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules
318
320
plugins : {
319
- ...( react . configs . flat . recommended ?. plugins ?? { } ) ,
320
- // @ts -ignore noUncheckedIndexedAccess
321
+ ...react . configs . flat . recommended . plugins ,
321
322
...react . configs . flat [ 'jsx-runtime' ] . plugins ,
322
323
} ,
323
324
rules : {
@@ -333,8 +334,7 @@ export default typescript.config([
333
334
'react/sort-comp' : 'error' ,
334
335
335
336
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/index.js
336
- ...( react . configs . flat . recommended ?. rules ?? { } ) ,
337
- // @ts -ignore noUncheckedIndexedAccess
337
+ ...react . configs . flat . recommended . rules ,
338
338
...react . configs . flat [ 'jsx-runtime' ] . rules ,
339
339
'react/display-name' : 'off' , // TODO(ryan953): Fix violations and delete this line
340
340
'react/no-unescaped-entities' : 'off' , // TODO(ryan953): Fix violations and delete this line
@@ -358,7 +358,7 @@ export default typescript.config([
358
358
name : 'plugin/typescript-eslint/custom' ,
359
359
rules : {
360
360
'no-shadow' : 'off' , // Disabled in favor of @typescript -eslint/no-shadow
361
- 'no-use-before-define' : 'off' ,
361
+ 'no-use-before-define' : 'off' , // See also @typescript -eslint/no-use-before-define
362
362
363
363
'@typescript-eslint/naming-convention' : [
364
364
'error' ,
@@ -387,7 +387,7 @@ export default typescript.config([
387
387
} ,
388
388
] ,
389
389
'@typescript-eslint/no-shadow' : 'error' ,
390
- '@typescript-eslint/no-use-before-define' : 'off' , // TODO(ryan953): Configure this and enable it
390
+ '@typescript-eslint/no-use-before-define' : 'off' , // Enabling this will cause a lot of thrash to the git history
391
391
} ,
392
392
} ,
393
393
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/base.ts
0 commit comments