-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
60 lines (59 loc) · 1.8 KB
/
eslint.config.js
File metadata and controls
60 lines (59 loc) · 1.8 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
const eslint = require('@eslint/js');
const perfectionist = require('eslint-plugin-perfectionist');
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
const globals = require('globals');
const jsoncParser = require('jsonc-eslint-parser');
const tseslint = require('typescript-eslint');
module.exports = tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: { allowDefaultProject: ['*.js'] },
tsconfigRootDir: __dirname,
},
},
},
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
globals: { ...globals.browser, ...globals.builtin },
},
name: 'TypeScript',
rules: {
// Off until context.parserOptions is reliably set by the parser (projectService)
'@typescript-eslint/consistent-generic-constructors': 'off',
'@typescript-eslint/no-deprecated': 'off',
},
},
{
...tseslint.configs.disableTypeChecked,
files: ['**/*.js'],
ignores: ['**/*.config.js'],
name: 'JavaScript',
},
{
...tseslint.configs.disableTypeChecked,
files: ['**/*.config.js'],
languageOptions: {
globals: { ...globals.builtin, ...globals.node },
parserOptions: { program: null, project: false, projectService: false },
},
name: 'JavaScript configs',
rules: {
...tseslint.configs.disableTypeChecked.rules,
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
},
},
{
...tseslint.configs.disableTypeChecked,
files: ['**/*.json'],
languageOptions: { parser: jsoncParser },
name: 'JSON',
},
perfectionist.configs['recommended-natural'],
eslintPluginPrettierRecommended,
);