@@ -54,21 +54,14 @@ module.exports = {
54
54
extends : [
55
55
'eslint:recommended' ,
56
56
'plugin:@typescript-eslint/recommended' ,
57
- 'plugin:import/recommended' ,
58
- 'plugin:import/typescript' ,
57
+ 'plugin:import-x /recommended' ,
58
+ 'plugin:import-x /typescript' ,
59
59
'plugin:react/recommended' ,
60
60
'plugin:react-hooks/recommended' ,
61
61
'plugin:react/jsx-runtime' ,
62
62
'prettier' ,
63
63
] ,
64
- plugins : [
65
- 'promise' ,
66
- 'sonarjs' ,
67
- 'unicorn' ,
68
- '@arthurgeron/react-usememo' ,
69
- 'sonar' ,
70
- '@shopify' ,
71
- ] ,
64
+ plugins : [ 'promise' , 'sonarjs' , 'unicorn' , 'sonar' , '@shopify' ] ,
72
65
globals : {
73
66
atom : false ,
74
67
document : false ,
@@ -81,10 +74,6 @@ module.exports = {
81
74
'@shopify/prefer-early-return' : [ 'error' , { maximumStatements : 2 } ] ,
82
75
'@shopify/prefer-class-properties' : 'off' , // enable after https://github.com/Shopify/web-configs/issues/387 will be fixed
83
76
'sonarjs/no-inverted-boolean-check' : 'error' ,
84
- '@arthurgeron/react-usememo/require-usememo' : [
85
- 'error' ,
86
- { checkHookCalls : false } ,
87
- ] ,
88
77
// Possible Errors (http://eslint.org/docs/rules/#possible-errors)
89
78
'no-console' : 'error' ,
90
79
'no-constant-binary-expression' : 'error' ,
@@ -287,9 +276,9 @@ module.exports = {
287
276
288
277
'sonarjs/no-ignored-return' : 'error' ,
289
278
'unicorn/no-array-push-push' : 'error' ,
290
- 'import/no-extraneous-dependencies' : 'error' ,
291
- 'import/no-duplicates' : 'error' ,
292
- 'import/no-named-as-default' : 'error' ,
279
+ 'import-x /no-extraneous-dependencies' : 'error' ,
280
+ 'import-x /no-duplicates' : 'error' ,
281
+ 'import-x /no-named-as-default' : 'error' ,
293
282
'prefer-object-spread' : 'error' ,
294
283
// React rules
295
284
'react/no-unused-state' : 'error' ,
@@ -342,10 +331,15 @@ module.exports = {
342
331
'sonar/prefer-promise-shorthand' : 'error' ,
343
332
'sonar/no-dead-store' : 'error' ,
344
333
'unicorn/prefer-node-protocol' : 'error' ,
345
- 'import/no-unresolved' : [
334
+ 'import-x /no-unresolved' : [
346
335
'error' ,
347
336
{ ignore : [ '^node:' , '\\.svg\\?react$' ] } ,
348
337
] ,
338
+ 'no-extra-boolean-cast' : [
339
+ 'error' ,
340
+ { enforceForInnerExpressions : true } ,
341
+ ] ,
342
+ 'unicorn/no-length-as-slice-end' : 'error' ,
349
343
'unicorn/prefer-string-replace-all' : 'error' ,
350
344
'unicorn/no-hex-escape' : 'off' , // TODO: enable
351
345
// doesn't catch a lot of cases; we use ESLint builtin `no-restricted-syntax` to forbid `.keyCode`
@@ -409,7 +403,6 @@ module.exports = {
409
403
rules : {
410
404
'jest/no-conditional-expect' : 'off' ,
411
405
'jest/expect-expect' : [ 'error' , { assertFunctionNames : [ 'expect*' ] } ] ,
412
- '@arthurgeron/react-usememo/require-usememo' : 'off' ,
413
406
} ,
414
407
} ,
415
408
{
@@ -426,14 +419,14 @@ module.exports = {
426
419
'no-console' : 'off' ,
427
420
'no-new' : 'off' ,
428
421
'no-alert' : 'off' ,
429
- 'import/no-unresolved' : 'off' ,
422
+ 'import-x /no-unresolved' : 'off' ,
430
423
} ,
431
424
} ,
432
425
{
433
426
// Rule for ignoring imported dependencies from tests files
434
427
files : [ '**/__tests__/**' , 'webpack.config.js' , '**/tests/**' ] ,
435
428
rules : {
436
- 'import/no-extraneous-dependencies' : 'off' ,
429
+ 'import-x /no-extraneous-dependencies' : 'off' ,
437
430
} ,
438
431
} ,
439
432
{
@@ -443,7 +436,7 @@ module.exports = {
443
436
'packages/vscode-graphql-execution/**' ,
444
437
] ,
445
438
rules : {
446
- 'import/no-unresolved' : [ 'error' , { ignore : [ '^node:' , 'vscode' ] } ] ,
439
+ 'import-x /no-unresolved' : [ 'error' , { ignore : [ '^node:' , 'vscode' ] } ] ,
447
440
} ,
448
441
} ,
449
442
{
@@ -484,14 +477,13 @@ module.exports = {
484
477
// Rules for codeblocks inside Markdown/MDX
485
478
files : [ '**/*.{md,mdx}/*.{js,jsx,ts,tsx}' ] ,
486
479
rules : {
487
- 'import/no-extraneous-dependencies' : 'off' ,
480
+ 'import-x /no-extraneous-dependencies' : 'off' ,
488
481
'@typescript-eslint/no-unused-vars' : 'off' ,
489
- 'import/no-unresolved' : 'off' ,
482
+ 'import-x /no-unresolved' : 'off' ,
490
483
'no-console' : 'off' ,
491
484
'no-undef' : 'off' ,
492
485
'react/jsx-no-undef' : 'off' ,
493
486
'react-hooks/rules-of-hooks' : 'off' ,
494
- '@arthurgeron/react-usememo/require-usememo' : 'off' ,
495
487
'sonar/no-dead-store' : 'off' ,
496
488
'@typescript-eslint/no-restricted-imports' : 'off' ,
497
489
} ,
0 commit comments