-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
68 lines (65 loc) · 1.66 KB
/
Copy patheslint.config.mjs
File metadata and controls
68 lines (65 loc) · 1.66 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
import { includeIgnoreFile } from "@eslint/compat"
import js from "@eslint/js"
import prettier from "eslint-config-prettier"
import globals from "globals"
import { fileURLToPath } from "node:url"
import tseslint from "typescript-eslint"
const gitignorePath = fileURLToPath(new URL("./.gitignore", import.meta.url))
const bunGlobals = {
Bun: "readonly"
}
export default tseslint.config(
includeIgnoreFile(gitignorePath),
{
ignores: [
"docs/vendor/**",
"examples/**",
"packages/sql-pglite/**",
".pnpm-store/**",
".out-of-code-insights/**",
"**/.expo/**",
"**/android/**/.cxx/**",
"**/android/**/build/**",
"**/ios/Pods/**",
"**/ios/build/**"
]
},
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ["**/*.{ts,tsx,js,jsx,mjs,cjs}"],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...bunGlobals
}
},
rules: {
"no-throw-literal": "error",
"no-await-in-loop": "warn",
"prefer-const": "warn",
"require-yield": "warn"
}
},
{
files: ["**/*.{ts,tsx}"],
rules: {
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"@typescript-eslint/consistent-type-imports": ["warn", { prefer: "type-imports" }],
"@typescript-eslint/no-import-type-side-effects": "warn",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/ban-ts-comment": "warn"
}
},
{
// Test files
files: ["**/*.{test,spec}.{ts,tsx}", "**/test/**/*.{ts,tsx}"],
rules: {
"@typescript-eslint/no-explicit-any": "off" // Allow any in tests
}
},
prettier
)