eslint-plugin-boundaries 2.9.0 → 2.10.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 +2 -2
- package/package.json +12 -12
- package/resolver-legacy-alias/index.js +1 -1
- package/src/rules/entry-point.js +1 -1
package/README.md
CHANGED
|
@@ -163,7 +163,7 @@ Read the [docs of the `boundaries/entry-point` rule](docs/rules/entry-point.md)
|
|
|
163
163
|
|
|
164
164
|
#### __`boundaries/element-types`__
|
|
165
165
|
|
|
166
|
-
Define patterns to recognize each file in the project as one of this element types. All rules need this setting to be configured properly to work. The plugin tries to identify each file being
|
|
166
|
+
Define patterns to recognize each file in the project as one of this element types. All rules need this setting to be configured properly to work. The plugin tries to identify each file being analyzed or `import` statement in rules as one of the defined element types. The assigned element type will be that with the first matching pattern, in the same order that elements are defined in the array, so you __should sort them from the most accurate patterns to the less ones__. Properties of each `element`:
|
|
167
167
|
|
|
168
168
|
* __`type`__: `<string>` Element type to be assigned to files or imports matching the `pattern`. This type will be used afterwards in the rules configuration.
|
|
169
169
|
* __`pattern`__: `<string>|<array>` [`micromatch` pattern](https://github.com/micromatch/micromatch). __By default the plugin will try to match this pattern progressively starting from the right side of each file path.__ This means that you don't have to define patterns matching from the base project path, but only the last part of the path that you want to be matched. This is made because the plugin supports elements being children of other elements, and otherwise it could wrongly recognize children elements as a part of the parent one. <br/>For example, given a path `src/helpers/awesome-helper/index.js`, it will try to assign the element to a pattern matching `index.js`, then `awesome-helper/index.js`, then `helpers/awesome-helper/index.js`, etc. Once a pattern matches, it assign the correspondent element type, and continues searching for parents elements with the same logic until the full path has been analyzed. __This behavior can be disabled setting the `mode` option to `full`__, then the provided pattern will try to match the full path.
|
|
@@ -298,7 +298,7 @@ Remember that:
|
|
|
298
298
|
|
|
299
299
|
##### Rules options properties
|
|
300
300
|
|
|
301
|
-
* __`from/target`__: `<element matchers>` Depending of the rule to which the options are for, the rule will be applied only if the file being
|
|
301
|
+
* __`from/target`__: `<element matchers>` Depending of the rule to which the options are for, the rule will be applied only if the file being analyzed matches with this element matcher (`from`), or the dependency being imported matches with this element matcher (`target`).
|
|
302
302
|
* __`disallow/allow`__: `<value matchers>` If the plugin rule target matches with this, then the result of the rule will be "disallow/allow". Each rule will require a type of value here depending of what it is checking. In the case of the `element-types` rule, for example, another `<element matcher>` has to be provided in order to check the type of the local dependency.
|
|
303
303
|
* __`message`__: `<string>` Optional. If the rule results in an error, the plugin will return this message instead of the default one. Read [error messages](#error-messages) for further info.
|
|
304
304
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-boundaries",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.2",
|
|
4
4
|
"description": "Eslint plugin checking architecture boundaries between elements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -31,22 +31,22 @@
|
|
|
31
31
|
"eslint": ">=6.0.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"eslint-import-resolver-node": "0.3.6",
|
|
35
|
-
"eslint-module-utils": "2.7.3",
|
|
36
34
|
"chalk": "4.1.2",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
35
|
+
"eslint-import-resolver-node": "0.3.6",
|
|
36
|
+
"eslint-module-utils": "2.7.4",
|
|
37
|
+
"is-core-module": "2.10.0",
|
|
38
|
+
"micromatch": "4.0.5"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"cross-env": "7.0.3",
|
|
42
|
-
"eslint": "8.
|
|
43
|
-
"eslint-config-prettier": "8.
|
|
44
|
-
"eslint-plugin-prettier": "4.
|
|
45
|
-
"husky": "
|
|
42
|
+
"eslint": "8.23.0",
|
|
43
|
+
"eslint-config-prettier": "8.5.0",
|
|
44
|
+
"eslint-plugin-prettier": "4.2.1",
|
|
45
|
+
"husky": "8.0.1",
|
|
46
46
|
"is-ci": "3.0.1",
|
|
47
|
-
"jest": "
|
|
48
|
-
"lint-staged": "
|
|
49
|
-
"prettier": "2.
|
|
47
|
+
"jest": "29.0.1",
|
|
48
|
+
"lint-staged": "13.0.3",
|
|
49
|
+
"prettier": "2.7.1"
|
|
50
50
|
},
|
|
51
51
|
"lint-staged": {
|
|
52
52
|
"test/**/*.js": "eslint",
|
|
@@ -14,7 +14,7 @@ const replaceAliases = (filePath, config) => {
|
|
|
14
14
|
|
|
15
15
|
module.exports = {
|
|
16
16
|
interfaceVersion: 2,
|
|
17
|
-
resolve: function (source,
|
|
17
|
+
resolve: function (source, _file, config) {
|
|
18
18
|
if (resolve.isCore(source)) return { found: true, path: null };
|
|
19
19
|
try {
|
|
20
20
|
return {
|
package/src/rules/entry-point.js
CHANGED
|
@@ -14,7 +14,7 @@ function isMatchElementInternalPath(elementInfo, matcher, options) {
|
|
|
14
14
|
return isMatchElementKey(elementInfo, matcher, options, "internalPath");
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
function elementRulesAllowEntryPoint(
|
|
17
|
+
function elementRulesAllowEntryPoint(_element, dependency, options) {
|
|
18
18
|
return elementRulesAllowDependency({
|
|
19
19
|
element: dependency,
|
|
20
20
|
dependency,
|