-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
114 lines (109 loc) · 3.95 KB
/
Copy patheslint.config.js
File metadata and controls
114 lines (109 loc) · 3.95 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
const jsLint = require('@eslint/js');
const stylistic = require('@stylistic/eslint-plugin');
const tsParser = require('@typescript-eslint/parser');
const globals = require('globals');
const tsLint = require('typescript-eslint');
module.exports = [
{
files: ['**/*.{js,mjs,cjs,ts,mts}'],
},
{
ignores: ['**/dist/**', '**/node_modules/**', '**/public/**', '**/build/**', '**/bundle/**', '**/test/**', '**/test2/**', '**/wasm/**', '**/example/**'],
},
jsLint.configs.recommended,
// ...tsLint.configs.recommended,
...tsLint.configs.recommendedTypeChecked,
...tsLint.configs.stylisticTypeChecked,
stylistic.configs['disable-legacy'],
stylistic.configs.customize({
indent: 2,
quotes: 'single',
semi: true,
commaDangle: 'always-multiline',
jsx: false,
arrowParens: true,
braceStyle: '1tbs',
blockSpacing: true,
quoteProps: 'as-needed',
}),
{
languageOptions: {
globals: { ...globals.node },
parser: tsParser,
parserOptions: {
projectService: true,
tsconfigRootDir: __dirname,
},
},
rules: {
// TypeScript specific rules
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/prefer-promise-reject-errors': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-tslint-comment': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
'@typescript-eslint/prefer-for-of': 'off',
'@typescript-eslint/prefer-find': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',
'@typescript-eslint/no-namespace': 'off',
'@stylistic/generator-star-spacing': ['error', { before: true, after: false }],
// Stylistic specific rules
'@stylistic/max-len': ['error', { code: 170, tabWidth: 2 }],
'@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
'@stylistic/operator-linebreak': 'off',
'@stylistic/comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'only-multiline',
functions: 'always-multiline',
enums: 'always-multiline',
generics: 'always-multiline',
tuples: 'always-multiline',
},
],
semi: [1, 'always'],
// quotes: ['error', 'single'],
'comma-dangle': ['error', 'only-multiline'],
'no-multiple-empty-lines': ['warn', { max: 1, maxEOF: 0 }],
'eol-last': ['error', 'always'],
'space-before-function-paren': ['error', { named: 'never' }],
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'no-case-declarations': 'off',
'no-async-promise-executor': 'off',
'no-control-regex': 'off',
},
},
{
files: ['**/*.js', '**/*.cjs', '**/*.mjs', '*.d.ts', '*.config.ts'],
...tsLint.configs.disableTypeChecked,
},
];