eslint-plugin-boundaries 4.2.0 → 4.2.2
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.md +12 -0
- package/package.json +12 -13
- package/src/core/elementsInfo.js +9 -1
package/README.md
CHANGED
|
@@ -62,6 +62,18 @@ Activate the plugin and one of the canned configs in your `.eslintrc.(yml|json|j
|
|
|
62
62
|
}
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
+
### Eslint v9 and above
|
|
66
|
+
|
|
67
|
+
You must use beta versions of this plugin starting from 5.0.0-beta.0 to use it with eslint v9 and above. The compatibility is not guaranteed yet. In case you face any issue, please open an issue.
|
|
68
|
+
|
|
69
|
+
To install the latest beta version, you can use the next command:
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
npm install --save-dev eslint-plugin-boundaries@beta
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The beta eslint v9 beta versions are maintained in the [`release-eslint-v9` branch](https://github.com/javierbrea/eslint-plugin-boundaries/tree/release-eslint-v9). Once we have tested enough the compatibility with eslint v9 of predefined configurations, examples, and the integration with other eslint plugins, such as those needed to use TypeScript with this plugin, we will release a stable version.
|
|
76
|
+
|
|
65
77
|
## Overview
|
|
66
78
|
|
|
67
79
|
All of the plugin rules need to be able to identify the elements in the project, so, first of all you have to define your project element types by using the `boundaries/elements` setting.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-boundaries",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.2",
|
|
4
4
|
"description": "Eslint plugin checking architecture boundaries between elements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -34,24 +34,23 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"chalk": "4.1.2",
|
|
36
36
|
"eslint-import-resolver-node": "0.3.9",
|
|
37
|
-
"eslint-module-utils": "2.8.
|
|
38
|
-
"
|
|
39
|
-
"micromatch": "4.0.5"
|
|
37
|
+
"eslint-module-utils": "2.8.1",
|
|
38
|
+
"micromatch": "4.0.7"
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "
|
|
43
|
-
"@typescript-eslint/parser": "
|
|
41
|
+
"@typescript-eslint/eslint-plugin": "7.15.0",
|
|
42
|
+
"@typescript-eslint/parser": "7.15.0",
|
|
44
43
|
"cross-env": "7.0.3",
|
|
45
|
-
"eslint": "8.
|
|
46
|
-
"eslint-config-prettier": "9.
|
|
44
|
+
"eslint": "8.57.0",
|
|
45
|
+
"eslint-config-prettier": "9.1.0",
|
|
47
46
|
"eslint-import-resolver-typescript": "3.6.1",
|
|
48
|
-
"eslint-plugin-
|
|
49
|
-
"eslint-plugin-
|
|
50
|
-
"husky": "
|
|
47
|
+
"eslint-plugin-local-rules": "3.0.2",
|
|
48
|
+
"eslint-plugin-prettier": "5.1.3",
|
|
49
|
+
"husky": "9.0.11",
|
|
51
50
|
"is-ci": "3.0.1",
|
|
52
51
|
"jest": "29.7.0",
|
|
53
|
-
"lint-staged": "15.
|
|
54
|
-
"prettier": "3.
|
|
52
|
+
"lint-staged": "15.2.7",
|
|
53
|
+
"prettier": "3.3.2"
|
|
55
54
|
},
|
|
56
55
|
"lint-staged": {
|
|
57
56
|
"test/**/*.js": "eslint",
|
package/src/core/elementsInfo.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const mod = require("module");
|
|
2
2
|
const micromatch = require("micromatch");
|
|
3
3
|
const resolve = require("eslint-module-utils/resolve").default;
|
|
4
4
|
|
|
@@ -9,6 +9,14 @@ const { isArray } = require("../helpers/utils");
|
|
|
9
9
|
|
|
10
10
|
const { filesCache, importsCache, elementsCache } = require("./cache");
|
|
11
11
|
|
|
12
|
+
function isCoreModule(moduleName) {
|
|
13
|
+
const moduleNameWithoutPrefix = moduleName.startsWith("node:")
|
|
14
|
+
? moduleName.slice(5)
|
|
15
|
+
: moduleName;
|
|
16
|
+
|
|
17
|
+
return mod.builtinModules.includes(moduleNameWithoutPrefix);
|
|
18
|
+
}
|
|
19
|
+
|
|
12
20
|
function baseModule(name) {
|
|
13
21
|
if (isScoped(name)) {
|
|
14
22
|
const [scope, packageName] = name.split("/");
|