-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy patheslint.config.mjs
46 lines (43 loc) · 1.14 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
import pluginReact from "eslint-plugin-react";
import globals from "globals";
import pluginJs from "@eslint/js";
import pluginNext from "@next/eslint-plugin-next";
const globalValues = {
...globals.browser,
...globals.node
};
delete globalValues.crypto;
export default [
{ ignores: ["src/.next/"] },
{ files: ["**/*.{js,mjs,cjs,jsx}"] },
pluginJs.configs.recommended,
pluginReact.configs.flat.recommended,
{
plugins: {
'@next/next': pluginNext
},
rules: pluginNext.configs.recommended.rules
},
{
rules: {
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'semi': 'error',
'require-await': 'error',
'prefer-const': 'error',
'no-var': 'error',
'no-unused-expressions': 'error',
'no-unneeded-ternary': 'error',
'no-undef-init': 'error',
'no-new-wrappers': 'error'
},
languageOptions: {
globals: globalValues
},
settings: {
react: {
version: 'detect'
}
}
}
];