forked from edgedb/edgedb-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
61 lines (58 loc) · 1.88 KB
/
eslint.config.mjs
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
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
const DRIVER_PATH = "packages/driver/src/**/*.?(m)ts";
const GENERATE_PATH = "packages/generate/src/**/*.?(m)ts";
const FEATURE_LIBRARIES_PATH = "packages/!(driver|generate)/src/**/*.?(m)ts";
const INTEGRATION_TESTS_PATH = "integration-tests/*/*.test.?(m)ts";
const ALL_PATHS = [
DRIVER_PATH,
GENERATE_PATH,
FEATURE_LIBRARIES_PATH,
INTEGRATION_TESTS_PATH,
];
export default tseslint.config(
{
...eslint.configs.recommended,
files: ALL_PATHS,
rules: {
...eslint.configs.recommended.rules,
"no-empty-function": "off",
},
},
...tseslint.configs.recommended.map((config) => ({
...config,
files: ALL_PATHS,
rules: {
...config.rules,
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
// Svelte doesn't correctly compile if imports of the generated /modules
// aren't imported as 'import type' in other parts of the generated
// querybuilder, so set this option to ensure we always do that
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
},
})),
...tseslint.configs.stylistic.map((config) => ({
...config,
files: [FEATURE_LIBRARIES_PATH, INTEGRATION_TESTS_PATH],
rules: {
...config.rules,
"@typescript-eslint/class-literal-property-style": "off",
},
})),
);