This repository has been archived by the owner on Apr 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
.eslintrc.js
92 lines (92 loc) · 2.35 KB
/
.eslintrc.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
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
const path = require("path");
module.exports = {
env: {
browser: true,
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:prettier/recommended",
"prettier",
"plugin:storybook/recommended",
],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},
parser: "@typescript-eslint/parser",
parserOptions: {
project: path.resolve(__dirname, "./tsconfig.json"),
tsconfigRootDir: __dirname,
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'esnext',
sourceType: "module",
extraFileExtensions: [".json"],
},
plugins: ["react", "@typescript-eslint", "prettier", "import", "react-hooks"],
rules: {
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: ["**/*.stories.*", "**/.storybook/**/*.*"],
peerDependencies: true,
},
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ varsIgnorePattern: "^_", ignoreRestSiblings: true },
],
"@typescript-eslint/explicit-function-return-type": [
"error",
{
allowExpressions: true,
},
],
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/naming-convention": [
"warn",
{
selector: "function",
format: ["camelCase", "PascalCase"],
leadingUnderscore: "allow",
trailingUnderscore: "allow",
},
],
"@typescript-eslint/no-useless-constructor": "error",
"no-useless-constructor": "off",
"no-console": "warn",
"react/jsx-curly-brace-presence": ["error", "always"],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/prop-types": "off",
"import/named": "off",
"import/namespace": "off",
"react/self-closing-comp": "error",
},
settings: {
react: {
version: "detect",
},
"import/ignore": ["react-native"],
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"],
},
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
typescript: {
project: path.resolve(__dirname, "./tsconfig.json"),
},
},
},
};