eslint-plugin-modularity 3.0.1 → 3.0.3
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/AGENTS.md +54 -0
- package/package.json +5 -4
- package/src/index.js +1 -1
package/AGENTS.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<!-- Generated by scripts/generate-plugin-agents-md.ts from package.json and the plugin exports. Do not edit by hand; run `npm run agents-md`. -->
|
|
2
|
+
|
|
3
|
+
# eslint-plugin-modularity
|
|
4
|
+
|
|
5
|
+
Guide for AI coding assistants using this plugin in a project. To change the plugin's own source, read https://github.com/ofri-peretz/eslint/blob/main/AGENTS.md instead.
|
|
6
|
+
|
|
7
|
+
> ESLint module boundaries and architecture rules — enforces DDD value objects and anemic-model checks, naming, REST conventions, and utility isolation.
|
|
8
|
+
|
|
9
|
+
## Enable it
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install --save-dev eslint-plugin-modularity
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Requires ESLint ^8.40.0 || ^9.0.0 || ^10.0.0 and Node >=22.13.0.
|
|
16
|
+
|
|
17
|
+
Flat config files (`eslint.config.*`) are found by ESLint 8.57 and newer; on ESLint 9 and 10 they are the default.
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
// eslint.config.mjs
|
|
21
|
+
import modularity from 'eslint-plugin-modularity';
|
|
22
|
+
|
|
23
|
+
export default [modularity.configs.recommended];
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Each preset is one flat config object: put it in the array as an element, do not spread it. Rule ids are prefixed `modularity/`. Add it to the config you already have; do not remove other plugins. TypeScript files need a TypeScript parser in the config (`typescript-eslint`).
|
|
27
|
+
|
|
28
|
+
## Presets
|
|
29
|
+
|
|
30
|
+
| Preset | Rules | Errors | Warnings |
|
|
31
|
+
| ------------- | ----- | ------ | -------- |
|
|
32
|
+
| `recommended` | 6 | 3 | 3 |
|
|
33
|
+
| `strict` | 6 | 6 | 0 |
|
|
34
|
+
|
|
35
|
+
### `recommended`
|
|
36
|
+
|
|
37
|
+
6 rules:
|
|
38
|
+
|
|
39
|
+
- `ddd-anemic-domain-model` (warn): Detects entities with only getters/setters and no business logic.
|
|
40
|
+
- `ddd-value-object-immutability` (error): Validates value objects are properly immutable.
|
|
41
|
+
- `enforce-naming` (warn): Enforce domain-specific naming conventions with business context.
|
|
42
|
+
- `enforce-rest-conventions` (error): Validates REST endpoint design against best practices.
|
|
43
|
+
- `no-external-api-calls-in-utils` (error): Detects network calls in utility functions.
|
|
44
|
+
- `no-mutable-exports` (warn): Disallow mutable exports (export let / export var).
|
|
45
|
+
|
|
46
|
+
### `strict`
|
|
47
|
+
|
|
48
|
+
Same rules as `recommended`.
|
|
49
|
+
|
|
50
|
+
## More
|
|
51
|
+
|
|
52
|
+
- Docs: https://eslint.interlace.tools/docs/quality/plugin-modularity
|
|
53
|
+
- README.md in this package: every rule with examples.
|
|
54
|
+
- `eslint-plugin-modularity/oxlint` is an entry point for oxlint's JS plugin support; see the README.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-modularity",
|
|
3
|
-
"version": "3.0.
|
|
4
|
-
"description": "ESLint
|
|
3
|
+
"version": "3.0.3",
|
|
4
|
+
"description": "ESLint module boundaries and architecture rules — enforces DDD value objects and anemic-model checks, naming, REST conventions, and utility isolation.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./src/index.js",
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"files": [
|
|
34
34
|
"src/",
|
|
35
35
|
"README.md",
|
|
36
|
-
"LICENSE"
|
|
36
|
+
"LICENSE",
|
|
37
|
+
"AGENTS.md"
|
|
37
38
|
],
|
|
38
39
|
"keywords": [
|
|
39
40
|
"eslint",
|
|
@@ -59,7 +60,7 @@
|
|
|
59
60
|
"node": ">=22.13.0"
|
|
60
61
|
},
|
|
61
62
|
"dependencies": {
|
|
62
|
-
"@interlace/eslint-devkit": "^2.0.
|
|
63
|
+
"@interlace/eslint-devkit": "^2.0.4"
|
|
63
64
|
},
|
|
64
65
|
"peerDependencies": {
|
|
65
66
|
"eslint": "^8.40.0 || ^9.0.0 || ^10.0.0"
|
package/src/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.configs=exports.plugin=exports.rules=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.rules={get"ddd-anemic-domain-model"(){return require("./rules/ddd-anemic-domain-model").dddAnemicDomainModel},get"ddd-value-object-immutability"(){return require("./rules/ddd-value-object-immutability").dddValueObjectImmutability},get"enforce-naming"(){return require("./rules/enforce-naming").enforceNaming},get"enforce-rest-conventions"(){return require("./rules/enforce-rest-conventions").enforceRestConventions},get"no-external-api-calls-in-utils"(){return require("./rules/no-external-api-calls-in-utils").noExternalApiCallsInUtils},get"no-mutable-exports"(){return require("./rules/no-mutable-exports").noMutableExports}};(0,eslint_devkit_1.withCanonicalDocsUrls)("plugin-modularity",exports.rules);exports.plugin={meta:{name:"eslint-plugin-modularity",version:"3.0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.configs=exports.plugin=exports.rules=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.rules={get"ddd-anemic-domain-model"(){return require("./rules/ddd-anemic-domain-model").dddAnemicDomainModel},get"ddd-value-object-immutability"(){return require("./rules/ddd-value-object-immutability").dddValueObjectImmutability},get"enforce-naming"(){return require("./rules/enforce-naming").enforceNaming},get"enforce-rest-conventions"(){return require("./rules/enforce-rest-conventions").enforceRestConventions},get"no-external-api-calls-in-utils"(){return require("./rules/no-external-api-calls-in-utils").noExternalApiCallsInUtils},get"no-mutable-exports"(){return require("./rules/no-mutable-exports").noMutableExports}};(0,eslint_devkit_1.withCanonicalDocsUrls)("plugin-modularity",exports.rules);exports.plugin={meta:{name:"eslint-plugin-modularity",version:"3.0.3"},rules:exports.rules};const recommendedRules={"modularity/ddd-anemic-domain-model":"warn","modularity/ddd-value-object-immutability":"error","modularity/enforce-naming":"warn","modularity/enforce-rest-conventions":"error","modularity/no-external-api-calls-in-utils":"error","modularity/no-mutable-exports":"warn"};exports.configs={recommended:{plugins:{"modularity":exports.plugin},rules:recommendedRules},strict:{plugins:{"modularity":exports.plugin},rules:Object.fromEntries(Object.keys(exports.rules).map(ruleName=>[`modularity/${ruleName}`,"error"]))}};exports.default=exports.plugin;
|