@futdevpro/dynamo-eslint 1.12.1 → 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.
Files changed (117) hide show
  1. package/.github/workflows/main.yml +1 -2
  2. package/README.md +286 -17
  3. package/build/configs/base.d.ts +9 -80
  4. package/build/configs/base.d.ts.map +1 -1
  5. package/build/configs/base.js +89 -49
  6. package/build/configs/base.js.map +1 -1
  7. package/build/configs/fsm.d.ts +1 -81
  8. package/build/configs/fsm.d.ts.map +1 -1
  9. package/build/configs/fsm.js +7 -6
  10. package/build/configs/fsm.js.map +1 -1
  11. package/build/configs/ngx-package.d.ts +1 -80
  12. package/build/configs/ngx-package.d.ts.map +1 -1
  13. package/build/configs/ngx-package.js +7 -6
  14. package/build/configs/ngx-package.js.map +1 -1
  15. package/build/configs/ngx.d.ts +4 -80
  16. package/build/configs/ngx.d.ts.map +1 -1
  17. package/build/configs/ngx.js +71 -11
  18. package/build/configs/ngx.js.map +1 -1
  19. package/build/configs/nts-package.d.ts +1 -82
  20. package/build/configs/nts-package.d.ts.map +1 -1
  21. package/build/configs/nts-package.js +16 -10
  22. package/build/configs/nts-package.js.map +1 -1
  23. package/build/configs/nts.d.ts +1 -81
  24. package/build/configs/nts.d.ts.map +1 -1
  25. package/build/configs/nts.js +30 -11
  26. package/build/configs/nts.js.map +1 -1
  27. package/build/plugin/index.d.ts +4 -0
  28. package/build/plugin/index.d.ts.map +1 -1
  29. package/build/plugin/index.js +7 -1
  30. package/build/plugin/index.js.map +1 -1
  31. package/build/plugin/rules/import/import-order.d.ts +4 -0
  32. package/build/plugin/rules/import/import-order.d.ts.map +1 -0
  33. package/build/plugin/rules/{import-order.js → import/import-order.js} +16 -17
  34. package/build/plugin/rules/import/import-order.js.map +1 -0
  35. package/build/plugin/rules/import/import-order.spec.d.ts.map +1 -0
  36. package/build/plugin/rules/{import-order.spec.js → import/import-order.spec.js} +40 -40
  37. package/build/plugin/rules/import/import-order.spec.js.map +1 -0
  38. package/build/plugin/rules/import/no-import-type.d.ts +4 -0
  39. package/build/plugin/rules/import/no-import-type.d.ts.map +1 -0
  40. package/build/plugin/rules/import/no-import-type.js +35 -0
  41. package/build/plugin/rules/import/no-import-type.js.map +1 -0
  42. package/build/plugin/rules/import/no-import-type.spec.d.ts +2 -0
  43. package/build/plugin/rules/import/no-import-type.spec.d.ts.map +1 -0
  44. package/build/plugin/rules/import/no-import-type.spec.js +60 -0
  45. package/build/plugin/rules/import/no-import-type.spec.js.map +1 -0
  46. package/build/plugin/rules/import/no-js-import.d.ts +4 -0
  47. package/build/plugin/rules/import/no-js-import.d.ts.map +1 -0
  48. package/build/plugin/rules/import/no-js-import.js +33 -0
  49. package/build/plugin/rules/import/no-js-import.js.map +1 -0
  50. package/build/plugin/rules/import/no-js-import.spec.d.ts +2 -0
  51. package/build/plugin/rules/import/no-js-import.spec.d.ts.map +1 -0
  52. package/build/plugin/rules/import/no-js-import.spec.js +68 -0
  53. package/build/plugin/rules/import/no-js-import.spec.js.map +1 -0
  54. package/build/plugin/rules/naming-patterns.d.ts +1 -1
  55. package/build/plugin/rules/naming-patterns.d.ts.map +1 -1
  56. package/build/plugin/rules/naming-patterns.spec.js +1 -1
  57. package/build/plugin/rules/naming-patterns.spec.js.map +1 -1
  58. package/build/scripts/dynamo-fix.d.ts +3 -0
  59. package/build/scripts/dynamo-fix.d.ts.map +1 -0
  60. package/build/scripts/dynamo-fix.js +92 -0
  61. package/build/scripts/dynamo-fix.js.map +1 -0
  62. package/build/scripts/eslintrc-audit.js.map +1 -1
  63. package/build/scripts/fix-return-types.d.ts +3 -0
  64. package/build/scripts/fix-return-types.d.ts.map +1 -0
  65. package/build/scripts/fix-return-types.js +109 -0
  66. package/build/scripts/fix-return-types.js.map +1 -0
  67. package/build/scripts/validate-imports.js +10 -9
  68. package/build/scripts/validate-imports.js.map +1 -1
  69. package/build/scripts/validate-naming.js +11 -26
  70. package/build/scripts/validate-naming.js.map +1 -1
  71. package/build-test/plugin/rules/import-order.d.ts +1 -1
  72. package/build-test/plugin/rules/naming-patterns.d.ts +1 -1
  73. package/eslint.config.js +55 -0
  74. package/futdevpro-dynamo-eslint-01.14.3.tgz +0 -0
  75. package/package.json +27 -18
  76. package/samples/.vscode/settings.json +13 -0
  77. package/samples/base/eslint.config.js +3 -0
  78. package/samples/fsm/.eslintrc.json +4 -0
  79. package/samples/fsm/eslint.config.js +3 -0
  80. package/samples/ngx/eslint.config.js +3 -0
  81. package/samples/ngx-package/.eslintrc.json +4 -0
  82. package/samples/ngx-package/eslint.config.js +3 -0
  83. package/samples/nts/eslint.config.js +3 -0
  84. package/samples/nts-package/.eslintrc.json +4 -0
  85. package/samples/nts-package/eslint.config.js +3 -0
  86. package/samples/package.json.example +26 -0
  87. package/samples/poc-violations.ts +32 -3
  88. package/src/configs/base.ts +93 -48
  89. package/src/configs/fsm.ts +8 -7
  90. package/src/configs/ngx-package.ts +8 -7
  91. package/src/configs/ngx.ts +71 -11
  92. package/src/configs/nts-package.ts +16 -10
  93. package/src/configs/nts.ts +30 -11
  94. package/src/plugin/index.ts +9 -1
  95. package/src/plugin/rules/{import-order.spec.ts → import/import-order.spec.ts} +46 -40
  96. package/src/plugin/rules/{import-order.ts → import/import-order.ts} +20 -18
  97. package/src/plugin/rules/import/no-import-type.spec.ts +69 -0
  98. package/src/plugin/rules/import/no-import-type.ts +37 -0
  99. package/src/plugin/rules/import/no-js-import.spec.ts +82 -0
  100. package/src/plugin/rules/import/no-js-import.ts +35 -0
  101. package/src/plugin/rules/naming-patterns.spec.ts +3 -1
  102. package/src/plugin/rules/naming-patterns.ts +1 -1
  103. package/src/scripts/dynamo-fix.ts +108 -0
  104. package/src/scripts/eslintrc-audit.ts +6 -2
  105. package/src/scripts/fix-return-types.ts +148 -0
  106. package/src/scripts/validate-imports.ts +95 -13
  107. package/src/scripts/validate-naming.ts +16 -28
  108. package/.eslintrc.json +0 -16
  109. package/INTEGRATION.md +0 -74
  110. package/POC-README.md +0 -147
  111. package/build/plugin/rules/import-order.d.ts +0 -4
  112. package/build/plugin/rules/import-order.d.ts.map +0 -1
  113. package/build/plugin/rules/import-order.js.map +0 -1
  114. package/build/plugin/rules/import-order.spec.d.ts.map +0 -1
  115. package/build/plugin/rules/import-order.spec.js.map +0 -1
  116. package/futdevpro-dynamo-eslint-01.12.01.tgz +0 -0
  117. /package/build/plugin/rules/{import-order.spec.d.ts → import/import-order.spec.d.ts} +0 -0
@@ -230,8 +230,7 @@ jobs:
230
230
  name: 🚀 Deploy to NPM
231
231
  runs-on: ubuntu-latest
232
232
  timeout-minutes: 20
233
- # if: ${{ needs.check_version.outputs.version_published != 'true' }}
234
- if: always()
233
+ if: ${{ needs.check_version.outputs.version_published != 'true' }}
235
234
  steps:
236
235
  - name: Checkout code
237
236
  uses: actions/checkout@v2
package/README.md CHANGED
@@ -1,36 +1,305 @@
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
160
+ ## 🔧 Custom Dynamo Rules
161
+
162
+ This package includes custom ESLint rules for Dynamo conventions:
163
+
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
171
+
172
+ ## 🛠️ CLI Validation Tools
173
+
174
+ Use these commands to validate your codebase:
175
+
176
+ ```bash
177
+ # Validate import ordering across all TypeScript files
178
+ dynamo-validate-imports
179
+
180
+ # Validate naming conventions across all TypeScript files
181
+ dynamo-validate-naming
182
+
183
+ # Audit ESLint configurations for duplicate rules
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
191
+ ```
192
+
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:
257
+
258
+ ```bash
259
+ npm ls @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint
260
+ ```
261
+
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
295
+
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
33
300
 
34
- ## Audit
301
+ ---
35
302
 
36
- Run `dynamo-eslintrc-audit` in a workspace to analyze duplicated rules.
303
+ **Maintained by**: Future Development Program Ltd.
304
+ **License**: ISC
305
+ **Version**: 02.00.0
@@ -1,81 +1,10 @@
1
- declare const _default: {
2
- env: {
3
- browser: boolean;
4
- es2021: boolean;
5
- };
6
- parser: string;
7
- parserOptions: {
8
- ecmaVersion: string;
9
- };
10
- plugins: string[];
11
- extends: string[];
12
- rules: {
13
- 'no-warning-comments': (string | {
14
- terms: string[];
15
- location: string;
16
- })[];
17
- indent: (string | number | {
18
- SwitchCase: number;
19
- })[];
20
- 'max-len': (string | {
21
- code: number;
22
- comments: number;
23
- })[];
24
- 'max-lines': (string | number)[];
25
- 'linebreak-style': string;
26
- semi: string[];
27
- 'no-unused-vars': string;
28
- 'no-prototype-builtins': string;
29
- 'no-empty': string;
30
- 'comma-dangle': (string | {
31
- arrays: string;
32
- objects: string;
33
- functions: string;
34
- imports: string;
35
- exports: string;
36
- })[];
37
- 'brace-style': (string | {
38
- allowSingleLine: boolean;
39
- })[];
40
- 'object-curly-spacing': string[];
41
- 'array-bracket-spacing': (string | {
42
- objectsInArrays: boolean;
43
- arraysInArrays: boolean;
44
- })[];
45
- 'padding-line-between-statements': (string | {
46
- blankLine: string;
47
- prev: string;
48
- next: string[];
49
- } | {
50
- blankLine: string;
51
- prev: string[];
52
- next: string;
53
- } | {
54
- blankLine: string;
55
- prev: string[];
56
- next: string[];
57
- })[];
58
- 'prefer-const': string;
59
- 'no-case-declarations': string;
60
- 'no-fallthrough': string;
61
- 'keyword-spacing': string;
62
- 'no-else-return': string;
63
- 'no-duplicate-imports': string;
64
- 'max-params': (string | number)[];
65
- 'max-params-no-constructor/max-params-no-constructor': (string | number)[];
66
- quotes: (string | {
67
- allowTemplateLiterals: boolean;
68
- })[];
69
- '@typescript-eslint/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
- };
79
- };
80
- export = _default;
1
+ /**
2
+ * Base Rulesets For Dynamo Based Systems
3
+ * ESLint v9 Flat Config Format
4
+ */
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;
81
10
  //# sourceMappingURL=base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAgDE"}
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,51 +1,91 @@
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
- ],
11
- extends: [
12
- 'eslint:recommended',
13
- 'plugin:@typescript-eslint/recommended',
14
- ],
15
- rules: {
16
- 'no-warning-comments': ['warn', { terms: ['todo', 'fixme', 'removable', '??'], location: 'anywhere' }],
17
- indent: ['warn', 2, { SwitchCase: 1 }],
18
- 'max-len': ['warn', { code: 100, comments: 120 }],
19
- 'max-lines': ['warn', 1000],
20
- 'linebreak-style': 'off',
21
- semi: ['warn', 'always'],
22
- 'no-unused-vars': 'off',
23
- 'no-prototype-builtins': 'off',
24
- 'no-empty': 'warn',
25
- 'comma-dangle': ['warn', { arrays: 'always-multiline', objects: 'always-multiline', functions: 'only-multiline', imports: 'never', exports: 'never' }],
26
- 'brace-style': ['warn', '1tbs', { allowSingleLine: false }],
27
- 'object-curly-spacing': ['warn', 'always'],
28
- 'array-bracket-spacing': ['warn', 'always', { objectsInArrays: false, arraysInArrays: false }],
29
- 'padding-line-between-statements': [
30
- 'warn',
31
- { blankLine: 'always', prev: '*', next: ['return', 'throw', 'if', 'for', 'while', 'switch', 'default'] },
32
- { blankLine: 'always', prev: ['const', 'let', 'var', 'break'], next: '*' },
33
- { blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
34
- ],
35
- 'prefer-const': 'warn',
36
- 'no-case-declarations': 'off',
37
- 'no-fallthrough': 'off',
38
- 'keyword-spacing': 'warn',
39
- 'no-else-return': 'warn',
40
- 'no-duplicate-imports': 'warn',
41
- 'max-params': ['warn', 4],
42
- 'max-params-no-constructor/max-params-no-constructor': ['warn', 5],
43
- quotes: ['warn', 'single', { allowTemplateLiterals: true }],
44
- '@typescript-eslint/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',
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
+ ]
49
18
  },
50
- };
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
+ ];
51
91
  //# sourceMappingURL=base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":";AAAA,iBAAS;IACP,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IACpC,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE;IACxC,OAAO,EAAE;QACP,oBAAoB;QACpB,gBAAgB;QAChB,2BAA2B;KAC5B;IACD,OAAO,EAAE;QACP,oBAAoB;QACpB,uCAAuC;KACxC;IACD,KAAK,EAAE;QACL,qBAA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ClE,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC;YAE7D,mBAAmB;YACnB,mCAAmC,EAAE,MAAM;YAC3C,kDAAkD,EAAE,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"}
@@ -1,82 +1,2 @@
1
- declare const config: {
2
- env: {
3
- node: boolean;
4
- es2021: boolean;
5
- };
6
- parserOptions: {
7
- sourceType: string;
8
- ecmaVersion: string;
9
- };
10
- rules: {
11
- 'max-lines': (string | number)[];
12
- 'no-warning-comments': (string | {
13
- terms: string[];
14
- location: string;
15
- })[];
16
- indent: (string | number | {
17
- SwitchCase: number;
18
- })[];
19
- 'max-len': (string | {
20
- code: number;
21
- comments: number;
22
- })[];
23
- 'linebreak-style': string;
24
- semi: string[];
25
- 'no-unused-vars': string;
26
- 'no-prototype-builtins': string;
27
- 'no-empty': string;
28
- 'comma-dangle': (string | {
29
- arrays: string;
30
- objects: string;
31
- functions: string;
32
- imports: string;
33
- exports: string;
34
- })[];
35
- 'brace-style': (string | {
36
- allowSingleLine: boolean;
37
- })[];
38
- 'object-curly-spacing': string[];
39
- 'array-bracket-spacing': (string | {
40
- objectsInArrays: boolean;
41
- arraysInArrays: boolean;
42
- })[];
43
- 'padding-line-between-statements': (string | {
44
- blankLine: string;
45
- prev: string;
46
- next: string[];
47
- } | {
48
- blankLine: string;
49
- prev: string[];
50
- next: string;
51
- } | {
52
- blankLine: string;
53
- prev: string[];
54
- next: string[];
55
- })[];
56
- 'prefer-const': string;
57
- 'no-case-declarations': string;
58
- 'no-fallthrough': string;
59
- 'keyword-spacing': string;
60
- 'no-else-return': string;
61
- 'no-duplicate-imports': string;
62
- 'max-params': (string | number)[];
63
- 'max-params-no-constructor/max-params-no-constructor': (string | number)[];
64
- quotes: (string | {
65
- allowTemplateLiterals: boolean;
66
- })[];
67
- '@typescript-eslint/quotes': (string | {
68
- allowTemplateLiterals: boolean;
69
- })[];
70
- '@typescript-eslint/no-unused-vars': string;
71
- '@typescript-eslint/explicit-function-return-type': (string | {
72
- allowTypedFunctionExpressions: boolean;
73
- })[];
74
- '@typescript-eslint/no-explicit-any': string;
75
- '@typescript-eslint/typedef': string;
76
- };
77
- parser: string;
78
- plugins: string[];
79
- extends: string[];
80
- };
81
- export = config;
1
+ declare const fsmBaseConfig: any;
82
2
  //# sourceMappingURL=fsm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fsm.d.ts","sourceRoot":"","sources":["../../src/configs/fsm.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEX,CAAC;AAEF,SAAS,MAAM,CAAC"}
1
+ {"version":3,"file":"fsm.d.ts","sourceRoot":"","sources":["../../src/configs/fsm.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa,KAAoB,CAAC"}