-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
63 lines (62 loc) · 2.1 KB
/
Copy patheslint.config.js
File metadata and controls
63 lines (62 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import jsxA11y from 'eslint-plugin-jsx-a11y'
import nextPlugin from '@next/eslint-plugin-next'
import importPlugin from 'eslint-plugin-import'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{ ignores: ['.next'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2022,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'jsx-a11y': jsxA11y,
'@next/next': nextPlugin,
import: importPlugin,
},
rules: {
...reactHooks.configs.recommended.rules,
...nextPlugin.configs.recommended.rules,
...nextPlugin.configs['core-web-vitals'].rules,
'@typescript-eslint/consistent-type-imports': ['warn', {
prefer: 'type-imports',
fixStyle: 'inline-type-imports',
}],
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
}],
// Guardrail against phantom imports: catch any `import from 'foo'` where
// 'foo' is only a transitive dep. This exact failure (advanced-cropper
// imported but only reachable via react-advanced-cropper) broke the
// Vercel production build for ~14h because pnpm's strict isolated
// layout doesn't expose transitive deps the way npm's flat hoisting
// does. Test files, configs, and scripts are allowed to use
// devDependencies.
'import/no-extraneous-dependencies': ['error', {
devDependencies: [
'**/*.test.{ts,tsx}',
'**/*.spec.{ts,tsx}',
'**/__test-helpers__.{ts,tsx}',
'**/test-fixtures/**',
'src/e2e/**',
'scripts/**',
'test-setup*.ts',
'vitest.config.ts',
'playwright.config.ts',
'eslint.config.js',
'next.config.ts',
'sentry.*.config.ts',
],
optionalDependencies: false,
peerDependencies: false,
}],
},
},
)