-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy patheslint.config.mjs
More file actions
104 lines (95 loc) · 3.72 KB
/
eslint.config.mjs
File metadata and controls
104 lines (95 loc) · 3.72 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
// noinspection JSUnusedGlobalSymbols
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
export default [
{
ignores: ["**/*.spec.ts", "**/*.d.ts", "dist/**", "vitest.config.ts", "lib/classes/messages/*.ts", "examples/**/*.ts"],
},
...compat.extends("eslint:recommended", "plugin:@typescript-eslint/all").map(config => ({
...config,
files: ["**/*.ts"],
})),
{
files: ["**/*.ts"],
plugins: {
"@typescript-eslint": typescriptEslint,
},
languageOptions: {
parser: tsParser,
ecmaVersion: 5,
sourceType: "script",
parserOptions: {
project: "./tsconfig.json",
},
},
rules: {
"@typescript-eslint/prefer-destructuring": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/no-unnecessary-condition": "off",
"@typescript-eslint/no-magic-numbers": "off",
"@typescript-eslint/unified-signatures": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-type-assertion": "off",
"@typescript-eslint/no-extraneous-class": "off",
"@typescript-eslint/class-methods-use-this": "off",
"@typescript-eslint/prefer-readonly-parameter-types": "off",
"@typescript-eslint/max-params": "off",
"@typescript-eslint/prefer-literal-enum-member": "off",
"@typescript-eslint/prefer-enum-initializers": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/switch-exhaustiveness-check": [
'error',
{
"allowDefaultCaseForExhaustiveSwitch": true,
"considerDefaultExhaustiveForUnions": true
}
],
"@typescript-eslint/parameter-properties": [
'error',
{
'allow': ['public readonly', 'private readonly']
},
],
"@typescript-eslint/member-ordering": [
"error",
{
"default": [
"public-static-field",
"public-instance-field",
"private-static-field",
"private-instance-field",
"constructor",
"public-static-method",
"public-instance-method",
"private-static-method",
"private-instance-method"
]
}
],
"@typescript-eslint/no-unused-vars": ["error", {
caughtErrorsIgnorePattern: "^_",
argsIgnorePattern: "^_",
varsIgnorePattern: "^_"
}],
"@typescript-eslint/naming-convention": ["error", {
selector: "enumMember",
format: null,
}],
},
},
];