-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
44 lines (43 loc) · 1.42 KB
/
eslint.config.js
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
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', '*.ts'] }, tsconfigRootDir: __dirname },
},
},
{
files: ['**/*.ts'],
languageOptions: { globals: { ...globals.browser, ...globals.builtin } },
name: 'TypeScript',
plugins: { perfectionist },
},
{
...tseslint.configs.disableTypeChecked,
files: ['**/*.js'],
ignores: ['**/*.config.js'],
name: 'JavaScript',
},
{
...tseslint.configs.disableTypeChecked,
files: ['**/*.config.js'],
languageOptions: { globals: { ...globals.builtin, ...globals.node } },
name: 'JavaScript configs',
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,
);