-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.cjs
More file actions
46 lines (41 loc) · 1.17 KB
/
Copy patheslint.config.cjs
File metadata and controls
46 lines (41 loc) · 1.17 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
// eslint.config.cjs — minimal flat config (CommonJS)
const tryRequire = (name) => {
try {
return require(name);
} catch {
return undefined;
}
};
const tsParser = tryRequire("@typescript-eslint/parser");
module.exports = [
// top-level ignores (replaces .eslintignore)
{
ignores: ["node_modules/", ".next/", "dist/", "public/"],
},
// Minimal project rules
{
files: ["**/*.{js,jsx,ts,tsx}"],
languageOptions: {
// parser must be the parser module (object) or undefined
parser: tsParser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
ecmaFeatures: { jsx: true }, // <-- moved here
// do NOT enable `project` unless you want type-aware rules (slower)
// project: './tsconfig.json',
},
globals: {}, // add any global variables if needed
},
rules: {
// safe, generic rules that don't require plugin objects
"no-unused-vars": ["off", { argsIgnorePattern: "^_" }],
"no-console": ["off", { allow: ["warn", "error"] }],
"prefer-const": "warn",
"no-var": "error",
},
settings: {
react: { version: "detect" },
},
},
];