-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Expand file tree
/
Copy patheslint.config.ts
More file actions
55 lines (52 loc) · 1.35 KB
/
eslint.config.ts
File metadata and controls
55 lines (52 loc) · 1.35 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
import { baseConfig } from '@packages/eslint-config'
// Root config files outside tsconfig may use the default project (no ** globs allowed).
const allowDefaultProject = [
'babel.config.js',
'cypress.config.js',
'eslint.config.ts',
'rollup.config.mjs',
'vite.config.ts',
]
// Only enable projectService for files in tsconfig or allowDefaultProject so cypress/** is linted without type-aware rules.
const projectServiceFiles = [
'src/**/*.ts',
'babel.config.js',
'cypress.config.js',
'eslint.config.ts',
'rollup.config.mjs',
'vite.config.ts',
]
export default [
{ ignores: ['**/dist', '**/*.d.ts', '**/package-lock.json', '**/tsconfig.json', '**/cypress/fixtures'] },
...baseConfig,
{
files: ['**/*.js', '**/*.ts', '**/*.jsx', '**/*.tsx'],
rules: {
'no-console': 'off',
'mocha/no-global-tests': 'off',
'react/prop-types': 'off',
'react/display-name': 'off',
},
},
{
files: projectServiceFiles,
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname,
projectService: {
allowDefaultProject,
},
},
},
},
{
files: ['cypress/**/*.js', 'cypress/**/*.ts', 'cypress/**/*.jsx', 'cypress/**/*.tsx'],
languageOptions: {
globals: {
Cypress: 'readonly',
cy: 'readonly',
expect: 'readonly',
},
},
},
]