@perfective/eslint-config 0.17.0-alpha.2 → 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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2021 Andrey Mikheychik (https://github.com/amikheychik)
3
+ Copyright (c) 2020-2022 Andrey Mikheychik (https://github.com/amikheychik)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perfective/eslint-config",
3
- "version": "0.17.0-alpha.2",
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>",
@@ -11,29 +11,29 @@
11
11
  },
12
12
  "license": "MIT",
13
13
  "peerDependencies": {
14
- "@babel/eslint-parser": "^7.16.5",
15
- "@typescript-eslint/eslint-plugin": "^5.10.1",
16
- "@typescript-eslint/eslint-plugin-tslint": "^5.10.1",
17
- "@typescript-eslint/parser": "^5.10.1",
18
- "eslint": "^8.8.0",
19
- "eslint-import-resolver-typescript": "^2.5.0",
14
+ "@babel/eslint-parser": "^7.17.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",
23
23
  "eslint-plugin-eslint-comments": "^3.2.0",
24
24
  "eslint-plugin-import": "^2.25.4",
25
- "eslint-plugin-jest": "^26.0.0",
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.7.0",
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.4",
36
- "eslint-plugin-unicorn": "^40.1.0",
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',
@@ -6,7 +6,7 @@ module.exports = {
6
6
  caseSensitiveStrict: true,
7
7
  }],
8
8
  'import/named': ['error', {
9
- commonjs: true,
9
+ commonjs: false,
10
10
  }],
11
11
  'import/default': 'error',
12
12
  'import/namespace': 'error',
@@ -21,6 +21,7 @@ module.exports = {
21
21
  'jest/no-alias-methods': 'warn',
22
22
  'jest/no-commented-out-tests': 'error',
23
23
  'jest/no-conditional-expect': 'error',
24
+ 'jest/no-conditional-in-test': 'error',
24
25
  'jest/no-deprecated-functions': 'warn',
25
26
  'jest/no-disabled-tests': 'error',
26
27
  'jest/no-done-callback': 'error',
@@ -29,7 +30,7 @@ module.exports = {
29
30
  'jest/no-focused-tests': 'warn',
30
31
  'jest/no-hooks': 'off',
31
32
  'jest/no-identical-title': 'error',
32
- 'jest/no-if': 'error',
33
+ 'jest/no-if': 'off',
33
34
  'jest/no-interpolation-in-snapshots': 'error',
34
35
  'jest/no-jasmine-globals': 'warn',
35
36
  'jest/no-jest-import': 'error',
@@ -56,6 +57,7 @@ module.exports = {
56
57
  ignore: [],
57
58
  ignoreTopLevelDescribe: true,
58
59
  }],
60
+ 'jest/prefer-snapshot-hint': ['error', 'always'],
59
61
  'jest/prefer-spy-on': 'warn',
60
62
  'jest/prefer-strict-equal': 'warn',
61
63
  'jest/prefer-to-be': 'warn',
@@ -103,8 +103,10 @@ module.exports = {
103
103
  'jsdoc/require-throws': 'error',
104
104
  'jsdoc/require-yields': 'error',
105
105
  'jsdoc/require-yields-check': 'error',
106
+ 'jsdoc/sort-tags': 'warn',
106
107
  'jsdoc/tag-lines': ['off', 'never', {
107
108
  count: 1,
109
+ dropEndLines: false,
108
110
  noEndLines: true,
109
111
  tags: {},
110
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,
@@ -139,6 +143,7 @@ module.exports = {
139
143
  'unicorn/require-post-message-target-origin': 'error',
140
144
  'unicorn/string-content': 'off',
141
145
  'unicorn/template-indent': 'warn',
146
+ 'unicorn/text-encoding-identifier-case': 'error',
142
147
  'unicorn/throw-new-error': 'warn',
143
148
  },
144
149
  };