Skip to content

Commit fba5233

Browse files
Migrate to eslint 9.26
1 parent f8a22fb commit fba5233

354 files changed

Lines changed: 11828 additions & 15039 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 0 additions & 11 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 172 deletions
This file was deleted.

eslint.config.js

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
import nxPlugin from '@nx/eslint-plugin'
2+
import cliPlugin from '@shopify/eslint-plugin-cli'
3+
4+
// Spread the CLI plugin's base config which includes all necessary plugins
5+
const config = [
6+
// Base config from @shopify/eslint-plugin-cli (includes shopify, typescript, prettier, etc.)
7+
...cliPlugin.configs.config,
8+
9+
// Global ignores
10+
{
11+
ignores: ['**/dist/**', '**/node_modules/**', '**/coverage/**', '**/*.d.ts'],
12+
},
13+
14+
// NX module boundaries
15+
{
16+
files: ['**/*.ts', '**/*.tsx'],
17+
plugins: {
18+
'@nx': nxPlugin,
19+
},
20+
rules: {
21+
'@nx/enforce-module-boundaries': 'error',
22+
},
23+
},
24+
25+
// JSDoc rules for public API files
26+
{
27+
files: ['**/public/**/*.ts'],
28+
ignores: [
29+
'**/*.test.ts',
30+
'**/public/node/abort.ts',
31+
'**/public/node/analytics.ts',
32+
'**/public/node/base-command.ts',
33+
'**/public/node/cli.ts',
34+
'**/public/node/dot-env.ts',
35+
'**/public/node/error-handler.ts',
36+
'**/public/node/framework.ts',
37+
'**/public/node/fs.ts',
38+
'**/public/node/github.ts',
39+
'**/public/node/hooks/prerun.ts',
40+
'**/public/node/os.ts',
41+
'**/public/node/node-package-manager.ts',
42+
'**/public/node/plugins/tunnel.ts',
43+
'**/public/node/environments.ts',
44+
'**/public/node/result.ts',
45+
'**/public/node/themes/**/*',
46+
],
47+
settings: {
48+
jsdoc: {
49+
publicFunctionsOnly: true,
50+
mode: 'typescript',
51+
},
52+
},
53+
rules: {
54+
'jsdoc/check-access': 'error',
55+
'jsdoc/check-alignment': 'error',
56+
'jsdoc/check-indentation': 'error',
57+
'jsdoc/check-line-alignment': 'error',
58+
'jsdoc/check-param-names': 'error',
59+
'jsdoc/check-property-names': 'error',
60+
'jsdoc/check-syntax': 'error',
61+
'jsdoc/check-tag-names': 'error',
62+
'jsdoc/check-types': 'error',
63+
'jsdoc/check-values': 'error',
64+
'jsdoc/empty-tags': 'error',
65+
'jsdoc/implements-on-classes': 'error',
66+
'jsdoc/match-description': 'error',
67+
'jsdoc/multiline-blocks': 'error',
68+
'jsdoc/no-bad-blocks': 'error',
69+
'jsdoc/no-defaults': 'error',
70+
'jsdoc/no-multi-asterisks': 'error',
71+
'jsdoc/no-types': 'error',
72+
'jsdoc/no-undefined-types': 'error',
73+
'jsdoc/require-asterisk-prefix': 'error',
74+
'jsdoc/require-description': 'error',
75+
'jsdoc/require-description-complete-sentence': 'error',
76+
'jsdoc/require-hyphen-before-param-description': 'error',
77+
'jsdoc/require-jsdoc': ['error', {publicOnly: true}],
78+
'jsdoc/require-param': 'error',
79+
'jsdoc/require-param-description': 'error',
80+
'jsdoc/require-param-name': 'error',
81+
'jsdoc/require-property': 'error',
82+
'jsdoc/require-property-description': 'error',
83+
'jsdoc/require-property-name': 'error',
84+
'jsdoc/require-property-type': 'error',
85+
'jsdoc/require-returns': ['error', {publicOnly: true}],
86+
'jsdoc/require-returns-check': 'error',
87+
'jsdoc/require-returns-description': 'error',
88+
'jsdoc/require-throws': 'error',
89+
'jsdoc/require-yields': 'error',
90+
'jsdoc/require-yields-check': 'error',
91+
'jsdoc/tag-lines': ['error', 'any', {startLines: 1}],
92+
'jsdoc/valid-types': 'error',
93+
},
94+
},
95+
96+
// Test file overrides
97+
{
98+
files: ['**/*.test.ts'],
99+
rules: {
100+
'@typescript-eslint/no-explicit-any': 'off',
101+
'no-restricted-syntax': 'off',
102+
},
103+
},
104+
105+
// Public API explicit module boundary types
106+
{
107+
files: ['src/public/**/*.ts'],
108+
ignores: ['**/public/node/themes/**/*'],
109+
rules: {
110+
'@typescript-eslint/explicit-module-boundary-types': 'error',
111+
},
112+
},
113+
114+
// React components (rely on plugins already defined in cli config)
115+
{
116+
files: ['src/private/node/ui/components/**/*.tsx'],
117+
settings: {
118+
react: {
119+
version: 'detect',
120+
},
121+
},
122+
rules: {
123+
'react/function-component-definition': [
124+
'error',
125+
{
126+
namedComponents: 'arrow-function',
127+
unnamedComponents: 'arrow-function',
128+
},
129+
],
130+
'react/hook-use-state': 2,
131+
'react/jsx-boolean-value': 2,
132+
'react/jsx-child-element-spacing': 2,
133+
'react/jsx-closing-bracket-location': 2,
134+
'react/jsx-closing-tag-location': 2,
135+
'react/jsx-curly-brace-presence': 2,
136+
'react/jsx-curly-spacing': 2,
137+
'react/jsx-equals-spacing': 2,
138+
'react/jsx-first-prop-new-line': 2,
139+
'react/jsx-fragments': 2,
140+
'react/jsx-handler-names': 2,
141+
'react/jsx-indent': [2, 2, {checkAttributes: true, indentLogicalExpressions: true}],
142+
'react/jsx-indent-props': [2, 2],
143+
'react/jsx-no-leaked-render': 2,
144+
'react/jsx-no-useless-fragment': 2,
145+
'react/jsx-pascal-case': 2,
146+
'react/jsx-props-no-multi-spaces': 2,
147+
'react/jsx-tag-spacing': 2,
148+
'react/no-namespace': 2,
149+
'react/no-object-type-as-default-prop': 2,
150+
'react/self-closing-comp': 2,
151+
'react/no-unused-prop-types': 2,
152+
'import-x/no-default-export': 2,
153+
'import-x/no-namespace': 2,
154+
'no-restricted-imports': [
155+
'error',
156+
{
157+
paths: [
158+
{
159+
name: 'react',
160+
importNames: ['FC'],
161+
message: 'Please use FunctionComponent from react instead.',
162+
},
163+
],
164+
},
165+
],
166+
'@typescript-eslint/naming-convention': [
167+
'error',
168+
{
169+
selector: 'interface',
170+
format: ['PascalCase'],
171+
custom: {
172+
regex: '^Props',
173+
match: false,
174+
},
175+
},
176+
],
177+
},
178+
},
179+
180+
// UI module max params
181+
{
182+
files: ['src/public/node/ui.tsx'],
183+
rules: {
184+
'max-params': ['error', 1],
185+
},
186+
},
187+
]
188+
189+
export default config

graphql.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function projectFactory(name: string, schemaName: string, project: string = 'app
1414
{
1515
add: {
1616
content:
17-
"/* eslint-disable @typescript-eslint/consistent-type-definitions, @typescript-eslint/naming-convention, @typescript-eslint/ban-types, @typescript-eslint/no-explicit-any, tsdoc/syntax, @typescript-eslint/no-duplicate-type-constituents, @typescript-eslint/no-redundant-type-constituents, @nx/enforce-module-boundaries */\nimport {JsonMapType} from '@shopify/cli-kit/node/toml'",
17+
"/* eslint-disable @typescript-eslint/consistent-type-definitions, @typescript-eslint/naming-convention, @typescript-eslint/no-explicit-any, tsdoc/syntax, @typescript-eslint/no-duplicate-type-constituents, @typescript-eslint/no-redundant-type-constituents, @nx/enforce-module-boundaries */\nimport {JsonMapType} from '@shopify/cli-kit/node/toml'",
1818
},
1919
},
2020
],
@@ -35,7 +35,7 @@ function projectFactory(name: string, schemaName: string, project: string = 'app
3535
{
3636
add: {
3737
content:
38-
"/* eslint-disable @typescript-eslint/consistent-type-definitions, @typescript-eslint/naming-convention, @typescript-eslint/ban-types, @typescript-eslint/no-duplicate-type-constituents, @typescript-eslint/no-redundant-type-constituents, @nx/enforce-module-boundaries */\nimport {JsonMapType} from '@shopify/cli-kit/node/toml'",
38+
"/* eslint-disable @typescript-eslint/consistent-type-definitions, @typescript-eslint/naming-convention, @typescript-eslint/no-duplicate-type-constituents, @typescript-eslint/no-redundant-type-constituents, @nx/enforce-module-boundaries */\nimport {JsonMapType} from '@shopify/cli-kit/node/toml'",
3939
},
4040
},
4141
{

0 commit comments

Comments
 (0)