-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
88 lines (81 loc) · 2.35 KB
/
Copy patheslint.config.js
File metadata and controls
88 lines (81 loc) · 2.35 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
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import importXPlugin from "eslint-plugin-import-x";
import prettierPlugin from "eslint-plugin-prettier";
import prettierConfig from "eslint-config-prettier";
import tsdocPlugin from "eslint-plugin-tsdoc";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default tseslint.config(
// Ignore patterns
{
ignores: ["dist/**", ".turbo/**", "node_modules/**", "vitest.*", "tests/**"],
},
// Base JS recommended
js.configs.recommended,
// TypeScript recommended configs
...tseslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
// Prettier config (disables conflicting rules)
prettierConfig,
// Main config for TypeScript files
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parserOptions: {
project: path.resolve(__dirname, "tsconfig.json"),
tsconfigRootDir: __dirname,
},
},
plugins: {
"import-x": importXPlugin,
prettier: prettierPlugin,
tsdoc: tsdocPlugin,
},
settings: {
"import-x/resolver": {
typescript: {
alwaysTryTypes: true,
project: path.resolve(__dirname, "tsconfig.json"),
},
},
},
rules: {
...importXPlugin.configs.recommended.rules,
...importXPlugin.configs.typescript.rules,
"prettier/prettier": "error",
"no-console": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
},
],
"@typescript-eslint/restrict-template-expressions": [
"error",
{
allowNever: true,
allowBoolean: true,
allowNumber: true,
allowAny: true,
allowNullish: true,
},
],
"@typescript-eslint/no-empty-function": [
"error",
{
allow: ["arrowFunctions"],
},
],
"@typescript-eslint/ban-ts-comment": "off",
"tsdoc/syntax": "warn",
},
}
);