eslint-plugin-boundaries 4.1.0 → 4.2.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/README.md CHANGED
@@ -10,7 +10,7 @@ In words of Robert C. Martin, _"Software architecture is the art of drawing line
10
10
 
11
11
  __This plugin ensures that your architecture boundaries are respected by the elements in your project__ checking the folders and files structure and the dependencies between them. __It is not a replacement for [eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import), on the contrary, the combination of both plugins is recommended.__
12
12
 
13
- By default, __the plugin works by checking `import` statements, but it is also able to analyze exports, dynamic imports, and can be configured to check any other [AST nodes](https://eslint.org/docs/latest/extend/selectors)__. (_Read the [main rules overview](#main-rules-overview) and [configuration](#configuration) chapters for better comprehension_)
13
+ By default, __the plugin works by checking `import` statements, but it is also able to analyze "require", "exports" and dynamic imports, and can be configured to check any other [AST nodes](https://eslint.org/docs/latest/extend/selectors)__. (_Read the [main rules overview](#main-rules-overview) and [configuration](#configuration) chapters for better comprehension_)
14
14
 
15
15
  ## Table of Contents
16
16
 
@@ -207,6 +207,7 @@ This setting allows to modify built-in default dependency nodes. By default, the
207
207
 
208
208
  The setting should be an array of the following strings:
209
209
 
210
+ * `'require'`: analyze `require` statements.
210
211
  * `'import'`: analyze `import` statements.
211
212
  * `'export'`: analyze `export` statements.
212
213
  * `'dynamic-import'`: analyze [dynamic import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import) statements.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-boundaries",
3
- "version": "4.1.0",
3
+ "version": "4.2.1",
4
4
  "description": "Eslint plugin checking architecture boundaries between elements",
5
5
  "keywords": [
6
6
  "eslint",
@@ -21,6 +21,7 @@
21
21
  ],
22
22
  "main": "index.js",
23
23
  "scripts": {
24
+ "eslint": "eslint",
24
25
  "lint": "eslint src *.js test",
25
26
  "lint-staged": "lint-staged",
26
27
  "test": "jest",
@@ -33,23 +34,24 @@
33
34
  "dependencies": {
34
35
  "chalk": "4.1.2",
35
36
  "eslint-import-resolver-node": "0.3.9",
36
- "eslint-module-utils": "2.8.0",
37
+ "eslint-module-utils": "2.8.1",
37
38
  "is-core-module": "2.13.1",
38
39
  "micromatch": "4.0.5"
39
40
  },
40
41
  "devDependencies": {
41
- "@typescript-eslint/eslint-plugin": "6.9.1",
42
- "@typescript-eslint/parser": "6.9.1",
42
+ "@typescript-eslint/eslint-plugin": "7.9.0",
43
+ "@typescript-eslint/parser": "7.9.0",
43
44
  "cross-env": "7.0.3",
44
- "eslint": "8.52.0",
45
- "eslint-config-prettier": "9.0.0",
45
+ "eslint": "8.56.0",
46
+ "eslint-config-prettier": "9.1.0",
46
47
  "eslint-import-resolver-typescript": "3.6.1",
47
- "eslint-plugin-prettier": "5.0.1",
48
- "husky": "8.0.3",
48
+ "eslint-plugin-local-rules": "2.0.1",
49
+ "eslint-plugin-prettier": "5.1.3",
50
+ "husky": "9.0.11",
49
51
  "is-ci": "3.0.1",
50
52
  "jest": "29.7.0",
51
- "lint-staged": "15.0.2",
52
- "prettier": "3.0.3"
53
+ "lint-staged": "15.2.2",
54
+ "prettier": "3.2.5"
53
55
  },
54
56
  "lint-staged": {
55
57
  "test/**/*.js": "eslint",
@@ -41,6 +41,13 @@ module.exports = {
41
41
 
42
42
  VALID_DEPENDENCY_NODE_KINDS: ["value", "type"],
43
43
  DEFAULT_DEPENDENCY_NODES: {
44
+ require: [
45
+ // Note: detects "require('source')"
46
+ {
47
+ selector: "CallExpression[callee.name=require] > Literal",
48
+ kind: "value",
49
+ },
50
+ ],
44
51
  import: [
45
52
  // Note: detects "import x from 'source'"
46
53
  { selector: "ImportDeclaration:not([importKind=type]) > Literal", kind: "value" },