@futdevpro/dynamo-eslint 1.14.2 → 1.14.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/README.md +264 -29
- package/build/configs/base.d.ts +6 -81
- package/build/configs/base.d.ts.map +1 -1
- package/build/configs/base.js +89 -54
- package/build/configs/base.js.map +1 -1
- package/build/configs/fsm.d.ts +1 -85
- package/build/configs/fsm.d.ts.map +1 -1
- package/build/configs/fsm.js +3 -6
- package/build/configs/fsm.js.map +1 -1
- package/build/configs/ngx-package.d.ts +1 -85
- package/build/configs/ngx-package.d.ts.map +1 -1
- package/build/configs/ngx-package.js +3 -6
- package/build/configs/ngx-package.js.map +1 -1
- package/build/configs/ngx.d.ts +4 -85
- package/build/configs/ngx.d.ts.map +1 -1
- package/build/configs/ngx.js +67 -11
- package/build/configs/ngx.js.map +1 -1
- package/build/configs/nts-package.d.ts +1 -87
- package/build/configs/nts-package.d.ts.map +1 -1
- package/build/configs/nts-package.js +12 -10
- package/build/configs/nts-package.js.map +1 -1
- package/build/configs/nts.d.ts +1 -86
- package/build/configs/nts.d.ts.map +1 -1
- package/build/configs/nts.js +26 -11
- package/build/configs/nts.js.map +1 -1
- package/build/scripts/fix-return-types.js.map +1 -1
- package/futdevpro-dynamo-eslint-01.14.3.tgz +0 -0
- package/package.json +1 -1
- package/samples/.vscode/settings.json +13 -0
- package/samples/base/eslint.config.js +3 -0
- package/samples/fsm/.eslintrc.json +4 -0
- package/samples/fsm/eslint.config.js +3 -0
- package/samples/ngx/eslint.config.js +3 -0
- package/samples/ngx-package/.eslintrc.json +4 -0
- package/samples/ngx-package/eslint.config.js +3 -0
- package/samples/nts/eslint.config.js +3 -0
- package/samples/nts-package/.eslintrc.json +4 -0
- package/samples/nts-package/eslint.config.js +3 -0
- package/samples/package.json.example +26 -0
- package/src/configs/base.ts +89 -54
- package/src/configs/fsm.ts +3 -6
- package/src/configs/ngx-package.ts +3 -6
- package/src/configs/ngx.ts +67 -11
- package/src/configs/nts-package.ts +12 -10
- package/src/configs/nts.ts +26 -11
- package/src/scripts/fix-return-types.ts +2 -0
- package/futdevpro-dynamo-eslint-01.14.2.tgz +0 -0
package/README.md
CHANGED
|
@@ -1,46 +1,177 @@
|
|
|
1
1
|
# @futdevpro/dynamo-eslint
|
|
2
2
|
|
|
3
|
-
Shared ESLint presets
|
|
3
|
+
Shared ESLint presets, custom Dynamo rules, and validation tools for FutDevPro TypeScript projects. This package provides standardized linting configurations optimized for **lint-on-save** functionality across different project types.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 🚀 Quick Start
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install --save-dev @futdevpro/dynamo-eslint
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Required Peer Dependencies
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install --save-dev \
|
|
17
|
+
@typescript-eslint/eslint-plugin@^8.0.0 \
|
|
18
|
+
@typescript-eslint/parser@^8.0.0 \
|
|
19
|
+
eslint@^9.0.0 \
|
|
20
|
+
eslint-plugin-import@^2.29.0 \
|
|
21
|
+
eslint-plugin-jsdoc@^48.0.0 \
|
|
22
|
+
eslint-plugin-prettier@^5.1.3 \
|
|
23
|
+
prettier@^3.3.0
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
For Angular projects, also install:
|
|
27
|
+
```bash
|
|
28
|
+
npm install --save-dev \
|
|
29
|
+
@angular-eslint/eslint-plugin@^19.0.0 \
|
|
30
|
+
@angular-eslint/eslint-plugin-template@^19.0.0 \
|
|
31
|
+
@angular-eslint/template-parser@^19.0.0
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 📋 Available Presets
|
|
35
|
+
|
|
36
|
+
### 1. **base** - Core TypeScript Rules
|
|
37
|
+
Generic TypeScript projects with browser environment.
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
const baseConfig = require('@futdevpro/dynamo-eslint/base');
|
|
41
|
+
|
|
42
|
+
module.exports = baseConfig;
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Features:**
|
|
46
|
+
- Browser environment
|
|
47
|
+
- 1000 line limit
|
|
48
|
+
- All Dynamo custom rules enabled
|
|
49
|
+
- Explicit return types required
|
|
50
|
+
|
|
51
|
+
### 2. **nts** - Node TypeScript Projects
|
|
52
|
+
Node.js TypeScript applications and services.
|
|
53
|
+
|
|
54
|
+
```javascript
|
|
55
|
+
const ntsConfig = require('@futdevpro/dynamo-eslint/nts');
|
|
56
|
+
|
|
57
|
+
module.exports = ntsConfig;
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Features:**
|
|
61
|
+
- Node environment
|
|
62
|
+
- 1500 line limit (extended for server code)
|
|
63
|
+
- Module source type
|
|
64
|
+
- All base rules + Node-specific optimizations
|
|
65
|
+
|
|
66
|
+
### 3. **ngx** - Angular Projects
|
|
67
|
+
Angular applications with component and template linting.
|
|
68
|
+
|
|
69
|
+
```javascript
|
|
70
|
+
const ngxConfig = require('@futdevpro/dynamo-eslint/ngx');
|
|
71
|
+
|
|
72
|
+
module.exports = ngxConfig;
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Features:**
|
|
76
|
+
- Angular ESLint integration
|
|
77
|
+
- Browser environment
|
|
78
|
+
- Component and template linting
|
|
79
|
+
- Angular-specific rules
|
|
80
|
+
|
|
81
|
+
### 4. **fsm** - Full Stack Module
|
|
82
|
+
Full-stack TypeScript modules (same as base).
|
|
83
|
+
|
|
84
|
+
```javascript
|
|
85
|
+
const fsmConfig = require('@futdevpro/dynamo-eslint/fsm');
|
|
86
|
+
|
|
87
|
+
module.exports = fsmConfig;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### 5. **nts-package** - Node TypeScript Packages
|
|
91
|
+
NPM packages and libraries built with TypeScript.
|
|
92
|
+
|
|
93
|
+
```javascript
|
|
94
|
+
const ntsPackageConfig = require('@futdevpro/dynamo-eslint/nts-package');
|
|
95
|
+
|
|
96
|
+
module.exports = ntsPackageConfig;
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Features:**
|
|
100
|
+
- Relaxed `@typescript-eslint/ban-types` and `no-explicit-any` rules
|
|
101
|
+
- Optimized for package development
|
|
102
|
+
- Extended line limits for library code
|
|
103
|
+
|
|
104
|
+
### 6. **ngx-package** - Angular Packages
|
|
105
|
+
Angular libraries and packages.
|
|
106
|
+
|
|
107
|
+
```javascript
|
|
108
|
+
const ngxPackageConfig = require('@futdevpro/dynamo-eslint/ngx-package');
|
|
109
|
+
|
|
110
|
+
module.exports = ngxPackageConfig;
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## ⚙️ Lint-on-Save Configuration
|
|
114
|
+
|
|
115
|
+
**Critical: Configure ESLint to run ONLY on save, not on type!**
|
|
116
|
+
|
|
117
|
+
### VSCode/Cursor Settings
|
|
118
|
+
|
|
119
|
+
Create `.vscode/settings.json` in your project root:
|
|
8
120
|
|
|
9
121
|
```json
|
|
10
122
|
{
|
|
11
|
-
"
|
|
12
|
-
"
|
|
123
|
+
"eslint.run": "onSave",
|
|
124
|
+
"eslint.workingDirectories": [{ "mode": "auto" }],
|
|
125
|
+
"editor.codeActionsOnSave": {
|
|
126
|
+
"source.fixAll.eslint": "explicit"
|
|
127
|
+
},
|
|
128
|
+
"eslint.validate": [
|
|
129
|
+
"javascript",
|
|
130
|
+
"typescript"
|
|
131
|
+
]
|
|
13
132
|
}
|
|
14
133
|
```
|
|
15
134
|
|
|
16
|
-
|
|
135
|
+
### Workspace vs User Settings
|
|
136
|
+
|
|
137
|
+
- **Workspace settings** (`.vscode/settings.json`): Apply only to current project
|
|
138
|
+
- **User settings**: Apply globally to all projects
|
|
139
|
+
|
|
140
|
+
For team consistency, use workspace settings.
|
|
141
|
+
|
|
142
|
+
### Multi-Root Workspace Configuration
|
|
143
|
+
|
|
144
|
+
For workspaces with multiple projects:
|
|
17
145
|
|
|
18
146
|
```json
|
|
19
147
|
{
|
|
20
148
|
"eslint.run": "onSave",
|
|
21
|
-
"eslint.workingDirectories": [
|
|
22
|
-
|
|
149
|
+
"eslint.workingDirectories": [
|
|
150
|
+
{ "mode": "auto" },
|
|
151
|
+
{ "directory": "./packages/package-a" },
|
|
152
|
+
{ "directory": "./packages/package-b" }
|
|
153
|
+
],
|
|
154
|
+
"editor.codeActionsOnSave": {
|
|
155
|
+
"source.fixAll.eslint": "explicit"
|
|
156
|
+
}
|
|
23
157
|
}
|
|
24
158
|
```
|
|
25
159
|
|
|
26
|
-
##
|
|
27
|
-
- base
|
|
28
|
-
- nts
|
|
29
|
-
- ngx
|
|
30
|
-
- fsm
|
|
31
|
-
- nts-package
|
|
32
|
-
- ngx-package
|
|
33
|
-
|
|
34
|
-
## Custom Rules
|
|
160
|
+
## 🔧 Custom Dynamo Rules
|
|
35
161
|
|
|
36
162
|
This package includes custom ESLint rules for Dynamo conventions:
|
|
37
163
|
|
|
38
|
-
|
|
39
|
-
-
|
|
164
|
+
### Import Rules
|
|
165
|
+
- **`@futdevpro/dynamo/import-order`**: Enforces consistent import ordering
|
|
166
|
+
- **`@futdevpro/dynamo/no-import-type`**: Forbids TypeScript `import type` syntax
|
|
167
|
+
- **`@futdevpro/dynamo/no-js-import`**: Prevents importing `.js` files in TypeScript
|
|
168
|
+
|
|
169
|
+
### Naming Rules
|
|
170
|
+
- **`@futdevpro/dynamo/naming-patterns`**: Enforces DyFM naming conventions
|
|
40
171
|
|
|
41
|
-
## Validation
|
|
172
|
+
## 🛠️ CLI Validation Tools
|
|
42
173
|
|
|
43
|
-
Use
|
|
174
|
+
Use these commands to validate your codebase:
|
|
44
175
|
|
|
45
176
|
```bash
|
|
46
177
|
# Validate import ordering across all TypeScript files
|
|
@@ -51,20 +182,124 @@ dynamo-validate-naming
|
|
|
51
182
|
|
|
52
183
|
# Audit ESLint configurations for duplicate rules
|
|
53
184
|
dynamo-eslintrc-audit
|
|
185
|
+
|
|
186
|
+
# Run comprehensive fixes
|
|
187
|
+
dynamo-fix
|
|
188
|
+
|
|
189
|
+
# Fix missing return types (includes TypeScript AST transformation fix)
|
|
190
|
+
dynamo-fix-return-types
|
|
54
191
|
```
|
|
55
192
|
|
|
56
|
-
|
|
193
|
+
### NPM Scripts Integration
|
|
194
|
+
|
|
195
|
+
Add to your `package.json`:
|
|
196
|
+
|
|
197
|
+
```json
|
|
198
|
+
{
|
|
199
|
+
"scripts": {
|
|
200
|
+
"lint": "eslint src --ext .ts",
|
|
201
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
202
|
+
"validate:imports": "dynamo-validate-imports",
|
|
203
|
+
"validate:naming": "dynamo-validate-naming",
|
|
204
|
+
"audit:eslintrc": "dynamo-eslintrc-audit",
|
|
205
|
+
"fix": "dynamo-fix",
|
|
206
|
+
"fix:return-types": "dynamo-fix-return-types"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## 🔄 Migration from Manual Configs
|
|
212
|
+
|
|
213
|
+
### Quick Migration Checklist
|
|
214
|
+
|
|
215
|
+
1. **Install the package and peer dependencies**
|
|
216
|
+
2. **Replace your `.eslintrc.json`** with the appropriate preset
|
|
217
|
+
3. **Configure lint-on-save** in VSCode/Cursor settings
|
|
218
|
+
4. **Run validation tools** to check for issues
|
|
219
|
+
5. **Update CI/CD** to use the new configuration
|
|
220
|
+
|
|
221
|
+
### Common Migration Issues
|
|
222
|
+
|
|
223
|
+
- **Peer dependency conflicts**: Ensure all peer dependencies are installed
|
|
224
|
+
- **Working directory issues**: Use `"eslint.workingDirectories": [{ "mode": "auto" }]`
|
|
225
|
+
- **Rule conflicts**: The presets handle most conflicts automatically
|
|
226
|
+
|
|
227
|
+
> 📖 **Detailed Migration Guide**: See [Migration Guide](./docs/migration.md) for step-by-step instructions.
|
|
228
|
+
|
|
229
|
+
## 🐛 Troubleshooting
|
|
230
|
+
|
|
231
|
+
### Lint-on-Save Not Working
|
|
232
|
+
|
|
233
|
+
1. **Check ESLint is running on save only:**
|
|
234
|
+
```json
|
|
235
|
+
{
|
|
236
|
+
"eslint.run": "onSave" // NOT "onType"
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
2. **Verify working directories:**
|
|
241
|
+
```json
|
|
242
|
+
{
|
|
243
|
+
"eslint.workingDirectories": [{ "mode": "auto" }]
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
3. **Check file associations:**
|
|
248
|
+
```json
|
|
249
|
+
{
|
|
250
|
+
"eslint.validate": ["javascript", "typescript"]
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Peer Dependency Issues
|
|
255
|
+
|
|
256
|
+
Ensure all peer dependencies are installed with compatible versions:
|
|
57
257
|
|
|
58
258
|
```bash
|
|
59
|
-
npm
|
|
60
|
-
npm run validate:naming
|
|
61
|
-
npm run audit:eslintrc
|
|
259
|
+
npm ls @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint
|
|
62
260
|
```
|
|
63
261
|
|
|
64
|
-
|
|
262
|
+
### ESLint v9 Flat Config
|
|
263
|
+
|
|
264
|
+
This package now uses ESLint v9 flat config format (`eslint.config.js`) for all exported presets. The package itself also uses flat config for self-linting.
|
|
265
|
+
|
|
266
|
+
## 📁 Examples
|
|
267
|
+
|
|
268
|
+
Reference implementations are available in the `samples/` directory:
|
|
269
|
+
|
|
270
|
+
- `samples/base/eslint.config.js` - Base preset example
|
|
271
|
+
- `samples/nts/eslint.config.js` - Node TypeScript example
|
|
272
|
+
- `samples/ngx/eslint.config.js` - Angular example
|
|
273
|
+
- `samples/fsm/eslint.config.js` - Full Stack Module example
|
|
274
|
+
- `samples/nts-package/eslint.config.js` - Node TypeScript Package example
|
|
275
|
+
- `samples/ngx-package/eslint.config.js` - Angular Package example
|
|
276
|
+
|
|
277
|
+
## 🔧 Recent Fixes
|
|
278
|
+
|
|
279
|
+
### TypeScript AST Transformation Context Fix
|
|
280
|
+
|
|
281
|
+
The `dynamo-fix-return-types` script includes a fix for TypeScript AST transformation context issues. This resolves compilation errors when using `ts.visitEachChild()` by properly providing the `TransformationContext` parameter:
|
|
282
|
+
|
|
283
|
+
```typescript
|
|
284
|
+
// Fixed implementation
|
|
285
|
+
return ts.visitEachChild(node, visit, {} as ts.TransformationContext);
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
This ensures compatibility with TypeScript's AST transformation APIs.
|
|
289
|
+
|
|
290
|
+
## 📚 Self-Linting
|
|
291
|
+
|
|
292
|
+
This package uses its own presets and rules for self-linting. The ESLint v9 flat config is in `eslint.config.js` and demonstrates advanced configuration patterns.
|
|
293
|
+
|
|
294
|
+
## 🏗️ Architecture
|
|
65
295
|
|
|
66
|
-
|
|
296
|
+
- **Presets**: Standardized rule configurations for different project types
|
|
297
|
+
- **Custom Rules**: Dynamo-specific linting rules for import order and naming
|
|
298
|
+
- **CLI Tools**: Validation and fixing utilities
|
|
299
|
+
- **TypeScript Integration**: Full TypeScript AST transformation support
|
|
67
300
|
|
|
68
|
-
|
|
301
|
+
---
|
|
69
302
|
|
|
70
|
-
|
|
303
|
+
**Maintained by**: Future Development Program Ltd.
|
|
304
|
+
**License**: ISC
|
|
305
|
+
**Version**: 02.00.0
|
package/build/configs/base.d.ts
CHANGED
|
@@ -1,85 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Base Rulesets For Dynamo Based Systems
|
|
3
|
+
* ESLint v9 Flat Config Format
|
|
3
4
|
*/
|
|
4
|
-
declare const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
parser: string;
|
|
10
|
-
parserOptions: {
|
|
11
|
-
ecmaVersion: string;
|
|
12
|
-
};
|
|
13
|
-
plugins: string[];
|
|
14
|
-
extends: string[];
|
|
15
|
-
rules: {
|
|
16
|
-
'no-warning-comments': (string | {
|
|
17
|
-
terms: string[];
|
|
18
|
-
location: string;
|
|
19
|
-
})[];
|
|
20
|
-
indent: (string | number | {
|
|
21
|
-
SwitchCase: number;
|
|
22
|
-
})[];
|
|
23
|
-
'max-len': (string | {
|
|
24
|
-
code: number;
|
|
25
|
-
comments: number;
|
|
26
|
-
})[];
|
|
27
|
-
'max-lines': (string | number)[];
|
|
28
|
-
'linebreak-style': string;
|
|
29
|
-
semi: string[];
|
|
30
|
-
'no-unused-vars': string;
|
|
31
|
-
'no-prototype-builtins': string;
|
|
32
|
-
'no-empty': string;
|
|
33
|
-
'comma-dangle': (string | {
|
|
34
|
-
arrays: string;
|
|
35
|
-
objects: string;
|
|
36
|
-
functions: string;
|
|
37
|
-
imports: string;
|
|
38
|
-
exports: string;
|
|
39
|
-
})[];
|
|
40
|
-
'brace-style': (string | {
|
|
41
|
-
allowSingleLine: boolean;
|
|
42
|
-
})[];
|
|
43
|
-
'object-curly-spacing': string[];
|
|
44
|
-
'array-bracket-spacing': (string | {
|
|
45
|
-
objectsInArrays: boolean;
|
|
46
|
-
arraysInArrays: boolean;
|
|
47
|
-
})[];
|
|
48
|
-
'padding-line-between-statements': (string | {
|
|
49
|
-
blankLine: string;
|
|
50
|
-
prev: string;
|
|
51
|
-
next: string[];
|
|
52
|
-
} | {
|
|
53
|
-
blankLine: string;
|
|
54
|
-
prev: string[];
|
|
55
|
-
next: string;
|
|
56
|
-
} | {
|
|
57
|
-
blankLine: string;
|
|
58
|
-
prev: string[];
|
|
59
|
-
next: string[];
|
|
60
|
-
})[];
|
|
61
|
-
'prefer-const': string;
|
|
62
|
-
'no-case-declarations': string;
|
|
63
|
-
'no-fallthrough': string;
|
|
64
|
-
'keyword-spacing': string;
|
|
65
|
-
'no-else-return': string;
|
|
66
|
-
'no-duplicate-imports': string;
|
|
67
|
-
'max-params': (string | number)[];
|
|
68
|
-
'max-params-no-constructor/max-params-no-constructor': (string | number)[];
|
|
69
|
-
quotes: (string | {
|
|
70
|
-
allowTemplateLiterals: boolean;
|
|
71
|
-
})[];
|
|
72
|
-
'@typescript-eslint/no-unused-vars': string;
|
|
73
|
-
'@typescript-eslint/explicit-function-return-type': (string | {
|
|
74
|
-
allowTypedFunctionExpressions: boolean;
|
|
75
|
-
})[];
|
|
76
|
-
'@typescript-eslint/no-explicit-any': string;
|
|
77
|
-
'@typescript-eslint/typedef': string;
|
|
78
|
-
'@futdevpro/dynamo/import-order': string;
|
|
79
|
-
'@futdevpro/dynamo/naming-patterns': string;
|
|
80
|
-
'@futdevpro/dynamo/no-import-type': string;
|
|
81
|
-
'@futdevpro/dynamo/no-js-import': string;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
export = _default;
|
|
5
|
+
declare const tsParser: any;
|
|
6
|
+
declare const tsPlugin: any;
|
|
7
|
+
declare const unusedImportsPlugin: any;
|
|
8
|
+
declare const maxParamsNoConstructorPlugin: any;
|
|
9
|
+
declare const dynamoPlugin: any;
|
|
85
10
|
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,QAAA,MAAM,QAAQ,KAAuC,CAAC;AACtD,QAAA,MAAM,QAAQ,KAA8C,CAAC;AAC7D,QAAA,MAAM,mBAAmB,KAA0C,CAAC;AACpE,QAAA,MAAM,4BAA4B,KAAqD,CAAC;AACxF,QAAA,MAAM,YAAY,KAAuB,CAAC"}
|
package/build/configs/base.js
CHANGED
|
@@ -1,56 +1,91 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
'indent': ['warn', 2, { SwitchCase: 1 }],
|
|
19
|
-
'max-len': ['warn', { code: 100, comments: 120 }],
|
|
20
|
-
'max-lines': ['warn', 1000],
|
|
21
|
-
'linebreak-style': 'off',
|
|
22
|
-
'semi': ['warn', 'always'],
|
|
23
|
-
'no-unused-vars': 'off',
|
|
24
|
-
'no-prototype-builtins': 'off',
|
|
25
|
-
'no-empty': 'warn',
|
|
26
|
-
'comma-dangle': ['warn', { arrays: 'always-multiline', objects: 'always-multiline', functions: 'only-multiline', imports: 'never', exports: 'never' }],
|
|
27
|
-
'brace-style': ['warn', '1tbs', { allowSingleLine: false }],
|
|
28
|
-
'object-curly-spacing': ['warn', 'always'],
|
|
29
|
-
'array-bracket-spacing': ['warn', 'always', { objectsInArrays: false, arraysInArrays: false }],
|
|
30
|
-
'padding-line-between-statements': [
|
|
31
|
-
'warn',
|
|
32
|
-
{ blankLine: 'always', prev: '*', next: ['return', 'throw', 'if', 'for', 'while', 'switch', 'default'] },
|
|
33
|
-
{ blankLine: 'always', prev: ['const', 'let', 'var', 'break'], next: '*' },
|
|
34
|
-
{ blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
|
|
35
|
-
],
|
|
36
|
-
'prefer-const': 'warn',
|
|
37
|
-
'no-case-declarations': 'off',
|
|
38
|
-
'no-fallthrough': 'off',
|
|
39
|
-
'keyword-spacing': 'warn',
|
|
40
|
-
'no-else-return': 'warn',
|
|
41
|
-
'no-duplicate-imports': 'warn',
|
|
42
|
-
'max-params': ['warn', 4],
|
|
43
|
-
'max-params-no-constructor/max-params-no-constructor': ['warn', 5],
|
|
44
|
-
'quotes': ['warn', 'single', { allowTemplateLiterals: true }],
|
|
45
|
-
'@typescript-eslint/no-unused-vars': 'warn',
|
|
46
|
-
'@typescript-eslint/explicit-function-return-type': ['warn', { allowTypedFunctionExpressions: false }],
|
|
47
|
-
'@typescript-eslint/no-explicit-any': 'warn',
|
|
48
|
-
'@typescript-eslint/typedef': 'warn',
|
|
49
|
-
// Dynamo custom rules
|
|
50
|
-
'@futdevpro/dynamo/import-order': 'warn',
|
|
51
|
-
'@futdevpro/dynamo/naming-patterns': 'warn',
|
|
52
|
-
'@futdevpro/dynamo/no-import-type': 'warn',
|
|
53
|
-
'@futdevpro/dynamo/no-js-import': 'warn',
|
|
1
|
+
/**
|
|
2
|
+
* Base Rulesets For Dynamo Based Systems
|
|
3
|
+
* ESLint v9 Flat Config Format
|
|
4
|
+
*/
|
|
5
|
+
const tsParser = require('@typescript-eslint/parser');
|
|
6
|
+
const tsPlugin = require('@typescript-eslint/eslint-plugin');
|
|
7
|
+
const unusedImportsPlugin = require('eslint-plugin-unused-imports');
|
|
8
|
+
const maxParamsNoConstructorPlugin = require('eslint-plugin-max-params-no-constructor');
|
|
9
|
+
const dynamoPlugin = require('../plugin');
|
|
10
|
+
module.exports = [
|
|
11
|
+
{
|
|
12
|
+
ignores: [
|
|
13
|
+
'node_modules/**',
|
|
14
|
+
'dist/**',
|
|
15
|
+
'build/**',
|
|
16
|
+
'*.d.ts'
|
|
17
|
+
]
|
|
54
18
|
},
|
|
55
|
-
|
|
19
|
+
{
|
|
20
|
+
files: ['**/*.ts', '**/*.tsx'],
|
|
21
|
+
languageOptions: {
|
|
22
|
+
parser: tsParser,
|
|
23
|
+
parserOptions: {
|
|
24
|
+
ecmaVersion: 'latest',
|
|
25
|
+
sourceType: 'module'
|
|
26
|
+
},
|
|
27
|
+
globals: {
|
|
28
|
+
// Browser globals
|
|
29
|
+
window: 'readonly',
|
|
30
|
+
document: 'readonly',
|
|
31
|
+
console: 'readonly',
|
|
32
|
+
process: 'readonly',
|
|
33
|
+
Buffer: 'readonly',
|
|
34
|
+
global: 'readonly',
|
|
35
|
+
__dirname: 'readonly',
|
|
36
|
+
__filename: 'readonly',
|
|
37
|
+
module: 'readonly',
|
|
38
|
+
require: 'readonly',
|
|
39
|
+
exports: 'readonly'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
plugins: {
|
|
43
|
+
'@typescript-eslint': tsPlugin,
|
|
44
|
+
'unused-imports': unusedImportsPlugin,
|
|
45
|
+
'max-params-no-constructor': maxParamsNoConstructorPlugin,
|
|
46
|
+
'@futdevpro/dynamo': dynamoPlugin,
|
|
47
|
+
},
|
|
48
|
+
rules: {
|
|
49
|
+
// ESLint recommended rules
|
|
50
|
+
'no-warning-comments': ['warn', { terms: ['todo', 'fixme', 'removable', '??'], location: 'anywhere' }],
|
|
51
|
+
'indent': ['warn', 2, { SwitchCase: 1 }],
|
|
52
|
+
'max-len': ['warn', { code: 100, comments: 120 }],
|
|
53
|
+
'max-lines': ['warn', 1000],
|
|
54
|
+
'linebreak-style': 'off',
|
|
55
|
+
'semi': ['warn', 'always'],
|
|
56
|
+
'no-unused-vars': 'off',
|
|
57
|
+
'no-prototype-builtins': 'off',
|
|
58
|
+
'no-empty': 'warn',
|
|
59
|
+
'comma-dangle': ['warn', { arrays: 'always-multiline', objects: 'always-multiline', functions: 'only-multiline', imports: 'never', exports: 'never' }],
|
|
60
|
+
'brace-style': ['warn', '1tbs', { allowSingleLine: false }],
|
|
61
|
+
'object-curly-spacing': ['warn', 'always'],
|
|
62
|
+
'array-bracket-spacing': ['warn', 'always', { objectsInArrays: false, arraysInArrays: false }],
|
|
63
|
+
'padding-line-between-statements': [
|
|
64
|
+
'warn',
|
|
65
|
+
{ blankLine: 'always', prev: '*', next: ['return', 'throw', 'if', 'for', 'while', 'switch', 'default'] },
|
|
66
|
+
{ blankLine: 'always', prev: ['const', 'let', 'var', 'break'], next: '*' },
|
|
67
|
+
{ blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
|
|
68
|
+
],
|
|
69
|
+
'prefer-const': 'warn',
|
|
70
|
+
'no-case-declarations': 'off',
|
|
71
|
+
'no-fallthrough': 'off',
|
|
72
|
+
'keyword-spacing': 'warn',
|
|
73
|
+
'no-else-return': 'warn',
|
|
74
|
+
'no-duplicate-imports': 'warn',
|
|
75
|
+
'max-params': ['warn', 4],
|
|
76
|
+
'max-params-no-constructor/max-params-no-constructor': ['warn', 5],
|
|
77
|
+
'quotes': ['warn', 'single', { allowTemplateLiterals: true }],
|
|
78
|
+
// TypeScript rules
|
|
79
|
+
'@typescript-eslint/no-unused-vars': 'warn',
|
|
80
|
+
'@typescript-eslint/explicit-function-return-type': ['warn', { allowTypedFunctionExpressions: false }],
|
|
81
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
82
|
+
'@typescript-eslint/typedef': 'warn',
|
|
83
|
+
// Dynamo custom rules
|
|
84
|
+
'@futdevpro/dynamo/import-order': 'warn',
|
|
85
|
+
'@futdevpro/dynamo/naming-patterns': 'warn',
|
|
86
|
+
'@futdevpro/dynamo/no-import-type': 'warn',
|
|
87
|
+
'@futdevpro/dynamo/no-js-import': 'warn',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
];
|
|
56
91
|
//# sourceMappingURL=base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,MAAM,QAAQ,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;AACtD,MAAM,QAAQ,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;AAC7D,MAAM,mBAAmB,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AACpE,MAAM,4BAA4B,GAAG,OAAO,CAAC,yCAAyC,CAAC,CAAC;AACxF,MAAM,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAE1C,MAAM,CAAC,OAAO,GAAG;IACf;QACE,OAAO,EAAE;YACP,iBAAiB;YACjB,SAAS;YACT,UAAU;YACV,QAAQ;SACT;KACF;IACD;QACE,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;QAC9B,eAAe,EAAE;Y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CAAC,MAAM,EAAE,EAAE,6BAA6B,EAAE,KAAK,EAAE,CAAC;YACtG,oCAAoC,EAAE,MAAM;YAC5C,4BAA4B,EAAE,MAAM;YAEpC,sBAAsB;YACtB,gCAAgC,EAAE,MAAM;YACxC,mCAAmC,EAAE,MAAM;YAC3C,kCAAkC,EAAE,MAAM;YAC1C,gCAAgC,EAAE,MAAM;SACzC;KACF;CACF,CAAC"}
|
package/build/configs/fsm.d.ts
CHANGED
|
@@ -1,86 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Rulesets For Dynamo Based Systems
|
|
3
|
-
* FSM: Full Stack Module
|
|
4
|
-
*/
|
|
5
|
-
declare const config: {
|
|
6
|
-
env: {
|
|
7
|
-
browser: boolean;
|
|
8
|
-
es2021: boolean;
|
|
9
|
-
};
|
|
10
|
-
parser: string;
|
|
11
|
-
parserOptions: {
|
|
12
|
-
ecmaVersion: string;
|
|
13
|
-
};
|
|
14
|
-
plugins: string[];
|
|
15
|
-
extends: string[];
|
|
16
|
-
rules: {
|
|
17
|
-
'no-warning-comments': (string | {
|
|
18
|
-
terms: string[];
|
|
19
|
-
location: string;
|
|
20
|
-
})[];
|
|
21
|
-
indent: (string | number | {
|
|
22
|
-
SwitchCase: number;
|
|
23
|
-
})[];
|
|
24
|
-
'max-len': (string | {
|
|
25
|
-
code: number;
|
|
26
|
-
comments: number;
|
|
27
|
-
})[];
|
|
28
|
-
'max-lines': (string | number)[];
|
|
29
|
-
'linebreak-style': string;
|
|
30
|
-
semi: string[];
|
|
31
|
-
'no-unused-vars': string;
|
|
32
|
-
'no-prototype-builtins': string;
|
|
33
|
-
'no-empty': string;
|
|
34
|
-
'comma-dangle': (string | {
|
|
35
|
-
arrays: string;
|
|
36
|
-
objects: string;
|
|
37
|
-
functions: string;
|
|
38
|
-
imports: string;
|
|
39
|
-
exports: string;
|
|
40
|
-
})[];
|
|
41
|
-
'brace-style': (string | {
|
|
42
|
-
allowSingleLine: boolean;
|
|
43
|
-
})[];
|
|
44
|
-
'object-curly-spacing': string[];
|
|
45
|
-
'array-bracket-spacing': (string | {
|
|
46
|
-
objectsInArrays: boolean;
|
|
47
|
-
arraysInArrays: boolean;
|
|
48
|
-
})[];
|
|
49
|
-
'padding-line-between-statements': (string | {
|
|
50
|
-
blankLine: string;
|
|
51
|
-
prev: string;
|
|
52
|
-
next: string[];
|
|
53
|
-
} | {
|
|
54
|
-
blankLine: string;
|
|
55
|
-
prev: string[];
|
|
56
|
-
next: string;
|
|
57
|
-
} | {
|
|
58
|
-
blankLine: string;
|
|
59
|
-
prev: string[];
|
|
60
|
-
next: string[];
|
|
61
|
-
})[];
|
|
62
|
-
'prefer-const': string;
|
|
63
|
-
'no-case-declarations': string;
|
|
64
|
-
'no-fallthrough': string;
|
|
65
|
-
'keyword-spacing': string;
|
|
66
|
-
'no-else-return': string;
|
|
67
|
-
'no-duplicate-imports': string;
|
|
68
|
-
'max-params': (string | number)[];
|
|
69
|
-
'max-params-no-constructor/max-params-no-constructor': (string | number)[];
|
|
70
|
-
quotes: (string | {
|
|
71
|
-
allowTemplateLiterals: boolean;
|
|
72
|
-
})[];
|
|
73
|
-
'@typescript-eslint/no-unused-vars': string;
|
|
74
|
-
'@typescript-eslint/explicit-function-return-type': (string | {
|
|
75
|
-
allowTypedFunctionExpressions: boolean;
|
|
76
|
-
})[];
|
|
77
|
-
'@typescript-eslint/no-explicit-any': string;
|
|
78
|
-
'@typescript-eslint/typedef': string;
|
|
79
|
-
'@futdevpro/dynamo/import-order': string;
|
|
80
|
-
'@futdevpro/dynamo/naming-patterns': string;
|
|
81
|
-
'@futdevpro/dynamo/no-import-type': string;
|
|
82
|
-
'@futdevpro/dynamo/no-js-import': string;
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
export = config;
|
|
1
|
+
declare const fsmBaseConfig: any;
|
|
86
2
|
//# sourceMappingURL=fsm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fsm.d.ts","sourceRoot":"","sources":["../../src/configs/fsm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fsm.d.ts","sourceRoot":"","sources":["../../src/configs/fsm.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa,KAAoB,CAAC"}
|