-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
73 lines (72 loc) · 2.32 KB
/
Copy patheslint.config.js
File metadata and controls
73 lines (72 loc) · 2.32 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
import eslint from '@eslint/js';
import prettier from 'eslint-config-prettier';
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
import { createNodeResolver, flatConfigs as importConfigs } from 'eslint-plugin-import-x';
import securityPlugin from 'eslint-plugin-security';
import { configs as ymlConfigs } from 'eslint-plugin-yml';
import { defineConfig } from 'eslint/config';
import globals from 'globals';
import { configs as tsConfigs } from 'typescript-eslint';
export default defineConfig([
{ ignores: ['coverage/', 'lib/', 'bin/', 'adopter.*'] },
eslint.configs.all,
importConfigs.recommended,
importConfigs.typescript,
securityPlugin.configs.recommended,
{
extends: [ymlConfigs.standard, ymlConfigs.prettier],
files: ['*.yaml', '*.yml'],
},
{
files: ['**/*.js', '**/*.ts'],
languageOptions: {
ecmaVersion: 'latest',
globals: { ...globals.node },
parserOptions: { project: 'tsconfig.json' },
sourceType: 'module',
},
rules: {
'init-declarations': 'off',
'max-lines': ['error', { max: 130, skipBlankLines: true, skipComments: true }],
'max-lines-per-function': ['error', { max: 24, skipBlankLines: true, skipComments: true }],
'max-statements': ['error', { max: 35 }],
'no-magic-numbers': ['error', { ignore: [-1, 0, 1, 2] }],
'no-plusplus': 'off',
'no-ternary': 'off',
'no-undefined': 'off',
'one-var': 'off',
'sort-imports': 'off',
},
settings: {
'import-x/resolver-next': [createTypeScriptImportResolver(), createNodeResolver()],
},
},
{
extends: [...tsConfigs.all],
files: ['**/*.ts'],
rules: {
'@typescript-eslint/no-magic-numbers': ['error', { ignore: [-1, 0, 1, 2] }],
'@typescript-eslint/no-unsafe-type-assertion': 'off',
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
},
},
{
files: ['**/*.test.*'],
rules: { '@typescript-eslint/no-floating-promises': 'off' },
},
{
files: ['**/*.test.*', '*.config.@(js|ts)'],
rules: {
'@typescript-eslint/no-magic-numbers': 'off',
'max-lines': 'off',
'max-lines-per-function': 'off',
'no-magic-numbers': 'off',
'no-undefined': 'off',
},
},
{
extends: [tsConfigs.disableTypeChecked],
files: ['*.config.js'],
},
prettier,
]);