@graphcommerce/eslint-config-pwa 9.1.0-canary.55 → 10.0.0-canary.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/index.mjs +260 -0
  3. package/package.json +21 -14
  4. package/index.js +0 -225
package/CHANGELOG.md CHANGED
@@ -1,5 +1,87 @@
1
1
  # Change Log
2
2
 
3
+ ## 10.0.0-canary.57
4
+
5
+ ## 10.0.0-canary.56
6
+
7
+ ### Major Changes
8
+
9
+ - [#2546](https://github.com/graphcommerce-org/graphcommerce/pull/2546) [`ed9332a`](https://github.com/graphcommerce-org/graphcommerce/commit/ed9332a7f78966d932041d9a7725641edc92b28d) - ## GraphCommerce 10 - Turbopack Support
10
+
11
+ This major release brings full Turbopack compatibility, dramatically improving development speed.
12
+
13
+ ### 🚀 Turbopack-Compatible Interceptor System
14
+
15
+ The entire plugin/interceptor system has been rewritten to work with Turbopack:
16
+
17
+ - **No more Webpack plugins** - Removed `InterceptorPlugin` webpack plugin entirely
18
+ - **File-based interception** - Original files are moved to `.original.tsx` and replaced with interceptor content
19
+ - **Direct imports** - Interceptors import from `.original` files instead of embedding source
20
+ - **New CLI commands**:
21
+ - `graphcommerce codegen-interceptors` - Generate interceptor files
22
+ - `graphcommerce cleanup-interceptors` - Reset interceptor system, restore original files
23
+ - **Stable file hashing** - Deterministic interceptor generation for better caching
24
+
25
+ ### ⚙️ Treeshakable Configuration System
26
+
27
+ Replaced Webpack `DefinePlugin`-based `import.meta.graphCommerce` with a new generated configuration system:
28
+
29
+ - **New `codegen-config-values` command** - Generates TypeScript files with precise typing
30
+ - **Schema-driven** - Dynamically introspects Zod schemas to determine all available properties
31
+ - **Fully treeshakable** - Unused config values are eliminated from the bundle
32
+ - **Type-safe** - Uses `Get<GraphCommerceConfig, 'path'>` for nested property access
33
+ - **Separate files for nested objects** - Optimal treeshaking for complex configurations
34
+
35
+ ### 🔧 withGraphCommerce Changes
36
+
37
+ - **Removed** `InterceptorPlugin` - No longer needed with file-based interception
38
+ - **Removed** `DefinePlugin` for `import.meta.graphCommerce` - Replaced with generated config
39
+ - **Removed** `@mui/*` alias rewrites - No longer required
40
+ - **Added** Turbopack loader rules for `.yaml`, `.yml`, and `.po` files
41
+ - **Added** `serverExternalPackages` for all `@whatwg-node/*` packages
42
+ - **Added** `optimizePackageImports` for better bundle optimization
43
+ - **Added** `images.qualities: [52, 75]` for Next.js image optimization
44
+
45
+ ### 📦 Lingui Configuration
46
+
47
+ - **Renamed** `lingui.config.js` → `lingui.config.ts` with TypeScript support
48
+ - **Updated** `@graphcommerce/lingui-next/config` to TypeScript with proper exports
49
+ - **Simplified** formatter options
50
+
51
+ ### ⚛️ React 19 & Next.js 16 Compatibility
52
+
53
+ - Updated `RefObject<T>` types for React 19 (now includes `null` by default)
54
+ - Replaced deprecated `React.VFC` with `React.FC`
55
+ - Fixed `useRef` calls to require explicit initial values
56
+ - Updated `MutableRefObject` usage in `framer-scroller`
57
+
58
+ ### 📋 ESLint 9 Flat Config
59
+
60
+ - Migrated from legacy `.eslintrc` to new flat config format (`eslint.config.mjs`)
61
+ - Updated `@typescript-eslint/*` packages to v8
62
+ - Fixed AST selector for `SxProps` rule (`typeParameters` → `typeArguments`)
63
+
64
+ ### 🔄 Apollo Client
65
+
66
+ - Fixed deprecated `name` option → `clientAwareness: { name: 'ssr' }`
67
+ - Updated error handling types to accept `ApolloError | null | undefined`
68
+
69
+ ### ⚠️ Breaking Changes
70
+
71
+ - **Node.js 24.x not supported** - Restricted to `>=20 <24.0.0` due to [nodejs/undici#4290](https://github.com/nodejs/undici/issues/4290)
72
+ - **Interceptor files changed** - Original components now at `.original.tsx`
73
+ - **Config access changed** - Use generated config values instead of `import.meta.graphCommerce`
74
+ - **ESLint config format** - Must use flat config (`eslint.config.mjs`)
75
+ - **Lingui config** - Rename `lingui.config.js` to `lingui.config.ts`
76
+
77
+ ### 🗑️ Removed
78
+
79
+ - `InterceptorPlugin` webpack plugin
80
+ - `configToImportMeta` utility
81
+ - Webpack `DefinePlugin` usage for config
82
+ - `@mui/*` modern alias rewrites
83
+ - Debug plugins (`CircularDependencyPlugin`, `DuplicatesPlugin`) ([@paales](https://github.com/paales))
84
+
3
85
  ## 9.1.0-canary.55
4
86
 
5
87
  ## 9.1.0-canary.54
package/index.mjs ADDED
@@ -0,0 +1,260 @@
1
+ import nextPlugin from '@next/eslint-plugin-next'
2
+ import typescriptPlugin from '@typescript-eslint/eslint-plugin'
3
+ import typescriptParser from '@typescript-eslint/parser'
4
+ import importPlugin from 'eslint-plugin-import'
5
+ import jsxA11yPlugin from 'eslint-plugin-jsx-a11y'
6
+ import reactPlugin from 'eslint-plugin-react'
7
+ import reactHooksPlugin from 'eslint-plugin-react-hooks'
8
+ import globals from 'globals'
9
+
10
+ /** @type {import('eslint').Linter.Config[]} */
11
+ export default [
12
+ // Flat configs from plugins
13
+ reactHooksPlugin.configs.flat.recommended,
14
+ importPlugin.flatConfigs.recommended,
15
+ importPlugin.flatConfigs.typescript,
16
+ reactPlugin.configs.flat.recommended,
17
+ reactPlugin.configs.flat['jsx-runtime'],
18
+ jsxA11yPlugin.flatConfigs.recommended,
19
+
20
+ // Global ignores
21
+ {
22
+ ignores: [
23
+ '**/node_modules/**',
24
+ '**/.next/**',
25
+ '**/dist/**',
26
+ '**/.mesh/**',
27
+ '**/generated/**',
28
+ '**/*.interceptor.tsx',
29
+ '**/*.interceptor.ts',
30
+ ],
31
+ },
32
+
33
+ // Base config for all files
34
+ {
35
+ languageOptions: {
36
+ ecmaVersion: 2022,
37
+ sourceType: 'module',
38
+ globals: {
39
+ ...globals.browser,
40
+ ...globals.node,
41
+ ...globals.es2022,
42
+ Atomics: 'readonly',
43
+ SharedArrayBuffer: 'readonly',
44
+ },
45
+ },
46
+ plugins: {
47
+ '@next/next': nextPlugin,
48
+ },
49
+ settings: {
50
+ react: {
51
+ version: 'detect',
52
+ },
53
+ 'import/resolver': {
54
+ typescript: true,
55
+ node: true,
56
+ },
57
+ },
58
+ rules: {
59
+ // eslint
60
+ 'default-case': 'off',
61
+ 'no-plusplus': 'off',
62
+ 'no-param-reassign': ['error', { props: false }],
63
+ 'no-console': [1, { allow: ['warn', 'error', 'info'] }],
64
+ 'spaced-comment': ['error', 'always', { markers: ['/'] }],
65
+ 'prefer-const': ['error', { destructuring: 'all' }],
66
+ 'no-underscore-dangle': [
67
+ 'error',
68
+ { allow: ['__typename', '__type', '_N_X', '_N_Y', '__N', '__NEXT'] },
69
+ ],
70
+ 'no-restricted-syntax': [
71
+ 'error',
72
+ {
73
+ selector: 'ForInStatement',
74
+ message:
75
+ 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
76
+ },
77
+ {
78
+ selector: 'LabeledStatement',
79
+ message:
80
+ 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
81
+ },
82
+ {
83
+ selector: 'WithStatement',
84
+ message:
85
+ '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
86
+ },
87
+ {
88
+ selector: 'TSTypeReference[typeName.name="SxProps"]:not([typeArguments])',
89
+ message: 'SxProps must have Theme parameter to avoid significant compiler slowdown.',
90
+ },
91
+ {
92
+ selector: 'TSTypeReference[typeName.name="Components"]:not([typeArguments])',
93
+ message: 'Components must have Theme parameter to avoid significant compiler slowdown.',
94
+ },
95
+ ],
96
+
97
+ // import
98
+ 'import/prefer-default-export': 'off',
99
+ 'import/no-extraneous-dependencies': [
100
+ 'error',
101
+ {
102
+ devDependencies: [
103
+ 'next.config.js',
104
+ 'next.config.ts',
105
+ '**/test/**',
106
+ '**/*.d.ts',
107
+ '**/*.spec.ts',
108
+ '**/__tests__/**',
109
+ ],
110
+ },
111
+ ],
112
+ 'import/order': 'off',
113
+ 'import/no-relative-packages': 'error',
114
+
115
+ // next
116
+ '@next/next/no-html-link-for-pages': 'off',
117
+
118
+ // jsx-a11y
119
+ 'jsx-a11y/anchor-is-valid': 'off',
120
+
121
+ // react
122
+ 'react/prop-types': 'off',
123
+ 'react/jsx-props-no-spreading': 'off',
124
+ 'react/react-in-jsx-scope': 'off',
125
+ 'react/require-default-props': 'off',
126
+ 'react/jsx-no-useless-fragment': ['error', { allowExpressions: true }],
127
+ 'react/self-closing-comp': ['warn'],
128
+ 'react/jsx-no-duplicate-props': ['error', { ignoreCase: false }],
129
+ 'react/function-component-definition': [
130
+ 'error',
131
+ {
132
+ namedComponents: 'function-declaration',
133
+ unnamedComponents: 'arrow-function',
134
+ },
135
+ ],
136
+ 'prefer-arrow-callback': ['error', { allowNamedFunctions: true }],
137
+
138
+ // react-hooks (base rules come from flat config below, we just customize exhaustive-deps)
139
+ 'react-hooks/exhaustive-deps': [
140
+ 'error',
141
+ { additionalHooks: '(useIsomorphicLayoutEffect|useMemoDeep)' },
142
+ ],
143
+ },
144
+ },
145
+
146
+ // TypeScript files
147
+ {
148
+ files: ['**/*.ts', '**/*.tsx'],
149
+ languageOptions: {
150
+ parser: typescriptParser,
151
+ parserOptions: {
152
+ projectService: true,
153
+ },
154
+ },
155
+ plugins: {
156
+ '@typescript-eslint': typescriptPlugin,
157
+ },
158
+ rules: {
159
+ ...typescriptPlugin.configs.recommended.rules,
160
+ '@typescript-eslint/indent': 'off',
161
+ '@typescript-eslint/semi': 'off',
162
+ '@typescript-eslint/explicit-function-return-type': 'off',
163
+ '@typescript-eslint/no-unsafe-assignment': 'off',
164
+ '@typescript-eslint/no-unsafe-call': 'off',
165
+ '@typescript-eslint/no-unsafe-member-access': 'off',
166
+ '@typescript-eslint/no-unsafe-return': 'off',
167
+ '@typescript-eslint/restrict-template-expressions': 'off',
168
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
169
+ '@typescript-eslint/naming-convention': 'off',
170
+ '@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: false }],
171
+ '@typescript-eslint/no-unbound-method': 'off',
172
+ '@typescript-eslint/no-restricted-imports': [
173
+ 'warn',
174
+ {
175
+ paths: [
176
+ {
177
+ name: 'next/image',
178
+ message: "Please use `import { Image } from '@graphcommerce/image'` instead.",
179
+ },
180
+ {
181
+ name: '@mui/system',
182
+ message: "Please use `@mui/material'` instead.",
183
+ },
184
+ {
185
+ name: '@mui/material',
186
+ importNames: [
187
+ 'Autocomplete',
188
+ 'Checkbox',
189
+ 'Radio',
190
+ 'Select',
191
+ 'Slider',
192
+ 'Switch',
193
+ 'TextField',
194
+ 'ToggleButtonGroup',
195
+ ],
196
+ message: `Please use \`import { SelectElement, TextFieldElement, etc } from '@graphcommerce/ecommerce-ui'\` for usage in forms. https://github.com/graphcommerce-org/graphcommerce/tree/main/packages/ecommerce-ui/components/FormComponents You can add '// eslint-disable-next-line @typescript-eslint/no-restricted-imports' comment if you're sure you want to use it.`,
197
+ },
198
+ {
199
+ name: '@mui/material',
200
+ importNames: ['useMediaQuery'],
201
+ message: `useMediaQuery can cause large CLS/LCP issues when used to render a specific UI on a breakpoint. See https://mui.com/system/display/#hiding-elements for alternatives. You can add '// eslint-disable-next-line @typescript-eslint/no-restricted-imports' comment if you're sure you want to use it.`,
202
+ },
203
+ {
204
+ name: '@emotion/react',
205
+ importNames: ['Theme', 'GlobalProps', 'ThemeContext'],
206
+ message: 'Import from @mui/material instead of @emotion/react.',
207
+ },
208
+ ],
209
+ patterns: [
210
+ {
211
+ group: ['*.interceptor'],
212
+ message: 'Importing *.interceptor is NOT allowed',
213
+ },
214
+ ],
215
+ },
216
+ ],
217
+ '@typescript-eslint/consistent-type-imports': 'warn',
218
+ 'import/no-duplicates': 'off',
219
+ },
220
+ },
221
+
222
+ // TSX files - no default export
223
+ {
224
+ files: ['**/*.tsx'],
225
+ rules: { 'import/no-default-export': 'error' },
226
+ },
227
+
228
+ // Copy files - relax rules
229
+ {
230
+ files: ['**/copy/**/*.tsx'],
231
+ rules: { 'import/no-extraneous-dependencies': 'off' },
232
+ },
233
+
234
+ // Pages - allow default export
235
+ {
236
+ files: ['**/pages/**/*.tsx'],
237
+ rules: { 'import/no-default-export': 'off' },
238
+ },
239
+
240
+ // Test files
241
+ {
242
+ files: ['**/*.spec.ts', '**/*.spec.tsx', '**/__tests__/**', 'scripts/**', 'test/**'],
243
+ languageOptions: {
244
+ globals: {
245
+ ...globals.jest,
246
+ },
247
+ },
248
+ rules: {
249
+ 'import/no-extraneous-dependencies': 'off',
250
+ },
251
+ },
252
+
253
+ // JavaScript files
254
+ {
255
+ files: ['**/*.js', '**/*.jsx', '**/*.mjs'],
256
+ rules: {
257
+ semi: 'off',
258
+ },
259
+ },
260
+ ]
package/package.json CHANGED
@@ -2,22 +2,29 @@
2
2
  "name": "@graphcommerce/eslint-config-pwa",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "9.1.0-canary.55",
6
- "main": "index.js",
5
+ "version": "10.0.0-canary.57",
6
+ "type": "module",
7
+ "main": "index.mjs",
8
+ "exports": {
9
+ ".": "./index.mjs"
10
+ },
7
11
  "dependencies": {
8
- "@graphcommerce/typescript-config-pwa": "9.1.0-canary.55",
9
- "@next/eslint-plugin-next": "15.1.3",
10
- "@typescript-eslint/eslint-plugin": "^7.18.0",
11
- "@typescript-eslint/parser": "^7.18.0",
12
- "eslint": "^8.57.1",
13
- "eslint-config-airbnb": "19.0.4",
14
- "eslint-config-airbnb-typescript": "18.0.0",
15
- "eslint-config-prettier": "9.1.0",
16
- "eslint-plugin-import": "2.31.0",
12
+ "@eslint/compat": "^1.2.9",
13
+ "@eslint/eslintrc": "^3.3.1",
14
+ "@eslint/js": "^9.39.1",
15
+ "@graphcommerce/typescript-config-pwa": "10.0.0-canary.57",
16
+ "@next/eslint-plugin-next": "16.0.6",
17
+ "@typescript-eslint/eslint-plugin": "^8.48.1",
18
+ "@typescript-eslint/parser": "^8.48.1",
19
+ "eslint": "^9.39.1",
20
+ "eslint-config-prettier": "10.1.8",
21
+ "eslint-import-resolver-typescript": "^4.4.4",
22
+ "eslint-plugin-import": "2.32.0",
17
23
  "eslint-plugin-jsx-a11y": "6.10.2",
18
- "eslint-plugin-react": "^7.37.2",
19
- "eslint-plugin-react-hooks": "4.6.2",
20
- "typescript": "5.7.2"
24
+ "eslint-plugin-react": "^7.37.5",
25
+ "eslint-plugin-react-hooks": "7.0.1",
26
+ "globals": "^16.2.0",
27
+ "typescript": "5.9.3"
21
28
  },
22
29
  "sideEffects": false
23
30
  }
package/index.js DELETED
@@ -1,225 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es2022: true,
5
- node: true,
6
- },
7
- extends: ['airbnb', 'plugin:import/recommended', 'prettier'],
8
- globals: {
9
- Atomics: 'readonly',
10
- SharedArrayBuffer: 'readonly',
11
- },
12
- parserOptions: {
13
- ecmaFeatures: {
14
- jsx: true,
15
- },
16
- ecmaVersion: 2018,
17
- sourceType: 'module',
18
- },
19
- plugins: ['react', '@next/eslint-plugin-next'],
20
- rules: {
21
- // eslint
22
- 'default-case': 'off',
23
- 'no-plusplus': 'off',
24
- 'no-param-reassign': ['error', { props: false }],
25
- 'no-console': [1, { allow: ['warn', 'error', 'info'] }],
26
- 'spaced-comment': ['error', 'always', { markers: ['/'] }],
27
- 'prefer-const': ['error', { destructuring: 'all' }],
28
- 'no-underscore-dangle': [
29
- 'error',
30
- { allow: ['__typename', '__type', '_N_X', '_N_Y', '__N', '__NEXT'] },
31
- ],
32
- 'no-restricted-syntax': [
33
- 'error',
34
- {
35
- selector: 'ForInStatement',
36
- message:
37
- 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
38
- },
39
- {
40
- selector: 'LabeledStatement',
41
- message:
42
- 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
43
- },
44
- {
45
- selector: 'WithStatement',
46
- message:
47
- '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
48
- },
49
- {
50
- selector: 'TSTypeReference[typeName.name="SxProps"]:not([typeParameters])',
51
- message: 'SxProps must have Theme parameter to avoid significant compiler slowdown.',
52
- },
53
- {
54
- selector: 'TSTypeReference[typeName.name="Components"]:not([typeParameters])',
55
- message: 'Components must have Theme parameter to avoid significant compiler slowdown.',
56
- },
57
- ],
58
-
59
- // plugin:import/recommended & plugin:import/typescript
60
- 'import/prefer-default-export': 'off',
61
- 'import/no-extraneous-dependencies': [
62
- 'error',
63
- {
64
- devDependencies: [
65
- 'next.config.js',
66
- '**/test/**',
67
- '**/*.d.ts',
68
- '**/*.spec.ts',
69
- '**/__tests__/**',
70
- ],
71
- },
72
- ],
73
- 'import/order': 'off', // Handled by prettier
74
- 'import/no-relative-packages': 'error',
75
-
76
- // next
77
- '@next/next/no-html-link-for-pages': 'off',
78
-
79
- // jsx-a11y
80
- 'jsx-a11y/anchor-is-valid': 'off',
81
-
82
- // react
83
- 'react/prop-types': 'off',
84
- 'react/jsx-props-no-spreading': 'off',
85
- 'react/react-in-jsx-scope': 'off',
86
- 'react/require-default-props': 'off',
87
- 'react/jsx-no-useless-fragment': ['error', { allowExpressions: true }],
88
- 'react-hooks/exhaustive-deps': [
89
- 'error',
90
- { additionalHooks: '(useIsomorphicLayoutEffect|useMemoDeep)' },
91
- ],
92
- 'react/self-closing-comp': ['warn'],
93
- 'react/jsx-no-duplicate-props': ['error', { ignoreCase: false }],
94
- 'react/function-component-definition': [
95
- 'error',
96
- {
97
- namedComponents: 'function-declaration',
98
- unnamedComponents: 'arrow-function',
99
- },
100
- ],
101
- 'prefer-arrow-callback': ['error', { allowNamedFunctions: true }],
102
- },
103
- overrides: [
104
- // TypeScript files
105
- {
106
- files: ['*.ts', '*.tsx'],
107
- extends: [
108
- 'airbnb-typescript',
109
- 'airbnb/hooks',
110
- 'plugin:@typescript-eslint/recommended',
111
- 'plugin:@typescript-eslint/recommended-requiring-type-checking',
112
- 'plugin:import/typescript',
113
- ],
114
- parser: '@typescript-eslint/parser',
115
- parserOptions: {
116
- project: ['./tsconfig.json'],
117
- },
118
- plugins: ['@typescript-eslint'],
119
- rules: {
120
- '@typescript-eslint/indent': 'off',
121
- '@typescript-eslint/semi': 'off',
122
- '@typescript-eslint/explicit-function-return-type': 'off',
123
- '@typescript-eslint/no-unsafe-assignment': 'off',
124
- '@typescript-eslint/no-unsafe-call': 'off',
125
- '@typescript-eslint/no-unsafe-member-access': 'off',
126
- '@typescript-eslint/no-unsafe-return': 'off',
127
- '@typescript-eslint/restrict-template-expressions': 'off',
128
- '@typescript-eslint/explicit-module-boundary-types': 'off',
129
- '@typescript-eslint/naming-convention': 'off',
130
- '@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: false }],
131
- '@typescript-eslint/no-unbound-method': 'off',
132
- '@typescript-eslint/no-restricted-imports': [
133
- 'warn',
134
- {
135
- paths: [
136
- {
137
- name: 'next/image',
138
- message: "Please use `import { Image } from '@graphcommerce/image'` instead.",
139
- },
140
- {
141
- name: '@mui/system',
142
- message: "Please use `@mui/material'` instead.",
143
- },
144
- {
145
- name: '@mui/material',
146
- importNames: [
147
- 'Autocomplete',
148
- 'Checkbox',
149
- 'Radio',
150
- 'Select',
151
- 'Slider',
152
- 'Switch',
153
- 'TextField',
154
- 'ToggleButtonGroup',
155
- ],
156
- message: `Please use \`import { SelectElement, TextFieldElement, etc } from '@graphcommerce/ecommerce-ui'\` for usage in forms. https://github.com/graphcommerce-org/graphcommerce/tree/main/packages/ecommerce-ui/components/FormComponents You can add '// eslint-disable-next-line @typescript-eslint/no-restricted-imports' comment if you're sure you want to use it.`,
157
- },
158
- {
159
- name: '@mui/material',
160
- importNames: ['useMediaQuery'],
161
- message: `useMediaQuery can cause large CLS/LCP issues when used to render a specific UI on a breakpoint. See https://mui.com/system/display/#hiding-elements for alternatives. You can add '// eslint-disable-next-line @typescript-eslint/no-restricted-imports' comment if you're sure you want to use it.`,
162
- },
163
- {
164
- name: '@emotion/react',
165
- importNames: ['Theme', 'GlobalProps', 'ThemeContext'],
166
- message: 'Import from @mui/material instead of @emotion/react.',
167
- },
168
- ],
169
- patterns: [
170
- {
171
- group: ['*.interceptor'],
172
- message: 'Importing *.interceptor is NOT allowed',
173
- },
174
- ],
175
- },
176
- ],
177
- '@typescript-eslint/consistent-type-imports': 'warn',
178
- 'import/no-duplicates': 'off',
179
- },
180
- },
181
- {
182
- files: ['*.tsx'],
183
- rules: { 'import/no-default-export': ['error'] },
184
- },
185
- {
186
- files: ['**/copy/**/*.tsx'],
187
- rules: { 'import/no-extraneous-dependencies': 'off' },
188
- },
189
- {
190
- files: ['**/pages/**/*.tsx'],
191
- rules: { 'import/no-default-export': 'off' },
192
- },
193
- {
194
- files: ['**/*.interceptor.tsx', '**/*.interceptor.ts'],
195
- rules: {
196
- 'import/export': 'off',
197
- 'import/first': 'off',
198
- 'import/no-extraneous-dependencies': 'off',
199
- },
200
- },
201
- {
202
- files: ['generated/*'],
203
- rules: {
204
- '@typescript-eslint/camelcase': 'off',
205
- },
206
- },
207
- {
208
- files: ['**/*.spec.ts', '**/*.spec.tsx', '**/__tests__/**', 'scripts/**', 'test/**'],
209
- env: {
210
- jest: true,
211
- },
212
- rules: {
213
- 'import/no-extraneous-dependencies': 'off',
214
- },
215
- },
216
- // JavaScript files override
217
- {
218
- files: ['*.js', '*.jsx', '*.mjs'],
219
- extends: ['airbnb', 'airbnb/hooks', 'plugin:import/recommended', 'prettier'],
220
- rules: {
221
- semi: 'off',
222
- },
223
- },
224
- ],
225
- }