@perfective/eslint-config 0.17.0 → 0.18.0-alpha

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perfective/eslint-config",
3
- "version": "0.17.0",
3
+ "version": "0.18.0-alpha",
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>",
@@ -12,11 +12,11 @@
12
12
  "license": "MIT",
13
13
  "peerDependencies": {
14
14
  "@babel/eslint-parser": "^7.17.0",
15
- "@typescript-eslint/eslint-plugin": "^5.12.1",
16
- "@typescript-eslint/eslint-plugin-tslint": "^5.12.1",
17
- "@typescript-eslint/parser": "^5.12.1",
18
- "eslint": "^8.9.0",
19
- "eslint-import-resolver-typescript": "^2.5.0",
15
+ "@typescript-eslint/eslint-plugin": "^5.17.0",
16
+ "@typescript-eslint/eslint-plugin-tslint": "^5.17.0",
17
+ "@typescript-eslint/parser": "^5.17.0",
18
+ "eslint": "^8.12.0",
19
+ "eslint-import-resolver-typescript": "^2.7.1",
20
20
  "eslint-plugin-array-func": "^3.1.7",
21
21
  "eslint-plugin-cypress": "^2.12.1",
22
22
  "eslint-plugin-deprecation": "^1.3.2",
@@ -25,15 +25,15 @@
25
25
  "eslint-plugin-jest": "^26.1.3",
26
26
  "eslint-plugin-jest-dom": "^4.0.1",
27
27
  "eslint-plugin-jest-formatting": "^3.1.0",
28
- "eslint-plugin-jsdoc": "^37.9.7",
28
+ "eslint-plugin-jsdoc": "^38.1.6",
29
29
  "eslint-plugin-node": "^11.1.0",
30
30
  "eslint-plugin-prefer-arrow": "^1.2.3",
31
31
  "eslint-plugin-promise": "^6.0.0",
32
32
  "eslint-plugin-rxjs": "^5.0.2",
33
33
  "eslint-plugin-simple-import-sort": "^7.0.0",
34
- "eslint-plugin-sonarjs": "^0.11.0",
35
- "eslint-plugin-testing-library": "^5.0.6",
36
- "eslint-plugin-unicorn": "^41.0.1",
34
+ "eslint-plugin-sonarjs": "^0.13.0",
35
+ "eslint-plugin-testing-library": "^5.2.0",
36
+ "eslint-plugin-unicorn": "^42.0.0",
37
37
  "tslint": "^6.1.3"
38
38
  },
39
39
  "main": "./index.js",
@@ -58,6 +58,10 @@ module.exports = {
58
58
  'no-unused-vars': ['error', {
59
59
  args: 'after-used',
60
60
  argsIgnorePattern: '^_',
61
+ caughtErrors: 'all',
62
+ destructuredArrayIgnorePattern: '^_',
63
+ ignoreRestSiblings: false,
64
+ vars: 'all',
61
65
  }],
62
66
  'no-use-before-define': ['error', {
63
67
  functions: false,
@@ -68,6 +72,8 @@ module.exports = {
68
72
  allowProperties: false,
69
73
  }],
70
74
  'use-isnan': 'error',
71
- 'valid-typeof': 'error',
75
+ 'valid-typeof': ['error', {
76
+ requireStringLiterals: true,
77
+ }],
72
78
  },
73
79
  };
@@ -54,6 +54,7 @@ module.exports = {
54
54
  'no-case-declarations': 'error',
55
55
  'no-confusing-arrow': ['warn', {
56
56
  allowParens: true,
57
+ onlyOneSimpleParam: false,
57
58
  }],
58
59
  'no-console': 'error',
59
60
  'no-continue': 'error',
@@ -106,6 +106,7 @@ module.exports = {
106
106
  'jsdoc/sort-tags': 'warn',
107
107
  'jsdoc/tag-lines': ['off', 'never', {
108
108
  count: 1,
109
+ dropEndLines: false,
109
110
  noEndLines: true,
110
111
  tags: {},
111
112
  }],
@@ -9,7 +9,7 @@ module.exports = {
9
9
  'sonarjs/no-duplicate-string': 'off',
10
10
  'sonarjs/no-duplicated-branches': 'error',
11
11
  'sonarjs/no-gratuitous-expressions': 'error',
12
- 'sonarjs/no-identical-functions': 'error',
12
+ 'sonarjs/no-identical-functions': ['error', 3],
13
13
  'sonarjs/no-inverted-boolean-check': 'warn',
14
14
  'sonarjs/no-nested-switch': 'error',
15
15
  'sonarjs/no-nested-template-literals': 'error',
@@ -16,6 +16,7 @@ module.exports = {
16
16
  'testing-library/no-container': 'error',
17
17
  'testing-library/no-debugging-utils': 'error',
18
18
  'testing-library/no-dom-import': 'warn',
19
+ 'testing-library/no-global-regexp-flag-in-query': 'warn',
19
20
  'testing-library/no-manual-cleanup': 'error',
20
21
  'testing-library/no-node-access': 'error',
21
22
  'testing-library/no-promise-in-fire-event': 'error',
@@ -27,7 +28,10 @@ module.exports = {
27
28
  'testing-library/no-wait-for-snapshot': 'error',
28
29
  'testing-library/prefer-explicit-assert': 'error',
29
30
  'testing-library/prefer-find-by': 'warn',
30
- 'testing-library/prefer-presence-queries': 'error',
31
+ 'testing-library/prefer-presence-queries': ['error', {
32
+ presence: true,
33
+ absence: true,
34
+ }],
31
35
  'testing-library/prefer-query-by-disappearance': 'error',
32
36
  'testing-library/prefer-user-event': 'error',
33
37
  'testing-library/prefer-screen-queries': 'error',
@@ -99,6 +99,10 @@ module.exports = {
99
99
  '@typescript-eslint/no-unused-vars': ['error', {
100
100
  args: 'after-used',
101
101
  argsIgnorePattern: '^_',
102
+ caughtErrors: 'all',
103
+ destructuredArrayIgnorePattern: '^_',
104
+ ignoreRestSiblings: false,
105
+ vars: 'all',
102
106
  }],
103
107
  'no-use-before-define': 'off',
104
108
  '@typescript-eslint/no-use-before-define': ['error', {
@@ -126,6 +130,8 @@ module.exports = {
126
130
  '@typescript-eslint/return-await': ['warn', 'never'],
127
131
  'semi': 'off',
128
132
  '@typescript-eslint/semi': ['warn', 'always'],
133
+ 'space-before-blocks': 'off',
134
+ '@typescript-eslint/space-before-blocks': ['warn', 'always'],
129
135
  'space-before-function-paren': 'off',
130
136
  '@typescript-eslint/space-before-function-paren': ['warn', {
131
137
  anonymous: 'always',
@@ -5,7 +5,7 @@ export declare type TypescriptEslintNamingConventionSelector = TypescriptEslintN
5
5
  export declare type TypescriptEslintNamingConventionUnderscore = 'forbid' | 'require' | 'requireDouble' | 'allow' | 'allowDouble' | 'allowSingleOrDouble';
6
6
  export interface TypescriptEslintNamingConvention {
7
7
  selector: TypescriptEslintNamingConventionSelector | TypescriptEslintNamingConventionSelector[];
8
- format?: TypescriptEslintNamingConventionFormat[];
8
+ format: TypescriptEslintNamingConventionFormat[] | null;
9
9
  modifiers?: string[];
10
10
  leadingUnderscore?: TypescriptEslintNamingConventionUnderscore;
11
11
  trailingUnderscore?: TypescriptEslintNamingConventionUnderscore;
@@ -14,6 +14,10 @@ function typescriptEslintNamingConventionDefaults() {
14
14
  }, {
15
15
  selector: ['memberLike', 'variableLike'],
16
16
  format: ['strictCamelCase'],
17
+ }, {
18
+ selector: ['objectLiteralProperty'],
19
+ modifiers: ['requiresQuotes'],
20
+ format: null,
17
21
  }, {
18
22
  selector: ['parameter'],
19
23
  modifiers: ['unused'],
@@ -145,12 +145,16 @@ module.exports = {
145
145
  checkNever: true,
146
146
  }],
147
147
  '@typescript-eslint/no-misused-new': 'error',
148
- '@typescript-eslint/no-misused-promises': 'error',
148
+ '@typescript-eslint/no-misused-promises': ['error', {
149
+ checksConditionals: true,
150
+ checksVoidReturn: true,
151
+ }],
149
152
  '@typescript-eslint/no-namespace': 'error',
150
153
  '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
151
154
  '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
152
155
  '@typescript-eslint/no-non-null-assertion': 'error',
153
156
  '@typescript-eslint/no-parameter-properties': 'off',
157
+ '@typescript-eslint/no-redundant-type-constituents': 'error',
154
158
  '@typescript-eslint/no-require-imports': 'error',
155
159
  '@typescript-eslint/no-this-alias': 'error',
156
160
  '@typescript-eslint/no-type-alias': 'off',
@@ -253,5 +257,6 @@ module.exports = {
253
257
  ignoreStatic: true,
254
258
  }],
255
259
  '@typescript-eslint/unified-signatures': 'error',
260
+ '@typescript-eslint/no-useless-empty-export': 'warn',
256
261
  },
257
262
  };
@@ -55,12 +55,14 @@ module.exports = {
55
55
  'unicorn/no-thenable': 'error',
56
56
  'unicorn/no-this-assignment': 'error',
57
57
  'unicorn/no-unreadable-array-destructuring': 'error',
58
+ 'unicorn/no-unreadable-iife': 'error',
58
59
  'unicorn/no-unsafe-regex': 'error',
59
60
  'unicorn/no-unused-properties': 'off',
60
61
  'unicorn/no-useless-fallback-in-spread': 'warn',
61
62
  'unicorn/no-useless-length-check': 'warn',
62
63
  'unicorn/no-useless-promise-resolve-reject': 'warn',
63
64
  'unicorn/no-useless-spread': 'warn',
65
+ 'unicorn/no-useless-switch-case': 'error',
64
66
  'unicorn/no-useless-undefined': 'off',
65
67
  'unicorn/no-zero-fractions': 'off',
66
68
  'unicorn/number-literal-case': 'warn',
@@ -102,7 +104,9 @@ module.exports = {
102
104
  'unicorn/prefer-keyboard-event-key': 'warn',
103
105
  'unicorn/prefer-math-trunc': 'warn',
104
106
  'unicorn/prefer-modern-dom-apis': 'warn',
107
+ 'unicorn/prefer-modern-math-apis': 'warn',
105
108
  'unicorn/prefer-module': 'off',
109
+ 'unicorn/prefer-native-coercion-functions': 'warn',
106
110
  'unicorn/prefer-negative-index': 'warn',
107
111
  'unicorn/prefer-node-protocol': ['warn', {
108
112
  checkRequire: false,