@futdevpro/dynamo-eslint 1.14.2 → 1.14.4

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.
Files changed (100) hide show
  1. package/.eslintrc.json +4 -0
  2. package/.vscode/settings.json +13 -0
  3. package/README.md +279 -29
  4. package/build/configs/base.d.ts +6 -81
  5. package/build/configs/base.d.ts.map +1 -1
  6. package/build/configs/base.js +90 -54
  7. package/build/configs/base.js.map +1 -1
  8. package/build/configs/fsm.d.ts +1 -85
  9. package/build/configs/fsm.d.ts.map +1 -1
  10. package/build/configs/fsm.js +3 -6
  11. package/build/configs/fsm.js.map +1 -1
  12. package/build/configs/ngx-package.d.ts +1 -85
  13. package/build/configs/ngx-package.d.ts.map +1 -1
  14. package/build/configs/ngx-package.js +3 -6
  15. package/build/configs/ngx-package.js.map +1 -1
  16. package/build/configs/ngx.d.ts +4 -85
  17. package/build/configs/ngx.d.ts.map +1 -1
  18. package/build/configs/ngx.js +67 -11
  19. package/build/configs/ngx.js.map +1 -1
  20. package/build/configs/nts-package.d.ts +1 -87
  21. package/build/configs/nts-package.d.ts.map +1 -1
  22. package/build/configs/nts-package.js +12 -10
  23. package/build/configs/nts-package.js.map +1 -1
  24. package/build/configs/nts.d.ts +1 -86
  25. package/build/configs/nts.d.ts.map +1 -1
  26. package/build/configs/nts.js +26 -11
  27. package/build/configs/nts.js.map +1 -1
  28. package/build/plugin/index.d.ts +2 -0
  29. package/build/plugin/index.d.ts.map +1 -1
  30. package/build/plugin/index.js +3 -0
  31. package/build/plugin/index.js.map +1 -1
  32. package/build/plugin/rules/explicit-types.d.ts +4 -0
  33. package/build/plugin/rules/explicit-types.d.ts.map +1 -0
  34. package/build/plugin/rules/explicit-types.js +165 -0
  35. package/build/plugin/rules/explicit-types.js.map +1 -0
  36. package/build/plugin/rules/explicit-types.spec.d.ts +2 -0
  37. package/build/plugin/rules/explicit-types.spec.d.ts.map +1 -0
  38. package/build/plugin/rules/explicit-types.spec.js +162 -0
  39. package/build/plugin/rules/explicit-types.spec.js.map +1 -0
  40. package/build/plugin/rules/import/no-import-type.d.ts.map +1 -1
  41. package/build/plugin/rules/import/no-import-type.js +23 -12
  42. package/build/plugin/rules/import/no-import-type.js.map +1 -1
  43. package/build/plugin/rules/import/no-js-import.d.ts.map +1 -1
  44. package/build/plugin/rules/import/no-js-import.js +22 -11
  45. package/build/plugin/rules/import/no-js-import.js.map +1 -1
  46. package/build/plugin/rules/naming-patterns.d.ts.map +1 -1
  47. package/build/plugin/rules/naming-patterns.js +7 -2
  48. package/build/plugin/rules/naming-patterns.js.map +1 -1
  49. package/build/scripts/dynamo-fix.d.ts +24 -0
  50. package/build/scripts/dynamo-fix.d.ts.map +1 -1
  51. package/build/scripts/dynamo-fix.js +57 -2
  52. package/build/scripts/dynamo-fix.js.map +1 -1
  53. package/build/scripts/eslintrc-audit.d.ts +24 -0
  54. package/build/scripts/eslintrc-audit.d.ts.map +1 -1
  55. package/build/scripts/eslintrc-audit.js +65 -0
  56. package/build/scripts/eslintrc-audit.js.map +1 -1
  57. package/build/scripts/fix-return-types.d.ts +25 -0
  58. package/build/scripts/fix-return-types.d.ts.map +1 -1
  59. package/build/scripts/fix-return-types.js +80 -9
  60. package/build/scripts/fix-return-types.js.map +1 -1
  61. package/build/scripts/validate-imports.d.ts +24 -0
  62. package/build/scripts/validate-imports.d.ts.map +1 -1
  63. package/build/scripts/validate-imports.js +62 -1
  64. package/build/scripts/validate-imports.js.map +1 -1
  65. package/build/scripts/validate-naming.d.ts +24 -0
  66. package/build/scripts/validate-naming.d.ts.map +1 -1
  67. package/build/scripts/validate-naming.js +72 -9
  68. package/build/scripts/validate-naming.js.map +1 -1
  69. package/eslint.config.js +9 -49
  70. package/futdevpro-dynamo-eslint-01.14.4.tgz +0 -0
  71. package/package.json +1 -1
  72. package/samples/.vscode/settings.json +13 -0
  73. package/samples/base/eslint.config.js +3 -0
  74. package/samples/fsm/.eslintrc.json +4 -0
  75. package/samples/fsm/eslint.config.js +3 -0
  76. package/samples/ngx/eslint.config.js +3 -0
  77. package/samples/ngx-package/.eslintrc.json +4 -0
  78. package/samples/ngx-package/eslint.config.js +3 -0
  79. package/samples/nts/eslint.config.js +3 -0
  80. package/samples/nts-package/.eslintrc.json +4 -0
  81. package/samples/nts-package/eslint.config.js +3 -0
  82. package/samples/package.json.example +26 -0
  83. package/src/configs/base.ts +90 -54
  84. package/src/configs/fsm.ts +3 -6
  85. package/src/configs/ngx-package.ts +3 -6
  86. package/src/configs/ngx.ts +67 -11
  87. package/src/configs/nts-package.ts +12 -10
  88. package/src/configs/nts.ts +26 -11
  89. package/src/plugin/index.ts +3 -0
  90. package/src/plugin/rules/explicit-types.spec.ts +190 -0
  91. package/src/plugin/rules/explicit-types.ts +169 -0
  92. package/src/plugin/rules/import/no-import-type.ts +21 -12
  93. package/src/plugin/rules/import/no-js-import.ts +21 -13
  94. package/src/plugin/rules/naming-patterns.ts +6 -2
  95. package/src/scripts/dynamo-fix.ts +66 -2
  96. package/src/scripts/eslintrc-audit.ts +73 -2
  97. package/src/scripts/fix-return-types.ts +93 -9
  98. package/src/scripts/validate-imports.ts +71 -2
  99. package/src/scripts/validate-naming.ts +108 -17
  100. package/futdevpro-dynamo-eslint-01.14.2.tgz +0 -0
package/.eslintrc.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": ["./build/configs/nts-package"]
3
+ }
4
+
@@ -0,0 +1,13 @@
1
+ {
2
+ "eslint.run": "onSave",
3
+ "eslint.workingDirectories": [{ "mode": "auto" }],
4
+ "eslint.enable": true,
5
+ "eslint.debug": true,
6
+ "editor.codeActionsOnSave": {
7
+ "source.fixAll.eslint": "explicit"
8
+ },
9
+ "eslint.validate": [
10
+ "javascript",
11
+ "typescript"
12
+ ]
13
+ }
package/README.md CHANGED
@@ -1,46 +1,180 @@
1
1
  # @futdevpro/dynamo-eslint
2
2
 
3
- Shared ESLint presets and Dynamo validators for Node TS and Angular.
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
- ## Usage
5
+ ## 🚀 Quick Start
6
6
 
7
- - Install peers then extend one preset:
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
- "root": true,
12
- "extends": ["@futdevpro/dynamo-eslint/nts"]
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
- - VSCode settings for current-file on save:
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": [{ "mode": "auto" }],
22
- "editor.codeActionsOnSave": { "source.fixAll.eslint": true }
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
- ## Presets
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
- - `@futdevpro/dynamo/import-order` - Enforces import ordering and forbids certain patterns
39
- - `@futdevpro/dynamo/naming-patterns` - Enforces naming conventions using DyFM patterns
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 Scripts
172
+ ### Type Rules
173
+ - **`@futdevpro/dynamo/explicit-types`**: Enforces explicit type annotations on all TypeScript declarations (functions, variables, parameters, class properties, destructuring)
42
174
 
43
- Use the provided CLI tools to validate your codebase:
175
+ ## 🛠️ CLI Validation Tools
176
+
177
+ Use these commands to validate your codebase:
44
178
 
45
179
  ```bash
46
180
  # Validate import ordering across all TypeScript files
@@ -51,20 +185,136 @@ dynamo-validate-naming
51
185
 
52
186
  # Audit ESLint configurations for duplicate rules
53
187
  dynamo-eslintrc-audit
188
+
189
+ # Run comprehensive fixes
190
+ dynamo-fix
191
+
192
+ # Fix missing type annotations (functions, variables, parameters, class properties)
193
+ dynamo-fix-return-types
54
194
  ```
55
195
 
56
- Or use npm scripts if this package is installed locally:
196
+ ### NPM Scripts Integration
197
+
198
+ Add to your `package.json`:
199
+
200
+ ```json
201
+ {
202
+ "scripts": {
203
+ "lint": "eslint src --ext .ts",
204
+ "lint:fix": "eslint src --ext .ts --fix",
205
+ "validate:imports": "dynamo-validate-imports",
206
+ "validate:naming": "dynamo-validate-naming",
207
+ "audit:eslintrc": "dynamo-eslintrc-audit",
208
+ "fix": "dynamo-fix",
209
+ "fix:types": "dynamo-fix-return-types"
210
+ }
211
+ }
212
+ ```
213
+
214
+ ## 🔄 Migration from Manual Configs
215
+
216
+ ### Quick Migration Checklist
217
+
218
+ 1. **Install the package and peer dependencies**
219
+ 2. **Replace your `.eslintrc.json`** with the appropriate preset
220
+ 3. **Configure lint-on-save** in VSCode/Cursor settings
221
+ 4. **Run validation tools** to check for issues
222
+ 5. **Update CI/CD** to use the new configuration
223
+
224
+ ### Common Migration Issues
225
+
226
+ - **Peer dependency conflicts**: Ensure all peer dependencies are installed
227
+ - **Working directory issues**: Use `"eslint.workingDirectories": [{ "mode": "auto" }]`
228
+ - **Rule conflicts**: The presets handle most conflicts automatically
229
+
230
+ > 📖 **Detailed Migration Guide**: See [Migration Guide](./docs/migration.md) for step-by-step instructions.
231
+
232
+ ## 🐛 Troubleshooting
233
+
234
+ ### Lint-on-Save Not Working
235
+
236
+ 1. **Check ESLint is running on save only:**
237
+ ```json
238
+ {
239
+ "eslint.run": "onSave" // NOT "onType"
240
+ }
241
+ ```
242
+
243
+ 2. **Verify working directories:**
244
+ ```json
245
+ {
246
+ "eslint.workingDirectories": [{ "mode": "auto" }]
247
+ }
248
+ ```
249
+
250
+ 3. **Check file associations:**
251
+ ```json
252
+ {
253
+ "eslint.validate": ["javascript", "typescript"]
254
+ }
255
+ ```
256
+
257
+ ### Peer Dependency Issues
258
+
259
+ Ensure all peer dependencies are installed with compatible versions:
57
260
 
58
261
  ```bash
59
- npm run validate:imports
60
- npm run validate:naming
61
- npm run audit:eslintrc
262
+ npm ls @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint
263
+ ```
264
+
265
+ ### ESLint v9 Flat Config
266
+
267
+ 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.
268
+
269
+ ## 📁 Examples
270
+
271
+ Reference implementations are available in the `samples/` directory:
272
+
273
+ - `samples/base/eslint.config.js` - Base preset example
274
+ - `samples/nts/eslint.config.js` - Node TypeScript example
275
+ - `samples/ngx/eslint.config.js` - Angular example
276
+ - `samples/fsm/eslint.config.js` - Full Stack Module example
277
+ - `samples/nts-package/eslint.config.js` - Node TypeScript Package example
278
+ - `samples/ngx-package/eslint.config.js` - Angular Package example
279
+
280
+ ## 🔧 Recent Fixes
281
+
282
+ ### TypeScript AST Transformation Context Fix
283
+
284
+ 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:
285
+
286
+ ```typescript
287
+ // Fixed implementation
288
+ return ts.visitEachChild(node, visit, {} as ts.TransformationContext);
62
289
  ```
63
290
 
64
- ## Self-Linting
291
+ This ensures compatibility with TypeScript's AST transformation APIs.
292
+
293
+ ### Enhanced Type Annotation Fixing
294
+
295
+ The `dynamo-fix-return-types` script now handles comprehensive type annotation fixing:
296
+
297
+ - **Function declarations**: Adds return type annotations
298
+ - **Arrow functions**: Adds return type annotations
299
+ - **Variable declarations**: Adds type annotations based on initializer types
300
+ - **Function parameters**: Adds parameter type annotations
301
+ - **Class properties**: Adds property type annotations
302
+
303
+ The script uses TypeScript's type checker to infer appropriate types and automatically adds them to your code.
304
+
305
+ ## 📚 Self-Linting
306
+
307
+ 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.
308
+
309
+ ## 🏗️ Architecture
65
310
 
66
- This package uses its own presets and rules for self-linting. The ESLint v9 flat config is in `eslint.config.js`.
311
+ - **Presets**: Standardized rule configurations for different project types
312
+ - **Custom Rules**: Dynamo-specific linting rules for import order and naming
313
+ - **CLI Tools**: Validation and fixing utilities
314
+ - **TypeScript Integration**: Full TypeScript AST transformation support
67
315
 
68
- ## Audit
316
+ ---
69
317
 
70
- Run `dynamo-eslintrc-audit` in a workspace to analyze duplicated rules.
318
+ **Maintained by**: Future Development Program Ltd.
319
+ **License**: ISC
320
+ **Version**: 02.00.0
@@ -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 _default: {
5
- env: {
6
- browser: boolean;
7
- es2021: boolean;
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;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,kBAsDE"}
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"}
@@ -1,56 +1,92 @@
1
- "use strict";
2
- module.exports = {
3
- env: { browser: true, es2021: true },
4
- parser: '@typescript-eslint/parser',
5
- parserOptions: { ecmaVersion: 'latest' },
6
- plugins: [
7
- '@typescript-eslint',
8
- 'unused-imports',
9
- 'max-params-no-constructor',
10
- '@futdevpro/dynamo',
11
- ],
12
- extends: [
13
- 'eslint:recommended',
14
- 'plugin:@typescript-eslint/recommended',
15
- ],
16
- rules: {
17
- 'no-warning-comments': ['warn', { terms: ['todo', 'fixme', 'removable', '??'], location: 'anywhere' }],
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: 120, 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/explicit-types': 'warn',
85
+ '@futdevpro/dynamo/import-order': 'warn',
86
+ '@futdevpro/dynamo/naming-patterns': 'warn',
87
+ '@futdevpro/dynamo/no-import-type': 'warn',
88
+ '@futdevpro/dynamo/no-js-import': 'warn',
89
+ },
90
+ },
91
+ ];
56
92
  //# sourceMappingURL=base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":";AAIA,iBAAS;IACP,GAA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