-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
85 lines (79 loc) · 1.97 KB
/
eslint.config.mjs
File metadata and controls
85 lines (79 loc) · 1.97 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
import js from "@eslint/js";
import tsPlugin from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import globals from "globals";
export default [
// Ignore patterns
{
ignores: [
"node_modules/**",
"dist/**",
"sandbox/output-*.svg",
".vercel/**",
".github/**",
],
},
// JavaScript files (sandbox scripts)
{
files: ["sandbox/**/*.js"],
languageOptions: {
ecmaVersion: 2020,
sourceType: "module",
globals: {
...globals.node,
},
},
rules: {
...js.configs.recommended.rules,
"no-unused-vars": "warn",
"no-console": "off", // Allow console in sandbox scripts
},
},
// TypeScript files (lib and api)
{
files: ["lib/**/*.ts", "api/**/*.ts"],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
project: "./tsconfig.json",
},
globals: {
...globals.node,
},
},
plugins: {
"@typescript-eslint": tsPlugin,
},
rules: {
...js.configs.recommended.rules,
...tsPlugin.configs.recommended.rules,
// TypeScript specific rules
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-non-null-assertion": "warn",
// General rules
"no-console": ["warn", { allow: ["warn", "error"] }],
"prefer-const": "error",
"no-var": "error",
eqeqeq: ["error", "always"],
curly: ["error", "all"],
},
},
// Vercel serverless functions
{
files: ["api/**/*.ts"],
rules: {
"no-console": "off", // Allow console in serverless functions for logging
},
},
];