-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.mjs
107 lines (104 loc) · 1.96 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// import next from "@next/eslint-plugin-next";
import {
common,
browser,
node,
next,
react,
prettier,
} from "eslint-config-neon";
import jsxA11y from "eslint-config-neon/jsx-a11y";
import * as mdx from "eslint-plugin-mdx";
import unicorn from "eslint-plugin-unicorn";
/**
* @type {import('eslint').Linter.Config[]}
*/
const config = [
{
ignores: ["node_modules", ".next", ".faust", "public"],
},
...common,
...browser,
...node,
...react,
...jsxA11y,
...next,
{
files: ["**/*.{js,jsx,cjs,mjs,mdx}"],
settings: {
react: {
version: "detect",
},
},
languageOptions: {
parserOptions: {
project: "./jsconfig.json",
},
},
rules: {
"arrow-body-style": "off",
"react/prop-types": "off",
...unicorn.configs["flat/recommended"].rules, // neon disables a lot of unicorn rules so this reenables defaults
"react/no-danger": "warn",
"react/jsx-sort-props": "off",
"react/jsx-filename-extension": [
"warn",
{ extensions: [".jsx", ".mdx"] },
],
"@stylistic/jsx/jsx-sort-props": "off",
"unicorn/prevent-abbreviations": [
"error",
{
allowList: {
props: true,
ctx: true,
docs: true,
doc: true,
Doc: true,
Docs: true,
req: true,
res: true,
},
},
],
},
},
{
files: ["**/*.jsx"],
rules: {
"consistent-return": "off",
"no-use-before-define": "off",
"array-callback-return": "off",
},
},
{
files: ["tailwind.config.js", "postcss.config.js", "next.config.js"],
languageOptions: {
sourceType: "commonjs",
},
rules: {
"unicorn/numeric-separators-style": "off",
"unicorn/prefer-module": "off",
},
},
{
files: ["src/pages/**/*.{js,jsx}"],
rules: {
"react-refresh/only-export-components": ["off"],
},
},
{
...mdx.flat,
processor: mdx.createRemarkProcessor({
lintCodeBlocks: false,
}),
},
{
files: ["*.md"],
rules: {
"unicorn/filename-case": ["off"],
},
},
...prettier,
];
export default config;