-
Notifications
You must be signed in to change notification settings - Fork 64
/
eslint.config.js
64 lines (63 loc) · 1.92 KB
/
eslint.config.js
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
import js from "@eslint/js";
import globals from "globals";
import babelParser from "@babel/eslint-parser";
import reactPlugin from "eslint-plugin-react";
import reactHooksPlugin from "eslint-plugin-react-hooks";
import jsxA11yPlugin from "eslint-plugin-jsx-a11y";
import importPlugin from "eslint-plugin-import";
import prettierPlugin from "eslint-plugin-prettier";
import editorConfigPlugin from "eslint-plugin-editorconfig";
export default [
js.configs.recommended,
{
files: ["**/*.{js,jsx,ts,tsx}"],
plugins: {
react: reactPlugin,
"react-hooks": reactHooksPlugin,
"jsx-a11y": jsxA11yPlugin,
import: importPlugin,
prettier: prettierPlugin,
editorconfig: editorConfigPlugin,
},
languageOptions: {
parser: babelParser,
ecmaVersion: 2017,
sourceType: "module",
globals: {
...globals.browser,
...globals.node,
MAIN_WINDOW_WEBPACK_ENTRY: true,
MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: true,
},
},
settings: {
"import/resolver": {
node: {
paths: ["src"],
extensions: [".js", ".jsx", ".ts", ".d.ts", ".tsx"],
},
webpack: { config: "./config/webpack.dev.js" },
},
react: {
pragma: "React",
version: "detect",
},
propWrapperFunctions: [
"forbidExtraProps",
{ property: "freeze", object: "Object" },
{ property: "myFavoriteWrapper" },
],
linkComponents: ["Hyperlink", { name: "Link", linkAttribute: "to" }],
},
rules: {
"no-console": 0,
"react/prop-types": 0,
"no-unused-vars": 0, // disabled due to false positives
"no-async-promise-executor": 0, // grandfathered in during eslint update
"no-prototype-builtins": 0, // grandfathered in during eslint update
"prefer-const": "error",
"react-hooks/rules-of-hooks": "error",
"prettier/prettier": "error",
},
},
];