@keeex/eslint-config 1.7.4 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/package.json +9 -1
- package/src/config/jsx.js +3 -0
- package/src/config/mocha.js +8 -1
- package/src/config/typescript.js +103 -1
package/README.md
CHANGED
|
@@ -138,6 +138,7 @@ the following properties:
|
|
|
138
138
|
"test/**/*.js",
|
|
139
139
|
],
|
|
140
140
|
expectHelper: true,
|
|
141
|
+
chai: true,
|
|
141
142
|
}
|
|
142
143
|
```
|
|
143
144
|
|
|
@@ -157,6 +158,7 @@ If React Hooks is enabled, `eslint-plugin-react-hooks` must be installed.
|
|
|
157
158
|
If React Native is enabled, `eslint-plugin-react-native` must be installed.
|
|
158
159
|
Promise support requires `eslint-plugin-promise`.
|
|
159
160
|
If mocha is used as the testsuite, `eslint-plugin-mocha` must be installed.
|
|
161
|
+
If chai is used with mocha, `eslint-plugin-chai-friendly` must be installed.
|
|
160
162
|
Import support requires `eslint-plugin-import`.
|
|
161
163
|
|
|
162
164
|
If both import and typescript is used, `eslint-import-resolver-typescript` is needed.
|
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keeex/eslint-config",
|
|
3
3
|
"description": "Common eslint configuration",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.8.2",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"src/**/*.js"
|
|
8
8
|
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"check": "npx eslint .",
|
|
11
|
+
"test": "echo No test for this project"
|
|
12
|
+
},
|
|
9
13
|
"repository": {
|
|
10
14
|
"type": "git",
|
|
11
15
|
"url": "https://github.com/KeeeX/eslint-config.git"
|
|
@@ -29,6 +33,7 @@
|
|
|
29
33
|
"eslint": "8.x",
|
|
30
34
|
"eslint-plugin-import": "2.x",
|
|
31
35
|
"eslint-plugin-mocha": "10.x",
|
|
36
|
+
"eslint-plugin-chai-friendly": "0.x",
|
|
32
37
|
"eslint-plugin-promise": "6.x",
|
|
33
38
|
"eslint-plugin-react": "7.x",
|
|
34
39
|
"eslint-plugin-react-hooks": "4.x",
|
|
@@ -57,6 +62,9 @@
|
|
|
57
62
|
"eslint-plugin-react-native": {
|
|
58
63
|
"optional": true
|
|
59
64
|
},
|
|
65
|
+
"eslint-plugin-chai-friendly": {
|
|
66
|
+
"optional": true
|
|
67
|
+
},
|
|
60
68
|
"eslint-plugin-react-hooks": {
|
|
61
69
|
"optional": true
|
|
62
70
|
},
|
package/src/config/jsx.js
CHANGED
package/src/config/mocha.js
CHANGED
|
@@ -8,8 +8,13 @@ module.exports = {
|
|
|
8
8
|
"tests/**/*.js",
|
|
9
9
|
"test/**/*.ts",
|
|
10
10
|
"test/**/*.js",
|
|
11
|
+
"**/tests/**/*.ts",
|
|
12
|
+
"**/tests/**/*.js",
|
|
13
|
+
"**/test/**/*.ts",
|
|
14
|
+
"**/test/**/*.js",
|
|
11
15
|
],
|
|
12
16
|
expectHelper: true,
|
|
17
|
+
mocha: true,
|
|
13
18
|
};
|
|
14
19
|
if (typeof presetConfig === "object") {
|
|
15
20
|
config = {
|
|
@@ -17,10 +22,12 @@ module.exports = {
|
|
|
17
22
|
...presetConfig,
|
|
18
23
|
};
|
|
19
24
|
}
|
|
25
|
+
const extendsBase = ["plugin:mocha/recommended"];
|
|
26
|
+
if (config.chai) extendsBase.push("plugin:chai-friendly/recommended");
|
|
20
27
|
const mochaOverride = {
|
|
21
28
|
files: config.fileFilter,
|
|
22
29
|
env: {mocha: true},
|
|
23
|
-
extendsBase
|
|
30
|
+
extendsBase,
|
|
24
31
|
rules: {
|
|
25
32
|
"mocha/handle-done-callback": ["error", {"ignoreSkipped": true}],
|
|
26
33
|
"mocha/no-mocha-arrows": "off",
|
package/src/config/typescript.js
CHANGED
|
@@ -44,7 +44,109 @@ const rulesBase = {
|
|
|
44
44
|
"error",
|
|
45
45
|
indentDepth,
|
|
46
46
|
],
|
|
47
|
-
"@typescript-eslint/member-ordering": [
|
|
47
|
+
"@typescript-eslint/member-ordering": [
|
|
48
|
+
"warn",
|
|
49
|
+
{
|
|
50
|
+
"default": [
|
|
51
|
+
// Index signature
|
|
52
|
+
"signature",
|
|
53
|
+
|
|
54
|
+
// Fields
|
|
55
|
+
"public-static-field",
|
|
56
|
+
"protected-static-field",
|
|
57
|
+
"private-static-field",
|
|
58
|
+
|
|
59
|
+
"public-decorated-field",
|
|
60
|
+
"protected-decorated-field",
|
|
61
|
+
"private-decorated-field",
|
|
62
|
+
|
|
63
|
+
"public-instance-field",
|
|
64
|
+
"protected-instance-field",
|
|
65
|
+
"private-instance-field",
|
|
66
|
+
|
|
67
|
+
"public-abstract-field",
|
|
68
|
+
"protected-abstract-field",
|
|
69
|
+
"private-abstract-field",
|
|
70
|
+
|
|
71
|
+
"public-field",
|
|
72
|
+
"protected-field",
|
|
73
|
+
"private-field",
|
|
74
|
+
|
|
75
|
+
"static-field",
|
|
76
|
+
"instance-field",
|
|
77
|
+
"abstract-field",
|
|
78
|
+
|
|
79
|
+
"decorated-field",
|
|
80
|
+
|
|
81
|
+
"field",
|
|
82
|
+
|
|
83
|
+
// Constructors
|
|
84
|
+
"public-constructor",
|
|
85
|
+
"protected-constructor",
|
|
86
|
+
"private-constructor",
|
|
87
|
+
|
|
88
|
+
"constructor",
|
|
89
|
+
|
|
90
|
+
// Getters/Setters
|
|
91
|
+
["public-static-get", "public-static-set"],
|
|
92
|
+
["protected-static-get", "protected-static-set"],
|
|
93
|
+
["private-static-get", "private-static-set"],
|
|
94
|
+
|
|
95
|
+
["public-decorated-get", "public-decorated-set"],
|
|
96
|
+
["protected-decorated-get", "protected-decorated-set"],
|
|
97
|
+
["private-decorated-get", "private-decorated-set"],
|
|
98
|
+
|
|
99
|
+
["public-instance-get", "public-instance-set"],
|
|
100
|
+
["protected-instance-get", "protected-instance-set"],
|
|
101
|
+
["private-instance-get", "private-instance-set"],
|
|
102
|
+
|
|
103
|
+
["public-abstract-get", "public-abstract-set"],
|
|
104
|
+
["protected-abstract-get", "protected-abstract-set"],
|
|
105
|
+
["private-abstract-get", "private-abstract-set"],
|
|
106
|
+
|
|
107
|
+
["public-get", "public-set"],
|
|
108
|
+
["protected-get", "protected-set"],
|
|
109
|
+
["private-get", "private-set"],
|
|
110
|
+
|
|
111
|
+
["static-get", "static-set"],
|
|
112
|
+
["instance-get", "instance-set"],
|
|
113
|
+
["abstract-get", "abstract-set"],
|
|
114
|
+
|
|
115
|
+
["decorated-get", "decorated-set"],
|
|
116
|
+
|
|
117
|
+
["get", "set"],
|
|
118
|
+
|
|
119
|
+
// Methods
|
|
120
|
+
"public-static-method",
|
|
121
|
+
"protected-static-method",
|
|
122
|
+
"private-static-method",
|
|
123
|
+
|
|
124
|
+
"public-decorated-method",
|
|
125
|
+
"protected-decorated-method",
|
|
126
|
+
"private-decorated-method",
|
|
127
|
+
|
|
128
|
+
"public-instance-method",
|
|
129
|
+
"protected-instance-method",
|
|
130
|
+
"private-instance-method",
|
|
131
|
+
|
|
132
|
+
"public-abstract-method",
|
|
133
|
+
"protected-abstract-method",
|
|
134
|
+
"private-abstract-method",
|
|
135
|
+
|
|
136
|
+
"public-method",
|
|
137
|
+
"protected-method",
|
|
138
|
+
"private-method",
|
|
139
|
+
|
|
140
|
+
"static-method",
|
|
141
|
+
"instance-method",
|
|
142
|
+
"abstract-method",
|
|
143
|
+
|
|
144
|
+
"decorated-method",
|
|
145
|
+
|
|
146
|
+
"method",
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
],
|
|
48
150
|
"no-array-constructor": "off",
|
|
49
151
|
"@typescript-eslint/no-array-constructor": ["warn"],
|
|
50
152
|
"@typescript-eslint/no-dupe-class-members": ["error"],
|