generated from daveyplate/tsx-package-fumadocs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
65 lines (60 loc) · 3.04 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
import { dirname } from "path"
import { fileURLToPath } from "url"
import { FlatCompat } from "@eslint/eslintrc"
import stylistic from "@stylistic/eslint-plugin"
import importPlugin from "eslint-plugin-import"
import importNewlinesPlugin from "eslint-plugin-import-newlines"
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const compat = new FlatCompat({ baseDirectory: __dirname, })
const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript"),
{ ignores: ["dist", "out", "src/components/ui", "docs"], },
{
...importPlugin.flatConfigs.recommended,
plugins: {
"@stylistic": stylistic,
"import-newlines": importNewlinesPlugin
},
rules: {
"@next/next/no-html-link-for-pages": "off",
"react/no-unescaped-entities": "off",
"@typescript-eslint/no-unused-vars": "off",
"@stylistic/semi": ["warn", "never"],
"@stylistic/quotes": "warn",
"@stylistic/jsx-newline": ["warn", { prevent: true, allowMultilines: true }],
"@stylistic/jsx-max-props-per-line": ["warn", { maximum: 1, when: "multiline" }],
"@stylistic/jsx-one-expression-per-line": "warn",
"@stylistic/jsx-first-prop-new-line": ["warn", "multiline"],
"@stylistic/jsx-closing-bracket-location": ["warn"],
"@stylistic/jsx-closing-tag-location": ["warn"],
"@stylistic/jsx-self-closing-comp": "warn",
"@stylistic/no-multiple-empty-lines": ["warn", { max: 1, maxEOF: 0, maxBOF: 0 }],
"@stylistic/padding-line-between-statements": ["warn",
{ blankLine: "always", prev: "if", next: "*" },
{ blankLine: "any", prev: "if", next: "return" },
{ blankLine: "any", prev: "if", next: "if" },
{ blankLine: "always", prev: "*", next: "if" },
{ blankLine: "any", prev: ["const", "let", "var"], next: "*" },
{ blankLine: "any", prev: ["*"], next: ["const", "let", "var"] },
{ blankLine: "any", prev: ["const", "let", "var"], next: ["const", "let", "var"] },
{ blankLine: "always", prev: "directive", next: "*" }, { blankLine: "any", prev: "directive", next: "directive" },
{ blankLine: "always", prev: ["case", "default"], next: "*" }
],
"@stylistic/jsx-sort-props": ["warn", {
reservedFirst: true, callbacksLast: true
}],
"@stylistic/jsx-function-call-newline": ["warn", "always"],
"import/order": ["warn", {
"newlines-between": "always",
groups: ["builtin", "external", "internal", "parent", "sibling", "index"],
alphabetize: { "order": "asc" },
named: true,
warnOnUnassignedImports: true
}],
"import/newline-after-import": "warn",
"import-newlines/enforce": ["warn", { "max-len": 100 }]
}
}
]
export default eslintConfig