-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.mjs
40 lines (36 loc) · 940 Bytes
/
eslint.config.mjs
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
const js = require("@eslint/js");
const { FlatCompat } = require("@eslint/eslintrc");
const { fixupPluginRules } = require("@eslint/compat");
const tseslint = require("typescript-eslint");
const compat = new FlatCompat();
const compatConfig = compat.extends("next/core-web-vitals");
const patchedConfig = compatConfig.map((entry) => {
if (entry.plugins) {
for (const [key, plugin] of Object.entries(entry.plugins)) {
entry.plugins[key] = fixupPluginRules(plugin);
}
}
return entry;
});
module.exports = [
...patchedConfig,
...tseslint.configs.recommended,
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: "./tsconfig.json",
},
},
plugins: {
"@typescript-eslint": tseslint.plugin,
},
rules: {
// Add any TypeScript-specific rules here
},
},
{
ignores: [".next/*", "out/*"],
},
];