@@ -14,6 +14,18 @@ const config = [
14
14
...shopifyEslintPlugin . configs . typescript ,
15
15
...shopifyEslintPlugin . configs [ 'typescript-type-checking' ] ,
16
16
...shopifyEslintPlugin . configs . node ,
17
+
18
+ // @shopify /eslint-plugin requires prettier 3+!
19
+ // we can manually disable problematic rules instead.
20
+ {
21
+ rules : {
22
+ '@shopify/class-property-semi' : 'off' ,
23
+ '@shopify/binary-assignment-parens' : 'off' ,
24
+ 'prefer-arrow-callback' : 'off' ,
25
+ 'arrow-body-style' : 'off' ,
26
+ } ,
27
+ } ,
28
+
17
29
includeIgnoreFile ( gitignorePath ) ,
18
30
{
19
31
languageOptions : {
@@ -38,6 +50,29 @@ const config = [
38
50
curly : [ 'error' , 'multi-line' , 'consistent' ] ,
39
51
} ,
40
52
} ,
53
+ {
54
+ // if we want to *enforce* rather than relax any ts-eslint rules, the config
55
+ // block's `files` needs to be a subset of the upstream `files` scope for
56
+ // which the ts-eslint plugin is defined. otherwise eslint will crash :(
57
+ // https://github.com/Shopify/web-configs/blob/main/packages/eslint-plugin/lib/config/typescript.js
58
+ // one of several spooky-action-at-a-distance footguns of the new flat config!
59
+ files : [ '**/*.ts' , '**/*.tsx' ] ,
60
+ rules : {
61
+ '@typescript-eslint/no-shadow' : 'warn' ,
62
+ '@typescript-eslint/no-unused-vars' : [
63
+ 'warn' ,
64
+ {
65
+ args : 'all' ,
66
+ argsIgnorePattern : '^_' ,
67
+ caughtErrors : 'all' ,
68
+ caughtErrorsIgnorePattern : '^_' ,
69
+ destructuredArrayIgnorePattern : '^_' ,
70
+ varsIgnorePattern : '^_' ,
71
+ ignoreRestSiblings : true ,
72
+ } ,
73
+ ] ,
74
+ } ,
75
+ } ,
41
76
{
42
77
files : [ '**/*.spec.ts' ] ,
43
78
plugins : { vitest } ,
0 commit comments