@perfective/eslint-config 0.27.1 → 0.29.0
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 +45 -48
- package/README.md +43 -26
- package/config/plugin.d.ts +0 -3
- package/config/plugin.js +0 -24
- package/config.d.ts +1 -1
- package/config.js +1 -4
- package/cypress.js +58 -0
- package/index.js +120 -123
- package/jest-dom.js +11 -0
- package/jest.js +24 -0
- package/package.json +39 -20
- package/rules/array-func/index.js +40 -4
- package/rules/cypress/index.js +55 -12
- package/rules/eslint/index.js +7 -6
- package/rules/eslint/layout-formatting.js +65 -65
- package/rules/eslint/possible-problems.js +97 -89
- package/rules/eslint/suggestions.js +180 -178
- package/rules/eslint-comments/best-practices.js +9 -9
- package/rules/eslint-comments/index.js +43 -8
- package/rules/eslint-comments/stylistic-issues.js +16 -16
- package/rules/import/helpful-warnings.js +11 -11
- package/rules/import/index.js +12 -10
- package/rules/import/module-systems.js +11 -11
- package/rules/import/static-analysis.js +27 -27
- package/rules/import/style-guide.js +34 -34
- package/rules/jest/index.js +53 -78
- package/rules/jest/typescript-eslint.js +6 -6
- package/rules/jest-dom/index.js +40 -4
- package/rules/jsdoc/index.js +42 -4
- package/rules/n/index.js +40 -4
- package/rules/prefer-arrow/index.js +40 -4
- package/rules/promise/index.js +54 -7
- package/rules/rxjs/index.js +79 -44
- package/rules/security/index.js +40 -4
- package/rules/simple-import-sort/index.js +41 -4
- package/rules/stylistic/js/index.js +40 -4
- package/rules/stylistic/jsx/index.js +41 -5
- package/rules/stylistic/plus/index.js +40 -4
- package/rules/stylistic/ts/index.js +40 -4
- package/rules/testing-library/index.js +40 -4
- package/rules/typescript-eslint/extension-rules.js +114 -114
- package/rules/typescript-eslint/index.js +43 -8
- package/rules/typescript-eslint/supported-rules.js +315 -314
- package/rules/unicorn/index.js +40 -4
- package/rxjs.js +58 -0
- package/testing-library.js +11 -0
- package/rules/sonarjs/bug-detection.js +0 -15
- package/rules/sonarjs/code-smell-detection.js +0 -27
- package/rules/sonarjs/index.js +0 -10
package/rules/unicorn/index.js
CHANGED
|
@@ -1,9 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.unicornConfig = void 0;
|
|
37
|
+
const eslintPluginUnicorn = __importStar(require("eslint-plugin-unicorn"));
|
|
2
38
|
const prevent_abbreviations_1 = require("./rules/prevent-abbreviations");
|
|
3
|
-
|
|
4
|
-
plugins:
|
|
5
|
-
|
|
6
|
-
|
|
39
|
+
exports.unicornConfig = {
|
|
40
|
+
plugins: {
|
|
41
|
+
unicorn: eslintPluginUnicorn,
|
|
42
|
+
},
|
|
7
43
|
rules: {
|
|
8
44
|
'unicorn/better-regex': 'warn',
|
|
9
45
|
'unicorn/catch-error-name': 'warn',
|
package/rxjs.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.rxjsConfig = rxjsConfig;
|
|
37
|
+
const tsEslint = __importStar(require("typescript-eslint"));
|
|
38
|
+
const rxjs_1 = require("./rules/rxjs");
|
|
39
|
+
function rxjsConfig(files = ['**/*.ts?(x)']) {
|
|
40
|
+
return {
|
|
41
|
+
files,
|
|
42
|
+
languageOptions: {
|
|
43
|
+
parser: tsEslint.parser,
|
|
44
|
+
parserOptions: {
|
|
45
|
+
ecmaVersion: 6,
|
|
46
|
+
ecmaFeatures: {
|
|
47
|
+
globalReturn: false,
|
|
48
|
+
impliedStrict: true,
|
|
49
|
+
},
|
|
50
|
+
sourceType: 'module',
|
|
51
|
+
project: './tsconfig.json',
|
|
52
|
+
warnOnUnsupportedTypeScriptVersion: true,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
plugins: Object.assign({}, rxjs_1.rxjsConfig.plugins),
|
|
56
|
+
rules: Object.assign({}, rxjs_1.rxjsConfig.rules),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.testingLibraryConfig = testingLibraryConfig;
|
|
4
|
+
const testing_library_1 = require("./rules/testing-library");
|
|
5
|
+
function testingLibraryConfig(files = ['**/*.@(spec|test).[jt]s?(x)']) {
|
|
6
|
+
return {
|
|
7
|
+
files,
|
|
8
|
+
plugins: testing_library_1.testingLibraryConfig.plugins,
|
|
9
|
+
rules: testing_library_1.testingLibraryConfig.rules,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
module.exports = {
|
|
3
|
-
rules: {
|
|
4
|
-
'sonarjs/no-all-duplicated-branches': 'error',
|
|
5
|
-
'sonarjs/no-element-overwrite': 'error',
|
|
6
|
-
'sonarjs/no-empty-collection': 'error',
|
|
7
|
-
'sonarjs/no-extra-arguments': 'error',
|
|
8
|
-
'sonarjs/no-identical-conditions': 'error',
|
|
9
|
-
'sonarjs/no-identical-expressions': 'error',
|
|
10
|
-
'sonarjs/no-ignored-return': 'error',
|
|
11
|
-
'sonarjs/no-one-iteration-loop': 'error',
|
|
12
|
-
'sonarjs/no-use-of-empty-return-value': 'error',
|
|
13
|
-
'sonarjs/non-existent-operator': 'error',
|
|
14
|
-
},
|
|
15
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
module.exports = {
|
|
3
|
-
rules: {
|
|
4
|
-
'sonarjs/cognitive-complexity': ['off', 5],
|
|
5
|
-
'sonarjs/elseif-without-else': 'off',
|
|
6
|
-
'sonarjs/max-switch-cases': 'off',
|
|
7
|
-
'sonarjs/no-collapsible-if': 'error',
|
|
8
|
-
'sonarjs/no-collection-size-mischeck': 'error',
|
|
9
|
-
'sonarjs/no-duplicate-string': 'off',
|
|
10
|
-
'sonarjs/no-duplicated-branches': 'error',
|
|
11
|
-
'sonarjs/no-gratuitous-expressions': 'error',
|
|
12
|
-
'sonarjs/no-identical-functions': ['error', 3],
|
|
13
|
-
'sonarjs/no-inverted-boolean-check': 'warn',
|
|
14
|
-
'sonarjs/no-nested-switch': 'error',
|
|
15
|
-
'sonarjs/no-nested-template-literals': 'error',
|
|
16
|
-
'sonarjs/no-redundant-boolean': 'error',
|
|
17
|
-
'sonarjs/no-redundant-jump': 'error',
|
|
18
|
-
'sonarjs/no-same-line-conditional': 'error',
|
|
19
|
-
'sonarjs/no-small-switch': 'error',
|
|
20
|
-
'sonarjs/no-unused-collection': 'error',
|
|
21
|
-
'sonarjs/no-useless-catch': 'error',
|
|
22
|
-
'sonarjs/prefer-immediate-return': 'warn',
|
|
23
|
-
'sonarjs/prefer-object-literal': 'error',
|
|
24
|
-
'sonarjs/prefer-single-boolean-return': 'error',
|
|
25
|
-
'sonarjs/prefer-while': 'warn',
|
|
26
|
-
},
|
|
27
|
-
};
|