@@ -14,6 +14,18 @@ const config = [
1414 ...shopifyEslintPlugin . configs . typescript ,
1515 ...shopifyEslintPlugin . configs [ 'typescript-type-checking' ] ,
1616 ...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+
1729 includeIgnoreFile ( gitignorePath ) ,
1830 {
1931 languageOptions : {
@@ -38,6 +50,29 @@ const config = [
3850 curly : [ 'error' , 'multi-line' , 'consistent' ] ,
3951 } ,
4052 } ,
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+ } ,
4176 {
4277 files : [ '**/*.spec.ts' ] ,
4378 plugins : { vitest } ,
0 commit comments