generated from Netfloex/Nextjs-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
74 lines (66 loc) · 1.74 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
import { FlatCompat } from "@eslint/eslintrc"
import stylistic from "@stylistic/eslint-plugin"
const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
})
const eslintConfig = [
...compat.config({
extends: [
"next/core-web-vitals",
"next/typescript",
"plugin:prettier/recommended",
"plugin:css-modules/recommended",
"plugin:@tanstack/eslint-plugin-query/recommended",
],
plugins: ["css-modules"],
rules: {
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-function-return-type": "error",
},
ignorePatterns: [".next"],
}),
{
plugins: { "@stylistic": stylistic },
rules: {
"padding-line-between-statements": [
"error",
// Between blocks
{ blankLine: "always", prev: "*", next: "block" },
{ blankLine: "always", prev: "block", next: "*" },
{ blankLine: "always", prev: "*", next: "block-like" },
{ blankLine: "always", prev: "block-like", next: "*" },
// Before and after every sequence of variable declarations
{
blankLine: "always",
prev: "*",
next: ["const", "let", "var"],
},
{
blankLine: "always",
prev: ["const", "let", "var"],
next: "*",
},
{
blankLine: "any",
prev: ["const", "let", "var"],
next: ["const", "let", "var"],
},
// Before and after class declaration, if, while, switch, try
{
blankLine: "always",
prev: "*",
next: ["class", "if", "while", "switch", "try"],
},
{
blankLine: "always",
prev: ["class", "if", "while", "switch", "try"],
next: "*",
},
// Before return statements
{ blankLine: "always", prev: "*", next: "return" },
],
},
},
]
export default eslintConfig