@perfective/eslint-config 0.21.0-alpha → 0.21.0-alpha.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/config/plugin.js +8 -1
- package/index.js +5 -5
- package/package.json +15 -6
- package/rules/cypress/index.js +1 -0
package/config/plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hasEslintPlugin = exports.optionalOverrides = exports.optionalConfig = void 0;
|
|
3
|
+
exports.hasEslintPlugin = exports.optionalRules = exports.optionalOverrides = exports.optionalConfig = void 0;
|
|
4
4
|
const node_1 = require("./node");
|
|
5
5
|
function optionalConfig(plugin, rules) {
|
|
6
6
|
if (hasEslintPlugin(plugin)) {
|
|
@@ -19,6 +19,13 @@ function optionalOverrides(plugin, overrides) {
|
|
|
19
19
|
return null;
|
|
20
20
|
}
|
|
21
21
|
exports.optionalOverrides = optionalOverrides;
|
|
22
|
+
function optionalRules(plugin) {
|
|
23
|
+
if (hasEslintPlugin(plugin)) {
|
|
24
|
+
return `./rules/${plugin.replace(/^@/u, '')}`;
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
exports.optionalRules = optionalRules;
|
|
22
29
|
function hasEslintPlugin(plugin) {
|
|
23
30
|
if (plugin.startsWith('@')) {
|
|
24
31
|
return (0, node_1.hasNodeModule)(`${plugin}/eslint-plugin`);
|
package/index.js
CHANGED
|
@@ -66,8 +66,8 @@ module.exports = {
|
|
|
66
66
|
'./rules/typescript-eslint',
|
|
67
67
|
'./rules/typescript-eslint/tslint',
|
|
68
68
|
'./rules/deprecation',
|
|
69
|
-
'
|
|
70
|
-
],
|
|
69
|
+
(0, plugin_1.optionalRules)('rxjs'),
|
|
70
|
+
].filter(Boolean),
|
|
71
71
|
settings: {
|
|
72
72
|
'import/parsers': {
|
|
73
73
|
'@typescript-eslint/parser': [
|
|
@@ -91,10 +91,10 @@ module.exports = {
|
|
|
91
91
|
},
|
|
92
92
|
extends: [
|
|
93
93
|
'./rules/jest',
|
|
94
|
-
'
|
|
94
|
+
(0, plugin_1.optionalRules)('jest-dom'),
|
|
95
95
|
'./rules/jest-formatting',
|
|
96
|
-
'
|
|
97
|
-
],
|
|
96
|
+
(0, plugin_1.optionalRules)('testing-library'),
|
|
97
|
+
].filter(Boolean),
|
|
98
98
|
rules: {
|
|
99
99
|
'@typescript-eslint/ban-ts-comment': ['error', {
|
|
100
100
|
'ts-expect-error': 'allow-with-description',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perfective/eslint-config",
|
|
3
|
-
"version": "0.21.0-alpha",
|
|
3
|
+
"version": "0.21.0-alpha.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>",
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@babel/eslint-parser": "^7.21.3",
|
|
15
|
-
"@typescript-eslint/eslint-plugin": "^5.57.
|
|
16
|
-
"@typescript-eslint/eslint-plugin-tslint": "^5.57.
|
|
17
|
-
"@typescript-eslint/parser": "^5.57.
|
|
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
18
|
"eslint": "^8.37.0",
|
|
19
|
-
"eslint-import-resolver-typescript": "^3.5.
|
|
19
|
+
"eslint-import-resolver-typescript": "^3.5.4",
|
|
20
20
|
"eslint-plugin-array-func": "^3.1.8",
|
|
21
|
-
"eslint-plugin-cypress": "^2.13.
|
|
21
|
+
"eslint-plugin-cypress": "^2.13.2",
|
|
22
22
|
"eslint-plugin-deprecation": "^1.3.3",
|
|
23
23
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
24
24
|
"eslint-plugin-import": "^2.27.5",
|
|
@@ -39,6 +39,15 @@
|
|
|
39
39
|
"peerDependenciesMeta": {
|
|
40
40
|
"eslint-plugin-cypress": {
|
|
41
41
|
"optional": true
|
|
42
|
+
},
|
|
43
|
+
"eslint-plugin-jest-dom": {
|
|
44
|
+
"optional": true
|
|
45
|
+
},
|
|
46
|
+
"eslint-plugin-rxjs": {
|
|
47
|
+
"optional": true
|
|
48
|
+
},
|
|
49
|
+
"eslint-plugin-testing-library": {
|
|
50
|
+
"optional": true
|
|
42
51
|
}
|
|
43
52
|
},
|
|
44
53
|
"main": "./index.js",
|
package/rules/cypress/index.js
CHANGED