forked from projectNEWM/newm-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
116 lines (116 loc) · 2.73 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
module.exports = {
env: {
// Browser global variables like `window` etc.
browser: true,
// CommonJS global variables and CommonJS scoping.Allows require, exports and module.
commonjs: true,
// Enable all ECMAScript 6 features except for modules.
es6: true,
// Jest global variables like `it` etc.
jest: true,
// Defines things like process.env when generating through node
node: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
"plugin:react-hooks/recommended",
"plugin:jest/recommended",
"plugin:testing-library/react",
"plugin:react/jsx-runtime",
"plugin:storybook/recommended",
],
ignorePatterns: ["src/assets/*"],
// Uses babel-eslint transforms.
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
// Allows for the parsing of modern ECMAScript features
ecmaVersion: 2018,
// Allows for the use of imports
sourceType: "module",
},
// eslint-plugin-import plugin. https://www.npmjs.com/package/eslint-plugin-import
plugins: ["import", "@typescript-eslint"],
// For configuration cascading.
root: true,
rules: {
"testing-library/prefer-screen-queries": 0,
"comma-dangle": [
"error",
{
arrays: "always-multiline",
exports: "only-multiline",
functions: "never",
imports: "only-multiline",
objects: "only-multiline",
},
],
"eol-last": "error",
"import/order": [
"warn",
{
groups: [
"builtin",
"external",
"index",
"sibling",
"parent",
"internal",
],
},
],
"jsx-quotes": ["warn", "prefer-double"],
"max-len": [
"warn",
{
code: 120,
},
],
"no-console": "warn",
"no-debugger": "warn",
"no-duplicate-imports": "warn",
"no-unused-vars": "off",
"object-curly-spacing": ["warn", "always"],
quotes: ["warn", "double"],
"react/jsx-curly-spacing": [
"warn",
{
allowMultiline: true,
children: {
when: "always",
},
spacing: {
objectLiterals: "always",
},
when: "always",
},
],
"react/jsx-filename-extension": [
"error",
{
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
],
"react/prop-types": "warn",
semi: "warn",
"sort-imports": [
"warn",
{
ignoreCase: false,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
},
],
},
settings: {
react: {
// Detect react version
version: "detect",
},
},
};