-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
83 lines (75 loc) · 1.77 KB
/
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
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
import js from "@eslint/js";
import globals from "globals";
import prettier from "eslint-config-prettier";
import pluginNext from "@next/eslint-plugin-next";
import typescriptParser from "@typescript-eslint/parser";
import typescriptPlugin from "@typescript-eslint/eslint-plugin";
/** @type {import("eslint").Linter.Config} */
const config = [
// Core ESLint recommendations
js.configs.recommended,
// Prettier config to prevent conflict
prettier,
// TypeScript support
{
files: ["**/*.js", "**/*.ts", "**/*.jsx", "**/*.tsx", "**/*.mdx"],
languageOptions: {
parser: typescriptParser,
},
plugins: {
"@typescript-eslint": typescriptPlugin,
},
rules: typescriptPlugin.configs.recommended.rules,
},
// Next.js plugin
{
files: ["**/*.js", "**/*.ts", "**/*.jsx", "**/*.tsx", "**/*.mdx"],
plugins: {
"@next/next": pluginNext,
},
rules: {
...pluginNext.configs.recommended.rules,
},
},
// Custom rules
{
rules: {
"func-style": ["error", "expression", { allowArrowFunctions: true }],
"prefer-arrow-callback": ["error", { allowNamedFunctions: true }],
},
},
// Language options with browser and Node.js globals
{
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
...globals.browser,
...globals.node,
},
},
},
// Ignored files
{
ignores: [
"node_modules",
".pnp",
".pnp.js",
".yarn/install-state.gz",
"coverage",
".next",
"out",
"build",
".DS_Store",
"*.pem",
"npm-debug.log*",
"yarn-debug.log*",
"yarn-error.log*",
".env*.local",
".vercel",
"*.tsbuildinfo",
"next-env.d.ts",
],
},
];
export default config;