@perfective/eslint-config 0.21.0-alpha.1 → 0.21.0-beta.1

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.adoc CHANGED
@@ -14,17 +14,18 @@ and the `link:https://typescript-eslint.io/rules/[@typescript-eslint]` plugin ru
14
14
  * `link:https://github.com/gund/eslint-plugin-deprecation[eslint-plugin-deprecation]`;
15
15
  * `link:https://mysticatea.github.io/eslint-plugin-eslint-comments/[eslint-plugin-eslint-comments]`;
16
16
  * `link:https://github.com/import-js/eslint-plugin-import[eslint-plugin-import]`;
17
- * `link:https://github.com/jest-community/eslint-plugin-jest[eslint-plugin-jest]`;
18
- * `link:https://github.com/testing-library/eslint-plugin-jest-dom[eslint-plugin-jest-dom]`;
19
- * `link:https://github.com/dangreenisrael/eslint-plugin-jest-formatting[eslint-plugin-jest-formatting]`;
17
+ * `link:https://github.com/jest-community/eslint-plugin-jest[eslint-plugin-jest]` _(optional)_;
18
+ * `link:https://github.com/testing-library/eslint-plugin-jest-dom[eslint-plugin-jest-dom]` _(optional)_;
19
+ * `link:https://github.com/dangreenisrael/eslint-plugin-jest-formatting[eslint-plugin-jest-formatting]`
20
+ _(optional, required if `eslint-plugin-jest` is installed)_;
20
21
  * `link:https://github.com/gajus/eslint-plugin-jsdoc[eslint-plugin-jsdoc]`;
21
22
  * `link:https://github.com/mysticatea/eslint-plugin-node[eslint-plugin-node]`;
22
23
  * `link:https://github.com/TristonJ/eslint-plugin-prefer-arrow[eslint-plugin-prefer-arrow]`;
23
24
  * `link:https://github.com/eslint-community/eslint-plugin-promise[eslint-plugin-promise]`;
24
- * `link:https://github.com/cartant/eslint-plugin-rxjs[eslint-plugin-rxjs]`;
25
+ * `link:https://github.com/cartant/eslint-plugin-rxjs[eslint-plugin-rxjs]` _(optional)_;
25
26
  * `link:https://github.com/lydell/eslint-plugin-simple-import-sort[eslint-plugin-simple-import-sort]`;
26
27
  * `link:https://github.com/SonarSource/eslint-plugin-sonarjs[eslint-plugin-sonarjs]`;
27
- * `link:https://github.com/testing-library/eslint-plugin-testing-library[eslint-plugin-testing-library]`;
28
+ * `link:https://github.com/testing-library/eslint-plugin-testing-library[eslint-plugin-testing-library]` _(optional)_;
28
29
  * `link:https://github.com/sindresorhus/eslint-plugin-unicorn[eslint-plugin-unicorn]`.
29
30
 
30
31
  To simplify configuring ESLint support in the IDEs and editors,
@@ -51,17 +52,12 @@ npm install --save-dev \
51
52
  eslint-plugin-deprecation \
52
53
  eslint-plugin-eslint-comments \
53
54
  eslint-plugin-import \
54
- eslint-plugin-jest \
55
- eslint-plugin-jest-dom \
56
- eslint-plugin-jest-formatting \
57
55
  eslint-plugin-jsdoc \
58
56
  eslint-plugin-node \
59
57
  eslint-plugin-prefer-arrow \
60
58
  eslint-plugin-promise \
61
- eslint-plugin-rxjs \
62
59
  eslint-plugin-simple-import-sort \
63
60
  eslint-plugin-sonarjs \
64
- eslint-plugin-testing-library \
65
61
  eslint-plugin-unicorn \
66
62
  tslint
67
63
  ----
@@ -71,14 +67,22 @@ npm install --save-dev \
71
67
  [source,bash]
72
68
  ----
73
69
  npm install --save-dev \
74
- eslint-plugin-cypress
70
+ eslint-plugin-cypress \
71
+ eslint-plugin-jest \
72
+ eslint-plugin-jest-dom \
73
+ eslint-plugin-jest-formatting \
74
+ eslint-plugin-rxjs \
75
+ eslint-plugin-testing-library
75
76
  ----
76
77
  +
77
- [NOTE]
78
+ [WARNING]
79
+ ====
80
+ The `eslint-plugin-jest-formatting` module is required,
81
+ if the `eslint-plugin-jest` module is installed.
78
82
  ====
83
+ +
79
84
  The `@perfective/eslint-config` automatically includes rules for these plugins,
80
85
  if the dependency is installed.
81
- ====
82
86
  +
83
87
  . Require the configuration in your root `.eslintrc.js`.
84
88
  +
package/README.md CHANGED
@@ -14,17 +14,18 @@ and the [`@typescript-eslint`](https://typescript-eslint.io/rules/) plugin rules
14
14
  - [`eslint-plugin-deprecation`](https://github.com/gund/eslint-plugin-deprecation);
15
15
  - [`eslint-plugin-eslint-comments`](https://mysticatea.github.io/eslint-plugin-eslint-comments/);
16
16
  - [`eslint-plugin-import`](https://github.com/import-js/eslint-plugin-import);
17
- - [`eslint-plugin-jest`](https://github.com/jest-community/eslint-plugin-jest);
18
- - [`eslint-plugin-jest-dom`](https://github.com/testing-library/eslint-plugin-jest-dom);
19
- - [`eslint-plugin-jest-formatting`](https://github.com/dangreenisrael/eslint-plugin-jest-formatting);
17
+ - [`eslint-plugin-jest`](https://github.com/jest-community/eslint-plugin-jest) _(optional)_;
18
+ - [`eslint-plugin-jest-dom`](https://github.com/testing-library/eslint-plugin-jest-dom) _(optional)_;
19
+ - [`eslint-plugin-jest-formatting`](https://github.com/dangreenisrael/eslint-plugin-jest-formatting)
20
+ _(optional, required if `eslint-plugin-jest` is installed)_;
20
21
  - [`eslint-plugin-jsdoc`](https://github.com/gajus/eslint-plugin-jsdoc);
21
22
  - [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node);
22
23
  - [`eslint-plugin-prefer-arrow`](https://github.com/TristonJ/eslint-plugin-prefer-arrow);
23
24
  - [`eslint-plugin-promise`](https://github.com/eslint-community/eslint-plugin-promise);
24
- - [`eslint-plugin-rxjs`](https://github.com/cartant/eslint-plugin-rxjs);
25
+ - [`eslint-plugin-rxjs`](https://github.com/cartant/eslint-plugin-rxjs) _(optional)_;
25
26
  - [`eslint-plugin-simple-import-sort`](https://github.com/lydell/eslint-plugin-simple-import-sort);
26
27
  - [`eslint-plugin-sonarjs`](https://github.com/SonarSource/eslint-plugin-sonarjs);
27
- - [`eslint-plugin-testing-library`](https://github.com/testing-library/eslint-plugin-testing-library);
28
+ - [`eslint-plugin-testing-library`](https://github.com/testing-library/eslint-plugin-testing-library) _(optional)_;
28
29
  - [`eslint-plugin-unicorn`](https://github.com/sindresorhus/eslint-plugin-unicorn).
29
30
 
30
31
  To simplify configuring ESLint support in the IDEs and editors,
@@ -49,17 +50,12 @@ from issues that will be fixed automatically.
49
50
  eslint-plugin-deprecation \
50
51
  eslint-plugin-eslint-comments \
51
52
  eslint-plugin-import \
52
- eslint-plugin-jest \
53
- eslint-plugin-jest-dom \
54
- eslint-plugin-jest-formatting \
55
53
  eslint-plugin-jsdoc \
56
54
  eslint-plugin-node \
57
55
  eslint-plugin-prefer-arrow \
58
56
  eslint-plugin-promise \
59
- eslint-plugin-rxjs \
60
57
  eslint-plugin-simple-import-sort \
61
58
  eslint-plugin-sonarjs \
62
- eslint-plugin-testing-library \
63
59
  eslint-plugin-unicorn \
64
60
  tslint
65
61
  ```
@@ -68,9 +64,17 @@ from issues that will be fixed automatically.
68
64
 
69
65
  ```bash
70
66
  npm install --save-dev \
71
- eslint-plugin-cypress
67
+ eslint-plugin-cypress \
68
+ eslint-plugin-jest \
69
+ eslint-plugin-jest-dom \
70
+ eslint-plugin-jest-formatting \
71
+ eslint-plugin-rxjs \
72
+ eslint-plugin-testing-library
72
73
  ```
73
74
 
75
+ The `eslint-plugin-jest-formatting` module is required,
76
+ if the `eslint-plugin-jest` module is installed.
77
+
74
78
  The `@perfective/eslint-config` automatically includes rules for these plugins,
75
79
  if the dependency is installed.
76
80
 
package/index.js CHANGED
@@ -83,7 +83,7 @@ module.exports = {
83
83
  },
84
84
  },
85
85
  },
86
- {
86
+ (0, plugin_1.optionalOverrides)('jest', {
87
87
  files: ['*.@(spec|test).[jt]s?(x)'],
88
88
  env: {
89
89
  'jest': true,
@@ -108,12 +108,12 @@ module.exports = {
108
108
  '@testing-library/jest-dom/extend-expect',
109
109
  ],
110
110
  }],
111
- 'max-nested-callbacks': ['error', 5],
111
+ 'max-nested-callbacks': ['error', 6],
112
112
  'prefer-arrow/prefer-arrow-functions': 'off',
113
113
  'promise/always-return': 'off',
114
114
  'rxjs/no-topromise': 'off',
115
115
  },
116
- },
116
+ }),
117
117
  (0, plugin_1.optionalOverrides)('cypress', {
118
118
  files: ['cypress/**/*.[jt]s'],
119
119
  env: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perfective/eslint-config",
3
- "version": "0.21.0-alpha.1",
3
+ "version": "0.21.0-beta.1",
4
4
  "description": "ESLint shareable rules configuration",
5
5
  "keywords": ["code quality", "code standard", "code style", "eslint", "eslint config", "lint", "perfective", "tslint", "tslint config", "typescript"],
6
6
  "author": "Andrey Mikheychik <a.mikheychik@gmail.com>",
@@ -11,38 +11,44 @@
11
11
  },
12
12
  "license": "MIT",
13
13
  "peerDependencies": {
14
- "@babel/eslint-parser": "^7.21.3",
15
- "@typescript-eslint/eslint-plugin": "^5.57.1",
16
- "@typescript-eslint/eslint-plugin-tslint": "^5.57.1",
17
- "@typescript-eslint/parser": "^5.57.1",
18
- "eslint": "^8.37.0",
19
- "eslint-import-resolver-typescript": "^3.5.4",
14
+ "@babel/eslint-parser": "^7.21.8",
15
+ "@typescript-eslint/eslint-plugin": "^5.59.5",
16
+ "@typescript-eslint/eslint-plugin-tslint": "^5.59.5",
17
+ "@typescript-eslint/parser": "^5.59.5",
18
+ "eslint": "^8.40.0",
19
+ "eslint-import-resolver-typescript": "^3.5.5",
20
20
  "eslint-plugin-array-func": "^3.1.8",
21
- "eslint-plugin-cypress": "^2.13.2",
22
- "eslint-plugin-deprecation": "^1.3.3",
21
+ "eslint-plugin-cypress": "^2.13.3",
22
+ "eslint-plugin-deprecation": "^1.4.1",
23
23
  "eslint-plugin-eslint-comments": "^3.2.0",
24
24
  "eslint-plugin-import": "^2.27.5",
25
25
  "eslint-plugin-jest": "^27.2.1",
26
26
  "eslint-plugin-jest-dom": "^4.0.3",
27
27
  "eslint-plugin-jest-formatting": "^3.1.0",
28
- "eslint-plugin-jsdoc": "^40.1.0",
28
+ "eslint-plugin-jsdoc": "^44.2.3",
29
29
  "eslint-plugin-node": "^11.1.0",
30
30
  "eslint-plugin-prefer-arrow": "^1.2.3",
31
31
  "eslint-plugin-promise": "^6.1.1",
32
32
  "eslint-plugin-rxjs": "^5.0.3",
33
33
  "eslint-plugin-simple-import-sort": "^10.0.0",
34
34
  "eslint-plugin-sonarjs": "^0.19.0",
35
- "eslint-plugin-testing-library": "^5.10.2",
36
- "eslint-plugin-unicorn": "^46.0.0",
35
+ "eslint-plugin-testing-library": "^5.11.0",
36
+ "eslint-plugin-unicorn": "^47.0.0",
37
37
  "tslint": "^6.1.3"
38
38
  },
39
39
  "peerDependenciesMeta": {
40
40
  "eslint-plugin-cypress": {
41
41
  "optional": true
42
42
  },
43
+ "eslint-plugin-jest": {
44
+ "optional": true
45
+ },
43
46
  "eslint-plugin-jest-dom": {
44
47
  "optional": true
45
48
  },
49
+ "eslint-plugin-jest-formatting": {
50
+ "optional": true
51
+ },
46
52
  "eslint-plugin-rxjs": {
47
53
  "optional": true
48
54
  },
@@ -50,6 +56,9 @@
50
56
  "optional": true
51
57
  }
52
58
  },
59
+ "overrides": {
60
+ "glob-parent": "^5.1.2"
61
+ },
53
62
  "main": "./index.js",
54
63
  "directories": {
55
64
  "lib": "./"
@@ -19,7 +19,7 @@ module.exports = {
19
19
  max: 5,
20
20
  }],
21
21
  'jest/max-nested-describe': ['error', {
22
- max: 3,
22
+ max: 4,
23
23
  }],
24
24
  'jest/no-alias-methods': 'warn',
25
25
  'jest/no-commented-out-tests': 'error',
@@ -64,11 +64,12 @@ module.exports = {
64
64
  multilineTags: ['*'],
65
65
  allowMultipleTags: true,
66
66
  }],
67
- 'jsdoc/newline-after-description': ['error', 'always'],
68
67
  'jsdoc/no-bad-blocks': ['error', {
69
68
  ignore: ['ts-check', 'ts-expect-error', 'ts-ignore', 'ts-nocheck', 'typescript-eslint'],
70
69
  preventAllMultiAsteriskBlocks: false,
71
70
  }],
71
+ 'jsdoc/no-blank-blocks': 'warn',
72
+ 'jsdoc/no-blank-block-descriptions': 'off',
72
73
  'jsdoc/no-defaults': 'error',
73
74
  'jsdoc/no-missing-syntax': 'off',
74
75
  'jsdoc/no-multi-asterisks': ['error', {
@@ -103,11 +104,196 @@ module.exports = {
103
104
  'jsdoc/require-throws': 'error',
104
105
  'jsdoc/require-yields': 'error',
105
106
  'jsdoc/require-yields-check': 'error',
106
- 'jsdoc/sort-tags': 'warn',
107
- 'jsdoc/tag-lines': ['off', 'never', {
108
- count: 1,
109
- dropEndLines: false,
110
- noEndLines: true,
107
+ 'jsdoc/sort-tags': ['warn', {
108
+ tagSequence: [
109
+ {
110
+ tags: [
111
+ 'summary',
112
+ 'typeSummary',
113
+ ],
114
+ },
115
+ {
116
+ tags: [
117
+ 'module',
118
+ 'exports',
119
+ 'file',
120
+ 'fileoverview',
121
+ 'overview',
122
+ ],
123
+ },
124
+ {
125
+ tags: [
126
+ 'typedef',
127
+ 'interface',
128
+ 'record',
129
+ 'template',
130
+ 'name',
131
+ 'kind',
132
+ 'type',
133
+ 'alias',
134
+ 'external',
135
+ 'host',
136
+ 'callback',
137
+ 'func',
138
+ 'function',
139
+ 'method',
140
+ 'class',
141
+ 'constructor',
142
+ ],
143
+ },
144
+ {
145
+ tags: [
146
+ 'modifies',
147
+ 'mixes',
148
+ 'mixin',
149
+ 'mixinClass',
150
+ 'mixinFunction',
151
+ 'namespace',
152
+ 'borrows',
153
+ 'constructs',
154
+ 'lends',
155
+ 'implements',
156
+ 'requires',
157
+ ],
158
+ },
159
+ {
160
+ tags: [
161
+ 'desc',
162
+ 'description',
163
+ 'classdesc',
164
+ 'tutorial',
165
+ 'copyright',
166
+ 'license',
167
+ ],
168
+ },
169
+ {
170
+ tags: [
171
+ 'const',
172
+ 'constant',
173
+ 'final',
174
+ 'global',
175
+ 'readonly',
176
+ 'abstract',
177
+ 'virtual',
178
+ 'var',
179
+ 'member',
180
+ 'memberof',
181
+ 'memberof!',
182
+ 'inner',
183
+ 'instance',
184
+ 'inheritdoc',
185
+ 'inheritDoc',
186
+ 'override',
187
+ 'hideconstructor',
188
+ ],
189
+ },
190
+ {
191
+ tags: [
192
+ 'param',
193
+ 'arg',
194
+ 'argument',
195
+ 'prop',
196
+ 'property',
197
+ ],
198
+ },
199
+ {
200
+ tags: [
201
+ 'async',
202
+ 'generator',
203
+ 'default',
204
+ 'defaultvalue',
205
+ 'enum',
206
+ 'augments',
207
+ 'extends',
208
+ 'return',
209
+ 'returns',
210
+ 'throws',
211
+ 'exception',
212
+ 'yield',
213
+ 'yields',
214
+ 'event',
215
+ 'fires',
216
+ 'emits',
217
+ 'listens',
218
+ 'this',
219
+ ],
220
+ },
221
+ {
222
+ tags: [
223
+ 'static',
224
+ 'private',
225
+ 'protected',
226
+ 'public',
227
+ 'access',
228
+ 'package',
229
+ ],
230
+ },
231
+ {
232
+ tags: [
233
+ 'see',
234
+ 'example',
235
+ ],
236
+ },
237
+ {
238
+ tags: [
239
+ 'closurePrimitive',
240
+ 'customElement',
241
+ 'expose',
242
+ 'hidden',
243
+ 'idGenerator',
244
+ 'meaning',
245
+ 'ngInject',
246
+ 'owner',
247
+ 'wizaction',
248
+ ],
249
+ },
250
+ {
251
+ tags: [
252
+ 'define',
253
+ 'dict',
254
+ 'export',
255
+ 'externs',
256
+ 'implicitCast',
257
+ 'noalias',
258
+ 'nocollapse',
259
+ 'nocompile',
260
+ 'noinline',
261
+ 'nosideeffects',
262
+ 'polymer',
263
+ 'polymerBehavior',
264
+ 'preserve',
265
+ 'struct',
266
+ 'suppress',
267
+ 'unrestricted',
268
+ ],
269
+ },
270
+ {
271
+ tags: [
272
+ 'category',
273
+ ],
274
+ },
275
+ {
276
+ tags: [
277
+ 'ignore',
278
+ 'author',
279
+ 'version',
280
+ 'variation',
281
+ 'since',
282
+ 'deprecated',
283
+ 'todo',
284
+ ],
285
+ },
286
+ ],
287
+ alphabetizeExtras: false,
288
+ linesBetween: 1,
289
+ reportTagGroupSpacing: true,
290
+ reportIntraTagGroupSpacing: true,
291
+ }],
292
+ 'jsdoc/tag-lines': ['warn', 'always', {
293
+ count: 0,
294
+ startLines: 1,
295
+ endLines: 0,
296
+ applyToEndTag: false,
111
297
  tags: {},
112
298
  }],
113
299
  'jsdoc/valid-types': 'error',
@@ -33,6 +33,7 @@ module.exports = {
33
33
  absence: true,
34
34
  }],
35
35
  'testing-library/prefer-query-by-disappearance': 'error',
36
+ 'testing-library/prefer-query-matchers': 'off',
36
37
  'testing-library/prefer-user-event': 'error',
37
38
  'testing-library/prefer-screen-queries': 'error',
38
39
  'testing-library/prefer-wait-for': 'warn',
@@ -185,6 +185,7 @@ module.exports = {
185
185
  '@typescript-eslint/no-unsafe-assignment': 'error',
186
186
  '@typescript-eslint/no-unsafe-call': 'error',
187
187
  '@typescript-eslint/no-unsafe-declaration-merging': 'error',
188
+ '@typescript-eslint/no-unsafe-enum-comparison': 'error',
188
189
  '@typescript-eslint/no-unsafe-member-access': 'error',
189
190
  '@typescript-eslint/no-unsafe-return': 'error',
190
191
  '@typescript-eslint/no-var-requires': 'error',
@@ -96,6 +96,7 @@ module.exports = {
96
96
  'unicorn/prefer-array-index-of': 'warn',
97
97
  'unicorn/prefer-array-some': 'error',
98
98
  'unicorn/prefer-at': 'off',
99
+ 'unicorn/prefer-blob-reading-methods': 'error',
99
100
  'unicorn/prefer-code-point': 'error',
100
101
  'unicorn/prefer-date-now': 'warn',
101
102
  'unicorn/prefer-default-parameters': 'warn',
@@ -122,7 +123,6 @@ module.exports = {
122
123
  'unicorn/prefer-object-from-entries': ['off', {
123
124
  functions: [],
124
125
  }],
125
- 'unicorn/prefer-object-has-own': 'off',
126
126
  'unicorn/prefer-optional-catch-binding': 'warn',
127
127
  'unicorn/prefer-prototype-methods': 'warn',
128
128
  'unicorn/prefer-query-selector': 'warn',