-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
100 lines (97 loc) · 2.25 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
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
import js from "@eslint/js";
import { config, references } from "@tools/eslint";
import prettier from "eslint-config-prettier";
import imprt from "eslint-plugin-import";
import playwright from "eslint-plugin-playwright";
import globals from "globals";
import ts from "typescript-eslint";
export default config([
{
ignores: [
// global
"**/node_modules/",
".nx/cache/",
"**/*.d.ts",
"**/samples/",
"**/dist/",
"**/build/",
"**/.vscode-test/",
"**/vite.config.*",
"**/jest.config.ts",
"**/coverage/",
"**/__fixtures__/",
// documentation
"docs/**/*",
"apps/website/**/*",
// projects
"packages/ssr/e2e/frontend/",
"packages/ssr/scripts/**",
"packages/internal/",
"tools/mapping-visualizer/vite.config.ts",
],
},
{
files: ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"],
extends: [prettier],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
Bun: "readonly",
},
},
},
{
files: ["**/*.js", "**/*.jsx"],
extends: [js.configs.recommended],
},
{
files: ["**/*.ts", "**/*.tsx"],
plugins: {
"@typescript-eslint": ts.plugin,
import: imprt,
},
extends: [...ts.configs.recommended],
languageOptions: {
parser: ts.parser,
parserOptions: {
project: [...references("tsconfig.json")],
},
},
rules: {
...imprt.configs.typescript.rules,
"import/extensions": ["error", "ignorePackages"],
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
fixStyle: "inline-type-imports",
disallowTypeAnnotations: true,
},
],
"@typescript-eslint/no-explicit-any": "warn",
},
},
{
files: ["packages/ssr/e2e/**/*.test.ts"],
plugins: {
playwright,
},
rules: {
...playwright.configs.recommended.rules,
},
},
{
files: ["tools/nx/src/**/*", "apps/playground/**/*"],
rules: {
"import/extensions": "off",
},
},
]);