-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
74 lines (71 loc) · 2.2 KB
/
Copy patheslint.config.js
File metadata and controls
74 lines (71 loc) · 2.2 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
64
65
66
67
68
69
70
71
72
73
74
// @ts-check
import payloadEsLintConfig from '@payloadcms/eslint-config'
// Only TypeScript/TSX is hand-written in this repo. JS/MJS/CJS files are either
// generated (Next build output, payload importMap), config, or helper scripts
// that aren't worth type-aware linting. The `lint` script in package.json
// scopes ESLint to src/dev/tests TS(X), and the ignores below are a defensive
// second layer so running `eslint` without args doesn't accidentally crawl
// generated artifacts.
export const defaultESLintIgnores = [
'**/.temp',
'**/.*', // ignore all dotfiles
'**/.git',
'**/.hg',
'**/.pnp.*',
'**/.svn',
'**/tsconfig.tsbuildinfo',
'**/README.md',
'**/payload-types.ts',
'src/components/BackupDashboard/backupDashboardInlineCss.ts',
'**/dist/',
'**/.next/**',
'**/.yarn/',
'**/build/',
'**/node_modules/',
'**/temp/',
'**/coverage/**',
'**/playwright-report/**',
'**/test-results/**',
'**/blob-report/**',
'**/.playwright/**',
'**/.playwright-mcp/**',
'**/*.js',
'**/*.mjs',
'**/*.cjs',
'**/*.jsx',
]
export default [
{ ignores: defaultESLintIgnores },
...payloadEsLintConfig,
{
rules: {
'no-restricted-exports': 'off',
},
},
{
languageOptions: {
parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
projectService: {
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 40,
allowDefaultProject: ['*.spec.ts', '*.d.ts', 'playwright.config.ts'],
},
tsconfigRootDir: import.meta.dirname,
},
},
},
{
// Tests rely heavily on Vitest mock patterns that legitimately trip a few
// strict rules: `async () => value` shorthand for resolved promises, the
// `importOriginal<typeof import('...')>()` pattern for partial mocks, and
// occasional `any` for loosely-typed fixtures. Keep these rules strict in
// production code under src/ and dev/, but relax them here.
files: ['tests/**/*.ts', 'tests/**/*.tsx', '**/*.test.ts', '**/*.test.tsx', '**/*.spec.ts'],
rules: {
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/consistent-type-imports': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
]