forked from 392-f24/StudyBuddy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
74 lines (73 loc) · 1.84 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
// npm install --save-dev eslint prettier @babel/eslint-parser @babel/plugin-syntax-jsx eslint-config-prettier eslint-plugin-import eslint-plugin-prettier eslint-plugin-react eslint-plugin-jsx-a11y
import reactPlugin from 'eslint-plugin-react';
import prettierPlugin from 'eslint-plugin-prettier';
import babelParser from '@babel/eslint-parser';
import importPlugin from 'eslint-plugin-import';
export default [
{
ignores: ["node_modules/", "build/"],
},
{
files: ["src/**/*.{js,jsx}"],
languageOptions: {
ecmaVersion: 2021,
sourceType: "module",
globals: {
React: "readonly",
},
parser: babelParser,
parserOptions: {
requireConfigFile: false,
ecmaFeatures: {
jsx: true,
},
babelOptions: {
plugins: ["@babel/plugin-syntax-jsx"],
},
},
},
plugins: {
react: reactPlugin,
prettier: prettierPlugin,
import: importPlugin,
},
rules: {
"prettier/prettier": "error",
"react/react-in-jsx-scope": "off",
"import/order": [
"error",
{
"groups": [["builtin", "external", "internal"]],
"pathGroups": [
{
"pattern": "react",
"group": "builtin",
"position": "before"
}
],
"pathGroupsExcludedImportTypes": ["react"],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"max-len": [
"error",
{
"code": 80,
"ignoreUrls": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true
}
]
},
settings: {
react: {
version: "detect",
},
},
},
];