eslint-plugin-modularity 2.0.1 โ 2.0.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 +47 -57
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
|
|
6
|
+
Security-focused ESLint plugin.
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
@@ -16,27 +16,27 @@
|
|
|
16
16
|
|
|
17
17
|
## Description
|
|
18
18
|
|
|
19
|
-
This plugin
|
|
19
|
+
This plugin provides Security-focused ESLint plugin.
|
|
20
|
+
By using this plugin, you can proactively identify and mitigate security risks across your entire codebase.
|
|
20
21
|
|
|
21
22
|
## Philosophy
|
|
22
23
|
|
|
23
|
-
**Interlace** fosters **strength through integration**.
|
|
24
|
+
**Interlace** fosters **strength through integration**. Instead of stacking isolated rules, we **interlace** security directly into your workflow to create a resilient fabric of code. We believe tools should **guide rather than gatekeep**, providing educational feedback that strengthens the developer with every interaction.
|
|
24
25
|
|
|
25
26
|
## Getting Started
|
|
26
27
|
|
|
27
|
-
- To check out the [guide](https://eslint.interlace.tools/docs/modularity), visit [eslint.interlace.tools](https://eslint.interlace.tools). ๐
|
|
28
|
-
- ่ฆๆฅ็ไธญๆ [ๆๅ](https://eslint.interlace.tools/docs/modularity), ่ฏท่ฎฟ้ฎ [eslint.interlace.tools](https://eslint.interlace.tools). ๐
|
|
29
|
-
- [๊ฐ์ด๋](https://eslint.interlace.tools/docs/modularity) ๋ฌธ์๋ [eslint.interlace.tools](https://eslint.interlace.tools)์์ ํ์ธํ์ค ์ ์์ต๋๋ค. ๐
|
|
30
|
-
- [ใฌใคใ](https://eslint.interlace.tools/docs/modularity)ใฏ [eslint.interlace.tools](https://eslint.interlace.tools)ใงใ็ขบ่ชใใ ใใใ ๐
|
|
31
|
-
- Para ver la [guรญa](https://eslint.interlace.tools/docs/modularity), visita [eslint.interlace.tools](https://eslint.interlace.tools). ๐
|
|
32
|
-
- ููุงุทูุงุน ุนูู [ุงูุฏููู](https://eslint.interlace.tools/docs/modularity)ุ ูู
ุจุฒูุงุฑุฉ [eslint.interlace.tools](https://eslint.interlace.tools). ๐
|
|
28
|
+
- To check out the [guide](https://eslint.interlace.tools/docs/quality/plugin-modularity), visit [eslint.interlace.tools](https://eslint.interlace.tools). ๐
|
|
29
|
+
- ่ฆๆฅ็ไธญๆ [ๆๅ](https://eslint.interlace.tools/docs/quality/plugin-modularity), ่ฏท่ฎฟ้ฎ [eslint.interlace.tools](https://eslint.interlace.tools). ๐
|
|
30
|
+
- [๊ฐ์ด๋](https://eslint.interlace.tools/docs/quality/plugin-modularity) ๋ฌธ์๋ [eslint.interlace.tools](https://eslint.interlace.tools)์์ ํ์ธํ์ค ์ ์์ต๋๋ค. ๐
|
|
31
|
+
- [ใฌใคใ](https://eslint.interlace.tools/docs/quality/plugin-modularity)ใฏ [eslint.interlace.tools](https://eslint.interlace.tools)ใงใ็ขบ่ชใใ ใใใ ๐
|
|
32
|
+
- Para ver la [guรญa](https://eslint.interlace.tools/docs/quality/plugin-modularity), visita [eslint.interlace.tools](https://eslint.interlace.tools). ๐
|
|
33
|
+
- ููุงุทูุงุน ุนูู [ุงูุฏููู](https://eslint.interlace.tools/docs/quality/plugin-modularity)ุ ูู
ุจุฒูุงุฑุฉ [eslint.interlace.tools](https://eslint.interlace.tools). ๐
|
|
33
34
|
|
|
34
35
|
```bash
|
|
35
36
|
npm install eslint-plugin-modularity --save-dev
|
|
36
37
|
```
|
|
37
38
|
|
|
38
39
|
## โ๏ธ Configuration Presets
|
|
39
|
-
|
|
40
40
|
| Preset | Description |
|
|
41
41
|
| :------------ | :----------------------------------------- |
|
|
42
42
|
| `recommended` | Balanced DDD and architecture enforcement |
|
|
@@ -45,7 +45,6 @@ npm install eslint-plugin-modularity --save-dev
|
|
|
45
45
|
---
|
|
46
46
|
|
|
47
47
|
## ๐ข Usage Example
|
|
48
|
-
|
|
49
48
|
```js
|
|
50
49
|
// eslint.config.js
|
|
51
50
|
import modularity from 'eslint-plugin-modularity';
|
|
@@ -63,44 +62,7 @@ export default [
|
|
|
63
62
|
|
|
64
63
|
---
|
|
65
64
|
|
|
66
|
-
## AI-Optimized Messages
|
|
67
|
-
|
|
68
|
-
This plugin is optimized for ESLint's [Model Context Protocol (MCP)](https://eslint.org/docs/latest/use/mcp), enabling AI assistants like **Cursor**, **GitHub Copilot**, and **Claude** to:
|
|
69
|
-
|
|
70
|
-
- Understand the exact issue via structured context
|
|
71
|
-
- Apply the correct fix using guidance
|
|
72
|
-
- Provide educational context to developers
|
|
73
|
-
|
|
74
|
-
```json
|
|
75
|
-
// .cursor/mcp.json
|
|
76
|
-
{
|
|
77
|
-
"mcpServers": {
|
|
78
|
-
"eslint": {
|
|
79
|
-
"command": "npx",
|
|
80
|
-
"args": ["@eslint/mcp@latest"]
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## Rules
|
|
89
|
-
|
|
90
|
-
| Rule | Description | ๐ผ | โ ๏ธ |
|
|
91
|
-
| :------------------------------------------------------------------------------- | :--------------------------------------------- | :-: | :-: |
|
|
92
|
-
| [ddd-anemic-domain-model](./docs/rules/ddd-anemic-domain-model.md) | Detect anemic domain models lacking behavior | ๐ผ | โ ๏ธ |
|
|
93
|
-
| [ddd-value-object-immutability](./docs/rules/ddd-value-object-immutability.md) | Enforce immutability in value objects | ๐ผ | |
|
|
94
|
-
| [enforce-naming](./docs/rules/enforce-naming.md) | Enforce consistent naming conventions by layer | ๐ผ | โ ๏ธ |
|
|
95
|
-
| [enforce-rest-conventions](./docs/rules/enforce-rest-conventions.md) | Enforce RESTful naming in API controllers | ๐ผ | |
|
|
96
|
-
| [no-external-api-calls-in-utils](./docs/rules/no-external-api-calls-in-utils.md) | Prevent external API calls in utility modules | ๐ผ | |
|
|
97
|
-
|
|
98
|
-
**Legend**: ๐ผ Recommended | โ ๏ธ Warns (not error)
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
65
|
## Why These Rules?
|
|
103
|
-
|
|
104
66
|
### `ddd-anemic-domain-model`
|
|
105
67
|
|
|
106
68
|
Detects domain entities that are just data containers without behavior โ a common anti-pattern.
|
|
@@ -176,20 +138,48 @@ export function format(data: Data): FormattedData {
|
|
|
176
138
|
|
|
177
139
|
---
|
|
178
140
|
|
|
179
|
-
##
|
|
141
|
+
## Rules
|
|
142
|
+
|
|
143
|
+
**Legend**
|
|
144
|
+
|
|
145
|
+
| Icon | Description |
|
|
146
|
+
| :---: | :--- |
|
|
147
|
+
| ๐ผ | **Recommended**: Included in the recommended preset. |
|
|
148
|
+
| โ ๏ธ | **Warns**: Set towarn in recommended preset. |
|
|
149
|
+
| ๐ง | **Auto-fixable**: Automatically fixable by the `--fix` CLI option. |
|
|
150
|
+
| ๐ก | **Suggestions**: Providing code suggestions in IDE. |
|
|
151
|
+
| ๐ซ | **Deprecated**: This rule is deprecated. |
|
|
180
152
|
|
|
181
|
-
|
|
153
|
+
| Rule | CWE | OWASP | CVSS | Description | ๐ผ | โ ๏ธ | ๐ง | ๐ก | ๐ซ |
|
|
154
|
+
| :--- | :---: | :---: | :---: | :--- | :---: | :---: | :---: | :---: | :---: |
|
|
155
|
+
| [ddd-anemic-domain-model](https://eslint.interlace.tools/docs/quality/plugin-modularity/rules/ddd-anemic-domain-model) | | | | ESLint rule documentation for ddd-anemic-domain-model | | | | | |
|
|
156
|
+
| [ddd-value-object-immutability](https://eslint.interlace.tools/docs/quality/plugin-modularity/rules/ddd-value-object-immutability) | | | | ESLint rule documentation for ddd-value-object-immutability | | | | | |
|
|
157
|
+
| [enforce-naming](https://eslint.interlace.tools/docs/quality/plugin-modularity/rules/enforce-naming) | | | | ESLint rule documentation for enforce-naming | | | | | |
|
|
158
|
+
| [enforce-rest-conventions](https://eslint.interlace.tools/docs/quality/plugin-modularity/rules/enforce-rest-conventions) | | | | ESLint rule documentation for enforce-rest-conventions | | | | | |
|
|
159
|
+
| [no-external-api-calls-in-utils](https://eslint.interlace.tools/docs/quality/plugin-modularity/rules/no-external-api-calls-in-utils) | | | | ESLint rule documentation for no-external-api-calls-in-utils | | | | | |
|
|
182
160
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
|
161
|
+
## ๐ Related ESLint Plugins
|
|
162
|
+
|
|
163
|
+
Part of the **Interlace ESLint Ecosystem** โ AI-native security plugins with LLM-optimized error messages:
|
|
164
|
+
|
|
165
|
+
| Plugin | Downloads | Description |
|
|
166
|
+
| :--- | :---: | :--- |
|
|
167
|
+
| [`eslint-plugin-secure-coding`](https://www.npmjs.com/package/eslint-plugin-secure-coding) | [](https://www.npmjs.com/package/eslint-plugin-secure-coding) | General security rules & OWASP guidelines. |
|
|
168
|
+
| [`eslint-plugin-pg`](https://www.npmjs.com/package/eslint-plugin-pg) | [](https://www.npmjs.com/package/eslint-plugin-pg) | PostgreSQL security & best practices. |
|
|
169
|
+
| [`eslint-plugin-crypto`](https://www.npmjs.com/package/eslint-plugin-crypto) | [](https://www.npmjs.com/package/eslint-plugin-crypto) | NodeJS Cryptography security rules. |
|
|
170
|
+
| [`eslint-plugin-jwt`](https://www.npmjs.com/package/eslint-plugin-jwt) | [](https://www.npmjs.com/package/eslint-plugin-jwt) | JWT security & best practices. |
|
|
171
|
+
| [`eslint-plugin-browser-security`](https://www.npmjs.com/package/eslint-plugin-browser-security) | [](https://www.npmjs.com/package/eslint-plugin-browser-security) | Browser-specific security & XSS prevention. |
|
|
172
|
+
| [`eslint-plugin-express-security`](https://www.npmjs.com/package/eslint-plugin-express-security) | [](https://www.npmjs.com/package/eslint-plugin-express-security) | Express.js security hardening rules. |
|
|
173
|
+
| [`eslint-plugin-lambda-security`](https://www.npmjs.com/package/eslint-plugin-lambda-security) | [](https://www.npmjs.com/package/eslint-plugin-lambda-security) | AWS Lambda security best practices. |
|
|
174
|
+
| [`eslint-plugin-nestjs-security`](https://www.npmjs.com/package/eslint-plugin-nestjs-security) | [](https://www.npmjs.com/package/eslint-plugin-nestjs-security) | NestJS security rules & patterns. |
|
|
175
|
+
| [`eslint-plugin-mongodb-security`](https://www.npmjs.com/package/eslint-plugin-mongodb-security) | [](https://www.npmjs.com/package/eslint-plugin-mongodb-security) | MongoDB security best practices. |
|
|
176
|
+
| [`eslint-plugin-vercel-ai-security`](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | [](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | Vercel AI SDK security hardening. |
|
|
177
|
+
| [`eslint-plugin-import-next`](https://www.npmjs.com/package/eslint-plugin-import-next) | [](https://www.npmjs.com/package/eslint-plugin-import-next) | Next-gen import sorting & architecture. |
|
|
188
178
|
|
|
189
179
|
## ๐ License
|
|
190
180
|
|
|
191
181
|
MIT ยฉ [Ofri Peretz](https://github.com/ofri-peretz)
|
|
192
182
|
|
|
193
183
|
<p align="center">
|
|
194
|
-
<a href="https://eslint.interlace.tools/docs/modularity"><img src="https://eslint.interlace.tools/images/og-
|
|
195
|
-
</p>
|
|
184
|
+
<a href="https://eslint.interlace.tools/docs/quality/plugin-modularity"><img src="https://eslint.interlace.tools/images/og-modularity.png" alt="ESLint Interlace Plugin" width="100%" /></a>
|
|
185
|
+
</p>
|
package/package.json
CHANGED