@shelf/eslint-config 3.6.13 → 3.8.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/package.json +2 -3
- package/typescript.js +1 -1
- package/plugins/eslint-plugin-shelf-lodash-rules/index.js +0 -10
- package/plugins/eslint-plugin-shelf-lodash-rules/package.json +0 -5
- package/plugins/eslint-plugin-shelf-lodash-rules/rules/index.js +0 -5
- package/plugins/eslint-plugin-shelf-lodash-rules/rules/no-chain-es.js +0 -40
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shelf/eslint-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0",
|
|
4
4
|
"description": "ESLint Config for Shelf Projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "shelfio/eslint-config",
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"common",
|
|
20
|
-
"plugins",
|
|
21
20
|
"rules",
|
|
22
21
|
"base.js",
|
|
23
22
|
"frontend.js",
|
|
@@ -48,7 +47,7 @@
|
|
|
48
47
|
"eslint-plugin-prettier": "5.0.0",
|
|
49
48
|
"eslint-plugin-react": "7.33.1",
|
|
50
49
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
51
|
-
"eslint-plugin-shelf-lodash-
|
|
50
|
+
"eslint-plugin-shelf-no-need-lodash-methods": "0.1.0",
|
|
52
51
|
"eslint-plugin-sonarjs": "0.19.0",
|
|
53
52
|
"eslint-plugin-testing-library": "5.11.0",
|
|
54
53
|
"eslint-plugin-vue": "9.16.1",
|
package/typescript.js
CHANGED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
meta: {
|
|
3
|
-
type: 'problem',
|
|
4
|
-
docs: {
|
|
5
|
-
description: 'Forbid the usage of lodash-es chain method',
|
|
6
|
-
category: 'Best Practices',
|
|
7
|
-
recommended: true,
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
create: function (context) {
|
|
11
|
-
return {
|
|
12
|
-
ImportDeclaration: function (node) {
|
|
13
|
-
const {
|
|
14
|
-
specifiers,
|
|
15
|
-
source: {value: sourceValue},
|
|
16
|
-
} = node;
|
|
17
|
-
let nodeToReport;
|
|
18
|
-
|
|
19
|
-
if (sourceValue === 'lodash-es') {
|
|
20
|
-
const chainSpecifier = specifiers.find(
|
|
21
|
-
(specifier) => specifier.imported && specifier.imported.name === 'chain',
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
if (chainSpecifier) {
|
|
25
|
-
nodeToReport = chainSpecifier;
|
|
26
|
-
}
|
|
27
|
-
} else if (sourceValue === 'lodash-es/chain') {
|
|
28
|
-
nodeToReport = specifiers[0];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (nodeToReport) {
|
|
32
|
-
context.report({
|
|
33
|
-
node: nodeToReport,
|
|
34
|
-
message: 'Avoid importing lodash-es chain method',
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
},
|
|
40
|
-
};
|