-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.cjs
More file actions
51 lines (49 loc) · 1.6 KB
/
eslint.config.cjs
File metadata and controls
51 lines (49 loc) · 1.6 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
const { FlatCompat } = require("@eslint/eslintrc");
const js = require("@eslint/js");
const nextPlugin = require("@next/eslint-plugin-next");
const tsPlugin = require("@typescript-eslint/eslint-plugin");
const tsParser = require("@typescript-eslint/parser");
const compat = new FlatCompat();
module.exports = [
js.configs.recommended,
...compat.extends("next/core-web-vitals", "next/typescript", "prettier"),
{
files: ["**/*.{js,jsx,ts,tsx}"],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
"@typescript-eslint": tsPlugin,
"@next/next": nextPlugin,
},
rules: {
"@typescript-eslint/no-unused-vars": "error",
"prefer-const": "error",
"no-var": "error",
"@typescript-eslint/no-explicit-any": "error",
// Disallow console.log but allow warn and error
"no-console": ["error", { allow: ["warn", "error"] }],
// Override all other rules to warnings temporarily
"@typescript-eslint/ban-ts-comment": "warn",
"@next/next/no-img-element": "warn",
"@next/next/no-html-link-for-pages": "warn",
},
},
// Override for chart files to disable no-explicit-any rule (excluding utils)
// "any" types are often necessary for Chart.js compatibility
{
files: ["**/charts/**/*.{js,jsx,ts,tsx}"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
},
// Exclude utils directory from this override
ignores: ["**/charts/utils/**/*.{js,jsx,ts,tsx}"],
},
];