@anolilab/eslint-config 2.1.6 → 3.0.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/CHANGELOG.md +40 -0
- package/README.md +2 -2
- package/config.cjs +43 -43
- package/index.cjs +4 -4
- package/lib/utils.cjs +20 -1
- package/package.json +42 -43
- package/rules/plugins/babel.cjs +22 -22
- package/rules/plugins/react.cjs +7 -4
- package/rules/plugins/simple-import-sort.cjs +1 -1
- package/rules/plugins/testing-library.cjs +2 -2
- package/rules/plugins/unicorn.cjs +12 -5
- package/rules/variables.cjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,43 @@
|
|
|
1
|
+
## @anolilab/eslint-config [3.0.0](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@2.2.0...@anolilab/eslint-config@3.0.0) (2022-02-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### ⚠ BREAKING CHANGES
|
|
5
|
+
|
|
6
|
+
* remove old node version from our supported versions
|
|
7
|
+
|
|
8
|
+
Signed-off-by: prisis <d.bannert@anolilab.de>
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* fixed wrong version on peer dependencies ([fc28d8b](https://github.com/anolilab/javascript-style-guide/commit/fc28d8b990bea3004283dfb37a249d0ffe3e476f))
|
|
13
|
+
* markdown lint ([24059d4](https://github.com/anolilab/javascript-style-guide/commit/24059d41ca682ca21b39ad7f6dff594be734329d))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Performance Improvements
|
|
17
|
+
|
|
18
|
+
* support for v12, v14 was removed from our supported versions of node ([83d6a80](https://github.com/anolilab/javascript-style-guide/commit/83d6a8058ed7791135aff03d4cd734327bb1b694))
|
|
19
|
+
|
|
20
|
+
## @anolilab/eslint-config [2.2.0](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@2.1.8...@anolilab/eslint-config@2.2.0) (2021-10-26)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* updated ([642c2d5](https://github.com/anolilab/javascript-style-guide/commit/642c2d57a0f667bb9dbfd792210b97b8122a6595))
|
|
26
|
+
|
|
27
|
+
### @anolilab/eslint-config [2.1.8](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@2.1.7...@anolilab/eslint-config@2.1.8) (2021-09-13)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* **deps:** update dependency eslint-plugin-unicorn to v36 ([caa30c3](https://github.com/anolilab/javascript-style-guide/commit/caa30c336ab9e2e7f78cf2fc5b74321fe0399e33))
|
|
33
|
+
|
|
34
|
+
### @anolilab/eslint-config [2.1.7](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@2.1.6...@anolilab/eslint-config@2.1.7) (2021-09-03)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
* fixed wrong name in eslint-config redux is now react-redux ([609fd83](https://github.com/anolilab/javascript-style-guide/commit/609fd83fa2155ee1ad5e01cf71f76d750d414fa8))
|
|
40
|
+
|
|
1
41
|
### @anolilab/eslint-config [2.1.6](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@2.1.5...@anolilab/eslint-config@2.1.6) (2021-09-02)
|
|
2
42
|
|
|
3
43
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ESLint config
|
|
2
2
|
|
|
3
|
-
This package provides Anolilab’s .eslintrc.cjs as an extensible shared config, with a range of useful plugins that are often too time-consuming to setup and provides an
|
|
3
|
+
This package provides Anolilab’s .eslintrc.cjs as an extensible shared config, with a range of useful plugins that are often too time-consuming to setup and provides an install the plugins you need, based on your project’s dependencies.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -297,7 +297,7 @@ Therefore, `@anolilab/eslint-config` also inherits the philosophy of ESLint. It
|
|
|
297
297
|
## Supported Node.js Versions
|
|
298
298
|
|
|
299
299
|
Libraries in this ecosystem make the best effort to track
|
|
300
|
-
[Node.js
|
|
300
|
+
[Node.js’ release schedule](https://nodejs.org/en/about/releases/). Here’s [a
|
|
301
301
|
post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a).
|
|
302
302
|
|
|
303
303
|
Contributing
|
package/config.cjs
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
const { hasAnyDep, hasTypescript } = require(
|
|
2
|
-
const isModuleAvailable = require(
|
|
1
|
+
const { hasAnyDep, hasTypescript } = require("./lib/utils.cjs");
|
|
2
|
+
const isModuleAvailable = require("./lib/is-module-available.cjs");
|
|
3
3
|
|
|
4
4
|
// Base rules
|
|
5
|
-
const rules = [
|
|
5
|
+
const rules = ["best-practices", "errors", "style", "es6", "variables"];
|
|
6
6
|
|
|
7
7
|
// Base plugin rules
|
|
8
8
|
const pRules = [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
"compat",
|
|
10
|
+
"eslint-comments",
|
|
11
|
+
"import",
|
|
12
|
+
"json",
|
|
13
|
+
"markdown",
|
|
14
|
+
"optimize-regex",
|
|
15
|
+
"promise",
|
|
16
|
+
"simple-import-sort",
|
|
17
|
+
"unicorn",
|
|
18
|
+
"you-dont-need-lodash-underscore",
|
|
19
|
+
"you-dont-need-momentjs",
|
|
20
20
|
|
|
21
21
|
// Security Rules
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
"no-secrets",
|
|
23
|
+
"radar",
|
|
24
24
|
];
|
|
25
25
|
|
|
26
26
|
// Optionals rules based on project dependencies
|
|
27
27
|
const depRules = [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
[
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
[
|
|
28
|
+
"array-func",
|
|
29
|
+
"html",
|
|
30
|
+
"mdx",
|
|
31
|
+
"react-redux",
|
|
32
|
+
"no-unsanitized",
|
|
33
|
+
"lodash",
|
|
34
|
+
["lodash", "lodash-fp"],
|
|
35
|
+
"jsdoc",
|
|
36
|
+
"react",
|
|
37
|
+
["mdx", "eslint-plugin-react"],
|
|
38
|
+
["react-a11y", "react"],
|
|
39
|
+
["react-hooks", "react"],
|
|
40
40
|
];
|
|
41
41
|
|
|
42
42
|
const testRules = [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
[
|
|
46
|
-
|
|
47
|
-
[
|
|
48
|
-
[
|
|
49
|
-
[
|
|
43
|
+
"cypress",
|
|
44
|
+
"jest",
|
|
45
|
+
["jest", "jest-async", "jest-dom"],
|
|
46
|
+
"jest-dom",
|
|
47
|
+
["jest-formatting", "jest"],
|
|
48
|
+
["@testing-library/jest-dom", "jest-dom"],
|
|
49
|
+
["@testing-library/dom", "testing-library"],
|
|
50
50
|
];
|
|
51
51
|
|
|
52
52
|
// Extra required optional packages
|
|
53
53
|
const extraInstalled = [];
|
|
54
54
|
|
|
55
55
|
depRules.forEach((depRule) => {
|
|
56
|
-
const rule = typeof depRule ===
|
|
56
|
+
const rule = typeof depRule === "string" ? [depRule, depRule] : depRule;
|
|
57
57
|
|
|
58
58
|
if (hasAnyDep(rule[0])) {
|
|
59
59
|
pRules.push(rule[1]);
|
|
@@ -61,7 +61,7 @@ depRules.forEach((depRule) => {
|
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
testRules.forEach((depRule) => {
|
|
64
|
-
const rule = typeof depRule ===
|
|
64
|
+
const rule = typeof depRule === "string" ? [depRule, depRule] : depRule;
|
|
65
65
|
|
|
66
66
|
if (isModuleAvailable(rule[0])) {
|
|
67
67
|
pRules.push(rule[1]);
|
|
@@ -69,16 +69,16 @@ testRules.forEach((depRule) => {
|
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
if (hasTypescript) {
|
|
72
|
-
pRules.push(
|
|
73
|
-
extraInstalled.push([
|
|
72
|
+
pRules.push("typescript");
|
|
73
|
+
extraInstalled.push(["@typescript-eslint/parser", "@typescript-eslint/eslint-plugin"]);
|
|
74
74
|
|
|
75
|
-
if (hasAnyDep(
|
|
76
|
-
pRules.push(
|
|
75
|
+
if (hasAnyDep("eslint-plugin-typescript-sort-keys")) {
|
|
76
|
+
pRules.push("typescript-sort-keys");
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
module.exports = {
|
|
81
81
|
rules,
|
|
82
82
|
pluginRules: pRules,
|
|
83
|
-
extraInstallPackage: extraInstalled
|
|
84
|
-
}
|
|
83
|
+
extraInstallPackage: extraInstalled,
|
|
84
|
+
};
|
package/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const path = require(
|
|
2
|
-
const checkMissing = require(
|
|
3
|
-
const showLoaded = require(
|
|
4
|
-
const { rules, pluginRules, extraInstallPackage } = require(
|
|
1
|
+
const path = require("path");
|
|
2
|
+
const checkMissing = require("./lib/check-missing.cjs");
|
|
3
|
+
const showLoaded = require("./lib/show-loaded.cjs");
|
|
4
|
+
const { rules, pluginRules, extraInstallPackage } = require("./config.cjs");
|
|
5
5
|
|
|
6
6
|
// Workaround VS Code trying to run this file twice!
|
|
7
7
|
if (!global.hasAnolilabEsLintConfigLoaded) {
|
package/lib/utils.cjs
CHANGED
|
@@ -2,9 +2,28 @@
|
|
|
2
2
|
const { existsSync, realpathSync } = require('fs');
|
|
3
3
|
const { dirname, join } = require('path');
|
|
4
4
|
const has = require('lodash.has');
|
|
5
|
-
const arrify = require('arrify');
|
|
6
5
|
const readPkgUp = require('read-pkg-up');
|
|
7
6
|
|
|
7
|
+
function arrify(value) {
|
|
8
|
+
if (value === null || value === undefined) {
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (Array.isArray(value)) {
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (typeof value === 'string') {
|
|
17
|
+
return [value];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (typeof value[Symbol.iterator] === 'function') {
|
|
21
|
+
return [...value];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return [value];
|
|
25
|
+
}
|
|
26
|
+
|
|
8
27
|
const { packageJson: package_, path: packagePath } = readPkgUp.sync({
|
|
9
28
|
cwd: realpathSync(process.cwd()),
|
|
10
29
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anolilab/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "ESLint shareable config for the Anolilab JavaScript style guide.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -24,11 +24,6 @@
|
|
|
24
24
|
"url": "https://github.com/anolilab/javascript-style-guide.git",
|
|
25
25
|
"directory": "packages/eslint-config"
|
|
26
26
|
},
|
|
27
|
-
"license": "MIT",
|
|
28
|
-
"author": {
|
|
29
|
-
"name": "Daniel Bannert",
|
|
30
|
-
"email": "d.bannert@anolilab.de"
|
|
31
|
-
},
|
|
32
27
|
"funding": [
|
|
33
28
|
{
|
|
34
29
|
"type": "github",
|
|
@@ -39,6 +34,11 @@
|
|
|
39
34
|
"url": "https://anolilab.com/support"
|
|
40
35
|
}
|
|
41
36
|
],
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"author": {
|
|
39
|
+
"name": "Daniel Bannert",
|
|
40
|
+
"email": "d.bannert@anolilab.de"
|
|
41
|
+
},
|
|
42
42
|
"type": "module",
|
|
43
43
|
"main": "index.cjs",
|
|
44
44
|
"files": [
|
|
@@ -54,22 +54,21 @@
|
|
|
54
54
|
"postinstall": "node lib/postinstall.cjs"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@rushstack/eslint-plugin-security": "^0.2.
|
|
58
|
-
"arrify": "2.0.1",
|
|
57
|
+
"@rushstack/eslint-plugin-security": "^0.2.2",
|
|
59
58
|
"confusing-browser-globals": "^1.0.10",
|
|
60
59
|
"eslint-import-resolver-node": "^0.3.6",
|
|
61
|
-
"eslint-plugin-compat": "^3.
|
|
60
|
+
"eslint-plugin-compat": "^3.13.0",
|
|
62
61
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
63
|
-
"eslint-plugin-import": "^2.
|
|
64
|
-
"eslint-plugin-markdown": "^2.2.
|
|
62
|
+
"eslint-plugin-import": "^2.25.2",
|
|
63
|
+
"eslint-plugin-markdown": "^2.2.1",
|
|
65
64
|
"eslint-plugin-no-loops": "^0.3.0",
|
|
66
65
|
"eslint-plugin-no-secrets": "^0.8.9",
|
|
67
66
|
"eslint-plugin-optimize-regex": "^1.2.1",
|
|
68
|
-
"eslint-plugin-promise": "^5.1.
|
|
67
|
+
"eslint-plugin-promise": "^5.1.1",
|
|
69
68
|
"eslint-plugin-radar": "^0.2.1",
|
|
70
69
|
"eslint-plugin-simple-import-sort": "^7.0.0",
|
|
71
70
|
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
72
|
-
"eslint-plugin-unicorn": "^
|
|
71
|
+
"eslint-plugin-unicorn": "^37.0.1",
|
|
73
72
|
"eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0",
|
|
74
73
|
"eslint-plugin-you-dont-need-momentjs": "^1.6.0",
|
|
75
74
|
"lodash.has": "^4.5.2",
|
|
@@ -78,58 +77,58 @@
|
|
|
78
77
|
"semver": "^7.3.5"
|
|
79
78
|
},
|
|
80
79
|
"devDependencies": {
|
|
81
|
-
"@testing-library/dom": "8.2
|
|
82
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
83
|
-
"@typescript-eslint/parser": "
|
|
84
|
-
"eslint": "7.
|
|
85
|
-
"eslint-find-rules": "
|
|
80
|
+
"@testing-library/dom": "8.11.2",
|
|
81
|
+
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
82
|
+
"@typescript-eslint/parser": "5.10.0",
|
|
83
|
+
"eslint": "8.7.0",
|
|
84
|
+
"eslint-find-rules": "4.1.0",
|
|
86
85
|
"eslint-plugin-babel": "5.3.1",
|
|
87
|
-
"eslint-plugin-cypress": "2.
|
|
88
|
-
"eslint-plugin-jest": "
|
|
86
|
+
"eslint-plugin-cypress": "2.12.1",
|
|
87
|
+
"eslint-plugin-jest": "25.7.0",
|
|
89
88
|
"eslint-plugin-jest-async": "1.0.3",
|
|
90
|
-
"eslint-plugin-jest-dom": "
|
|
91
|
-
"eslint-plugin-jest-formatting": "3.
|
|
92
|
-
"eslint-plugin-jsdoc": "
|
|
89
|
+
"eslint-plugin-jest-dom": "4.0.1",
|
|
90
|
+
"eslint-plugin-jest-formatting": "3.1.0",
|
|
91
|
+
"eslint-plugin-jsdoc": "37.6.3",
|
|
93
92
|
"eslint-plugin-json": "3.1.0",
|
|
94
|
-
"eslint-plugin-jsx-a11y": "6.
|
|
95
|
-
"eslint-plugin-mdx": "1.
|
|
93
|
+
"eslint-plugin-jsx-a11y": "6.5.1",
|
|
94
|
+
"eslint-plugin-mdx": "1.16.0",
|
|
96
95
|
"eslint-plugin-node": "11.1.0",
|
|
97
96
|
"eslint-plugin-prefer-object-spread": "1.2.1",
|
|
98
|
-
"eslint-plugin-react": "7.
|
|
99
|
-
"eslint-plugin-react-hooks": "4.
|
|
100
|
-
"eslint-plugin-react-redux": "3.3.
|
|
101
|
-
"eslint-plugin-testing-library": "
|
|
102
|
-
"eslint-plugin-typescript-sort-keys": "1.
|
|
103
|
-
"jest": "27.
|
|
97
|
+
"eslint-plugin-react": "7.28.0",
|
|
98
|
+
"eslint-plugin-react-hooks": "4.3.0",
|
|
99
|
+
"eslint-plugin-react-redux": "3.3.4",
|
|
100
|
+
"eslint-plugin-testing-library": "5.0.4",
|
|
101
|
+
"eslint-plugin-typescript-sort-keys": "2.1.0",
|
|
102
|
+
"jest": "27.4.7",
|
|
104
103
|
"react": "17.0.2",
|
|
105
|
-
"typescript": "^4.
|
|
104
|
+
"typescript": "^4.4.4"
|
|
106
105
|
},
|
|
107
106
|
"peerDependencies": {
|
|
108
107
|
"eslint": "^7.32.0"
|
|
109
108
|
},
|
|
110
109
|
"optionalDependencies": {
|
|
111
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
112
|
-
"@typescript-eslint/parser": "^
|
|
110
|
+
"@typescript-eslint/eslint-plugin": "^5.2.0",
|
|
111
|
+
"@typescript-eslint/parser": "^5.2.0",
|
|
113
112
|
"eslint-plugin-babel": "^5.3.1",
|
|
114
|
-
"eslint-plugin-cypress": "^2.
|
|
115
|
-
"eslint-plugin-jest": "^
|
|
113
|
+
"eslint-plugin-cypress": "^2.12.1",
|
|
114
|
+
"eslint-plugin-jest": "^25.2.2",
|
|
116
115
|
"eslint-plugin-jest-async": "^1.0.3",
|
|
117
|
-
"eslint-plugin-jest-dom": "^3.9.
|
|
116
|
+
"eslint-plugin-jest-dom": "^3.9.2",
|
|
118
117
|
"eslint-plugin-jest-formatting": "^3.0.0",
|
|
119
|
-
"eslint-plugin-jsdoc": "^
|
|
118
|
+
"eslint-plugin-jsdoc": "^37.0.2",
|
|
120
119
|
"eslint-plugin-json": "^3.1.0",
|
|
121
120
|
"eslint-plugin-jsx-a11y": "^6.4.1",
|
|
122
|
-
"eslint-plugin-mdx": "^1.
|
|
121
|
+
"eslint-plugin-mdx": "^1.16.0",
|
|
123
122
|
"eslint-plugin-node": "^11.1.0",
|
|
124
123
|
"eslint-plugin-prefer-object-spread": "^1.2.1",
|
|
125
|
-
"eslint-plugin-react": "^7.
|
|
124
|
+
"eslint-plugin-react": "^7.26.1",
|
|
126
125
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
127
126
|
"eslint-plugin-react-redux": "^3.3.2",
|
|
128
|
-
"eslint-plugin-testing-library": "^
|
|
129
|
-
"eslint-plugin-typescript-sort-keys": "^
|
|
127
|
+
"eslint-plugin-testing-library": "^5.0.0",
|
|
128
|
+
"eslint-plugin-typescript-sort-keys": "^2.0.0"
|
|
130
129
|
},
|
|
131
130
|
"engines": {
|
|
132
|
-
"node": ">=
|
|
131
|
+
"node": ">=16"
|
|
133
132
|
},
|
|
134
133
|
"publishConfig": {
|
|
135
134
|
"access": "public"
|
package/rules/plugins/babel.cjs
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
const { rules: baseBestPracticesRules } = require(
|
|
2
|
-
const { rules: errorsRules } = require(
|
|
3
|
-
const { rules: styleRules } = require(
|
|
1
|
+
const { rules: baseBestPracticesRules } = require("../best-practices.cjs");
|
|
2
|
+
const { rules: errorsRules } = require("../errorsRules.cjs");
|
|
3
|
+
const { rules: styleRules } = require("../styleRules.cjs");
|
|
4
4
|
|
|
5
5
|
module.exports = {
|
|
6
|
-
plugins: [
|
|
6
|
+
plugins: ["babel"],
|
|
7
7
|
rules: {
|
|
8
|
-
camelcase:
|
|
9
|
-
|
|
8
|
+
camelcase: "off",
|
|
9
|
+
"babel/camelcase": [
|
|
10
10
|
// Deep clone to avoid object mutation wierdness
|
|
11
11
|
styleRules.camelcase[0],
|
|
12
12
|
{ ...styleRules.camelcase[1] },
|
|
13
13
|
],
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
"new-cap": "off",
|
|
16
|
+
"babel/new-cap": styleRules["new-cap"],
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
"no-invalid-this": "off",
|
|
19
|
+
"babel/no-invalid-this": baseBestPracticesRules["no-invalid-this"],
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
"object-curly-spacing": "off",
|
|
22
|
+
"babel/object-curly-spacing": styleRules["object-curly-spacing"],
|
|
23
23
|
|
|
24
|
-
quotes:
|
|
25
|
-
|
|
24
|
+
quotes: "off",
|
|
25
|
+
"babel/quotes": styleRules.quotes,
|
|
26
26
|
|
|
27
|
-
semi:
|
|
28
|
-
|
|
27
|
+
semi: "off",
|
|
28
|
+
"babel/semi": styleRules.semi,
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
"no-unused-expressions": "off",
|
|
31
|
+
"babel/no-unused-expressions": baseBestPracticesRules["no-unused-expressions"],
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
}
|
|
33
|
+
"valid-typeof": "off",
|
|
34
|
+
"babel/valid-typeof": errorsRules["valid-typeof"],
|
|
35
|
+
},
|
|
36
|
+
};
|
package/rules/plugins/react.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @see https://github.com/yannickcr/eslint-plugin-react
|
|
2
|
-
const assign = require(
|
|
3
|
-
const { hasAnyDep } = require(
|
|
4
|
-
const { rules: baseStyleRules } = require(
|
|
2
|
+
const assign = require("object.assign");
|
|
3
|
+
const { hasAnyDep } = require("../../lib/utils.cjs");
|
|
4
|
+
const { rules: baseStyleRules } = require("../style.cjs");
|
|
5
5
|
|
|
6
6
|
const dangleRules = baseStyleRules["no-underscore-dangle"];
|
|
7
7
|
|
|
@@ -387,7 +387,10 @@ module.exports = {
|
|
|
387
387
|
|
|
388
388
|
// only .jsx files may have JSX
|
|
389
389
|
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
|
|
390
|
-
"react/jsx-filename-extension": [
|
|
390
|
+
"react/jsx-filename-extension": [
|
|
391
|
+
"error",
|
|
392
|
+
{ extensions: [".jsx"].concat(hasAnyDep("typescript") ? [".tsx"] : []) },
|
|
393
|
+
],
|
|
391
394
|
|
|
392
395
|
// prevent accidental JS comments from being injected into JSX as text
|
|
393
396
|
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const isModuleAvailable = require(
|
|
2
|
-
const { consoleLog } = require(
|
|
1
|
+
const isModuleAvailable = require("../../lib/is-module-available.cjs");
|
|
2
|
+
const { consoleLog } = require("../../lib/loggers.cjs");
|
|
3
3
|
|
|
4
4
|
let ruleset;
|
|
5
5
|
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
const semver = require(
|
|
1
|
+
const semver = require("semver");
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
plugins: [
|
|
5
|
-
"unicorn"
|
|
6
|
-
],
|
|
4
|
+
plugins: ["unicorn"],
|
|
7
5
|
extends: ["plugin:unicorn/recommended"],
|
|
8
6
|
rules: {
|
|
9
|
-
"unicorn/prefer-node-protocol": semver.gte(process.version,
|
|
7
|
+
"unicorn/prefer-node-protocol": semver.gte(process.version, "v16.0.0") ? "error" : "off",
|
|
8
|
+
"unicorn/template-indent": [
|
|
9
|
+
"warn",
|
|
10
|
+
{
|
|
11
|
+
tags: ["outdent", "dedent", "gql", "sql", "html", "styled"],
|
|
12
|
+
functions: ["dedent", "stripIndent"],
|
|
13
|
+
selectors: [],
|
|
14
|
+
comments: ["HTML", "indent"],
|
|
15
|
+
},
|
|
16
|
+
],
|
|
10
17
|
},
|
|
11
18
|
};
|
package/rules/variables.cjs
CHANGED