@software-hardware-integration-lab/development-utilities 0.0.1 → 3.0.0-beta.7919f94
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/LICENSE +21 -0
- package/README.md +84 -0
- package/bin/config/linter/base.d.ts +2 -0
- package/bin/config/linter/base.js +439 -0
- package/bin/config/linter/next.d.ts +2 -0
- package/bin/config/linter/next.js +19 -0
- package/bin/index.d.ts +2 -0
- package/bin/index.js +2 -0
- package/config/typescript/base.json +48 -0
- package/package.json +63 -11
- package/index.js +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SHI International, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Development Utilities [](https://github.com/Software-Hardware-Integration-Lab/Development-Utilities/actions/workflows/Test-Unit.yml) [](https://github.com/Software-Hardware-Integration-Lab/Development-Utilities/actions/workflows/Test-Lint.yml) [](https://github.com/Software-Hardware-Integration-Lab/Development-Utilities/actions/workflows/github-code-scanning/codeql) [](https://www.npmjs.com/package/@software-hardware-integration-lab/development-utilities)
|
|
2
|
+
|
|
3
|
+
Shared development-time configurations for TypeScript, ESLint (flat config), and Next.js. These utilities are dev-only and should not ship with application runtime artifacts.
|
|
4
|
+
|
|
5
|
+
These configurations are not exhaustive and might require bespoke changes once extended or included in your target repo (based on the configuration used).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install --save-dev @software-hardware-integration-lab/development-utilities
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Note
|
|
14
|
+
|
|
15
|
+
Do not import anything from this package in production/runtime code.
|
|
16
|
+
|
|
17
|
+
## TS Config configuration
|
|
18
|
+
|
|
19
|
+
Since it is not a code but just configuration file, it would require particular handling to use:
|
|
20
|
+
|
|
21
|
+
in tsconfig.json make these changes
|
|
22
|
+
|
|
23
|
+
```jsonc
|
|
24
|
+
{
|
|
25
|
+
"extends": "@software-hardware-integration-lab/development-utilities/config/typescript/base.json",
|
|
26
|
+
"compilerOptions": {
|
|
27
|
+
"outDir": "./bin" // Adjust for your project
|
|
28
|
+
}
|
|
29
|
+
// ... Any other options that need to override base behavior
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Lint configuration
|
|
34
|
+
|
|
35
|
+
This project is using flat file for eslint (best results achieved with version >=9.9.0) and the intention to be compatible with that style only:
|
|
36
|
+
|
|
37
|
+
In `eslint.config.(m)js` make these changes:
|
|
38
|
+
|
|
39
|
+
### Normal (Non-UI)
|
|
40
|
+
|
|
41
|
+
```TypeScript
|
|
42
|
+
import { eslintConfig } from '@software-hardware-integration-lab/development-utilities/optimized/lint/base.js'
|
|
43
|
+
import { defineConfig } from 'eslint/config'
|
|
44
|
+
|
|
45
|
+
export default defineConfig(eslintConfig)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### User Interface (Next.JS)
|
|
49
|
+
|
|
50
|
+
```TypeScript
|
|
51
|
+
import { eslintConfig } from '@software-hardware-integration-lab/development-utilities/optimized/lint/next.js'
|
|
52
|
+
import { defineConfig } from 'eslint/config'
|
|
53
|
+
|
|
54
|
+
export default defineConfig([
|
|
55
|
+
...eslintConfig,
|
|
56
|
+
// Add project-specific rules, ignores, or plugins here
|
|
57
|
+
])
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Next.js configuration
|
|
61
|
+
|
|
62
|
+
in next.config.(m)js make these changes
|
|
63
|
+
|
|
64
|
+
```TypeScript
|
|
65
|
+
import { nextConfig } from '@software-hardware-integration-lab/development-utilities';
|
|
66
|
+
|
|
67
|
+
export default {
|
|
68
|
+
...nextConfig,
|
|
69
|
+
... // any other options that need to override base behavior
|
|
70
|
+
};
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Scope and intent
|
|
74
|
+
|
|
75
|
+
- Dev-only: configurations used for authoring, linting, and building. They should not be bundled into final application artifacts.
|
|
76
|
+
- Centralized defaults: opinionated baselines to standardize behavior across repos.
|
|
77
|
+
- Opt-in overrides: extend and override per project as needed.
|
|
78
|
+
|
|
79
|
+
## Compatibility
|
|
80
|
+
|
|
81
|
+
- Node.JS (Latest LTS)
|
|
82
|
+
- ES Lint >= 10.7
|
|
83
|
+
- TypeScript >= 6.0
|
|
84
|
+
- Vite.JS - Coming soon!
|
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
2
|
+
import eslint from '@eslint/js';
|
|
3
|
+
import jsdoc from 'eslint-plugin-jsdoc';
|
|
4
|
+
import stylistic from '@stylistic/eslint-plugin';
|
|
5
|
+
import tseslint from 'typescript-eslint';
|
|
6
|
+
export const eslintConfig = defineConfig(eslint.configs.recommended, jsdoc.configs['flat/recommended-typescript'], ...tseslint.configs.strictTypeChecked, ...tseslint.configs.stylisticTypeChecked, {
|
|
7
|
+
'languageOptions': { 'parserOptions': { 'projectService': true } },
|
|
8
|
+
'linterOptions': { 'reportUnusedDisableDirectives': true },
|
|
9
|
+
'plugins': {
|
|
10
|
+
jsdoc,
|
|
11
|
+
stylistic
|
|
12
|
+
},
|
|
13
|
+
'rules': {
|
|
14
|
+
'@typescript-eslint/class-methods-use-this': 'warn',
|
|
15
|
+
'@typescript-eslint/consistent-return': 'warn',
|
|
16
|
+
'@typescript-eslint/default-param-last': 'warn',
|
|
17
|
+
'@typescript-eslint/explicit-function-return-type': 'warn',
|
|
18
|
+
'@typescript-eslint/init-declarations': 'warn',
|
|
19
|
+
'@typescript-eslint/no-invalid-this': 'warn',
|
|
20
|
+
'@typescript-eslint/no-loop-func': 'warn',
|
|
21
|
+
'@typescript-eslint/no-misused-promises': [
|
|
22
|
+
'warn',
|
|
23
|
+
{
|
|
24
|
+
'checksVoidReturn': {
|
|
25
|
+
'arguments': false
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
30
|
+
'@typescript-eslint/no-restricted-imports': 'warn',
|
|
31
|
+
'@typescript-eslint/no-shadow': 'warn',
|
|
32
|
+
'@typescript-eslint/no-unused-vars': [
|
|
33
|
+
'warn',
|
|
34
|
+
{
|
|
35
|
+
'argsIgnorePattern': '^_',
|
|
36
|
+
'caughtErrors': 'none'
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
'@typescript-eslint/no-use-before-define': 'warn',
|
|
40
|
+
'@typescript-eslint/prefer-destructuring': 'warn',
|
|
41
|
+
'@typescript-eslint/restrict-template-expressions': [
|
|
42
|
+
'warn',
|
|
43
|
+
{
|
|
44
|
+
'allowNumber': true
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
'accessor-pairs': 'warn',
|
|
48
|
+
'array-callback-return': 'warn',
|
|
49
|
+
'arrow-body-style': 'warn',
|
|
50
|
+
'block-scoped-var': 'warn',
|
|
51
|
+
'camelcase': 'warn',
|
|
52
|
+
'capitalized-comments': 'warn',
|
|
53
|
+
'class-methods-use-this': 'off',
|
|
54
|
+
'consistent-return': 'off',
|
|
55
|
+
'consistent-this': 'warn',
|
|
56
|
+
'curly': 'warn',
|
|
57
|
+
'default-case': 'warn',
|
|
58
|
+
'default-case-last': 'warn',
|
|
59
|
+
'default-param-last': 'off',
|
|
60
|
+
'eqeqeq': 'warn',
|
|
61
|
+
'func-name-matching': 'warn',
|
|
62
|
+
'func-names': 'warn',
|
|
63
|
+
'func-style': [
|
|
64
|
+
'warn',
|
|
65
|
+
'declaration'
|
|
66
|
+
],
|
|
67
|
+
'grouped-accessor-pairs': 'warn',
|
|
68
|
+
'guard-for-in': 'warn',
|
|
69
|
+
'id-denylist': 'warn',
|
|
70
|
+
'id-length': 'warn',
|
|
71
|
+
'id-match': 'warn',
|
|
72
|
+
'init-declarations': 'off',
|
|
73
|
+
'jsdoc/check-indentation': [
|
|
74
|
+
'warn',
|
|
75
|
+
{
|
|
76
|
+
'excludeTags': [
|
|
77
|
+
'example',
|
|
78
|
+
'returns'
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
'jsdoc/informative-docs': 'warn',
|
|
83
|
+
'jsdoc/no-blank-blocks': 'warn',
|
|
84
|
+
'jsdoc/no-multi-asterisks': [
|
|
85
|
+
'warn',
|
|
86
|
+
{
|
|
87
|
+
'allowWhitespace': true
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
'jsdoc/require-asterisk-prefix': 'warn',
|
|
91
|
+
'jsdoc/require-description-complete-sentence': [
|
|
92
|
+
'warn',
|
|
93
|
+
{
|
|
94
|
+
'abbreviations': ['etc.', 'e.g.', 'i.e.']
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
'jsdoc/require-jsdoc': [
|
|
98
|
+
'warn',
|
|
99
|
+
{
|
|
100
|
+
'contexts': [
|
|
101
|
+
'ClassBody > PropertyDefinition',
|
|
102
|
+
'VariableDeclaration:not(:has(VariableDeclarator[id.type=\"ArrayPattern\"])):not(:has(VariableDeclarator[id.type=\"ObjectPattern\"])):not(ExportNamedDeclaration > VariableDeclaration):not(ForOfStatement > VariableDeclaration):not(ForInStatement > VariableDeclaration):not(ForStatement > VariableDeclaration)',
|
|
103
|
+
'TSInterfaceDeclaration',
|
|
104
|
+
'TSPropertySignature',
|
|
105
|
+
'TSMethodSignature',
|
|
106
|
+
'TSTypeAliasDeclaration'
|
|
107
|
+
],
|
|
108
|
+
'enableFixer': false,
|
|
109
|
+
'require': {
|
|
110
|
+
'ArrowFunctionExpression': true,
|
|
111
|
+
'ClassDeclaration': true,
|
|
112
|
+
'ClassExpression': true,
|
|
113
|
+
'FunctionDeclaration': true,
|
|
114
|
+
'FunctionExpression': true,
|
|
115
|
+
'MethodDefinition': true
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
'max-classes-per-file': 'warn',
|
|
120
|
+
'max-depth': [
|
|
121
|
+
'warn',
|
|
122
|
+
7
|
|
123
|
+
],
|
|
124
|
+
'max-nested-callbacks': 'warn',
|
|
125
|
+
'new-cap': 'warn',
|
|
126
|
+
'no-alert': 'warn',
|
|
127
|
+
'no-bitwise': 'warn',
|
|
128
|
+
'no-caller': 'warn',
|
|
129
|
+
'no-console': 'warn',
|
|
130
|
+
'no-constructor-return': 'warn',
|
|
131
|
+
'no-continue': 'warn',
|
|
132
|
+
'no-div-regex': 'warn',
|
|
133
|
+
'no-duplicate-imports': 'warn',
|
|
134
|
+
'no-else-return': 'warn',
|
|
135
|
+
'no-eq-null': 'warn',
|
|
136
|
+
'no-eval': 'warn',
|
|
137
|
+
'no-extend-native': 'warn',
|
|
138
|
+
'no-extra-bind': 'warn',
|
|
139
|
+
'no-extra-label': 'warn',
|
|
140
|
+
'no-implicit-coercion': 'warn',
|
|
141
|
+
'no-implicit-globals': 'warn',
|
|
142
|
+
'no-invalid-this': 'off',
|
|
143
|
+
'no-iterator': 'warn',
|
|
144
|
+
'no-label-var': 'warn',
|
|
145
|
+
'no-labels': [
|
|
146
|
+
'warn',
|
|
147
|
+
{
|
|
148
|
+
'allowLoop': true
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
'no-lone-blocks': 'warn',
|
|
152
|
+
'no-lonely-if': 'warn',
|
|
153
|
+
'no-loop-func': 'off',
|
|
154
|
+
'no-multi-assign': 'warn',
|
|
155
|
+
'no-multi-str': 'warn',
|
|
156
|
+
'no-nested-ternary': 'warn',
|
|
157
|
+
'no-new': 'warn',
|
|
158
|
+
'no-new-func': 'warn',
|
|
159
|
+
'no-new-wrappers': 'warn',
|
|
160
|
+
'no-object-constructor': 'warn',
|
|
161
|
+
'no-octal-escape': 'warn',
|
|
162
|
+
'no-param-reassign': 'warn',
|
|
163
|
+
'no-plusplus': [
|
|
164
|
+
'warn',
|
|
165
|
+
{
|
|
166
|
+
'allowForLoopAfterthoughts': true
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
'no-promise-executor-return': 'warn',
|
|
170
|
+
'no-proto': 'warn',
|
|
171
|
+
'no-restricted-exports': 'warn',
|
|
172
|
+
'no-restricted-globals': 'warn',
|
|
173
|
+
'no-restricted-imports': 'off',
|
|
174
|
+
'no-restricted-properties': 'warn',
|
|
175
|
+
'no-restricted-syntax': 'warn',
|
|
176
|
+
'no-return-assign': 'warn',
|
|
177
|
+
'no-script-url': 'warn',
|
|
178
|
+
'no-self-compare': 'warn',
|
|
179
|
+
'no-sequences': 'warn',
|
|
180
|
+
'no-shadow': 'off',
|
|
181
|
+
'no-template-curly-in-string': 'warn',
|
|
182
|
+
'no-undef-init': 'warn',
|
|
183
|
+
'no-undefined': 'warn',
|
|
184
|
+
'no-underscore-dangle': 'warn',
|
|
185
|
+
'no-unmodified-loop-condition': 'warn',
|
|
186
|
+
'no-unneeded-ternary': 'warn',
|
|
187
|
+
'no-unreachable-loop': 'warn',
|
|
188
|
+
'no-unused-vars': 'off',
|
|
189
|
+
'no-use-before-define': 'off',
|
|
190
|
+
'no-useless-call': 'warn',
|
|
191
|
+
'no-useless-computed-key': 'warn',
|
|
192
|
+
'no-useless-concat': 'warn',
|
|
193
|
+
'no-useless-rename': 'warn',
|
|
194
|
+
'no-useless-return': 'warn',
|
|
195
|
+
'no-warning-comments': [
|
|
196
|
+
'warn',
|
|
197
|
+
{
|
|
198
|
+
'terms': [
|
|
199
|
+
'fixme',
|
|
200
|
+
'xxx'
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
'object-shorthand': 'warn',
|
|
205
|
+
'one-var': [
|
|
206
|
+
'warn',
|
|
207
|
+
'never'
|
|
208
|
+
],
|
|
209
|
+
'operator-assignment': 'warn',
|
|
210
|
+
'prefer-arrow-callback': 'warn',
|
|
211
|
+
'prefer-destructuring': 'off',
|
|
212
|
+
'prefer-exponentiation-operator': 'warn',
|
|
213
|
+
'prefer-named-capture-group': 'warn',
|
|
214
|
+
'prefer-numeric-literals': 'warn',
|
|
215
|
+
'prefer-object-spread': 'warn',
|
|
216
|
+
'prefer-regex-literals': 'warn',
|
|
217
|
+
'prefer-template': 'warn',
|
|
218
|
+
'radix': 'warn',
|
|
219
|
+
'require-atomic-updates': 'warn',
|
|
220
|
+
'require-unicode-regexp': 'warn',
|
|
221
|
+
'sort-imports': 'warn',
|
|
222
|
+
'sort-keys': 'warn',
|
|
223
|
+
'sort-vars': 'warn',
|
|
224
|
+
'strict': 'warn',
|
|
225
|
+
'stylistic/array-bracket-newline': 'warn',
|
|
226
|
+
'stylistic/array-bracket-spacing': 'warn',
|
|
227
|
+
'stylistic/array-element-newline': [
|
|
228
|
+
'warn',
|
|
229
|
+
'consistent'
|
|
230
|
+
],
|
|
231
|
+
'stylistic/arrow-parens': 'warn',
|
|
232
|
+
'stylistic/arrow-spacing': 'warn',
|
|
233
|
+
'stylistic/block-spacing': 'warn',
|
|
234
|
+
'stylistic/brace-style': [
|
|
235
|
+
'warn',
|
|
236
|
+
'1tbs',
|
|
237
|
+
{
|
|
238
|
+
'allowSingleLine': true
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
'stylistic/comma-dangle': 'warn',
|
|
242
|
+
'stylistic/comma-spacing': 'warn',
|
|
243
|
+
'stylistic/comma-style': 'warn',
|
|
244
|
+
'stylistic/computed-property-spacing': 'warn',
|
|
245
|
+
'stylistic/dot-location': [
|
|
246
|
+
'warn',
|
|
247
|
+
'property'
|
|
248
|
+
],
|
|
249
|
+
'stylistic/eol-last': 'warn',
|
|
250
|
+
'stylistic/function-call-argument-newline': [
|
|
251
|
+
'warn',
|
|
252
|
+
'consistent'
|
|
253
|
+
],
|
|
254
|
+
'stylistic/function-call-spacing': 'warn',
|
|
255
|
+
'stylistic/function-paren-newline': 'warn',
|
|
256
|
+
'stylistic/generator-star-spacing': 'warn',
|
|
257
|
+
'stylistic/implicit-arrow-linebreak': 'warn',
|
|
258
|
+
'stylistic/indent': [
|
|
259
|
+
'warn',
|
|
260
|
+
4
|
|
261
|
+
],
|
|
262
|
+
'stylistic/jsx-quotes': 'warn',
|
|
263
|
+
'stylistic/key-spacing': 'warn',
|
|
264
|
+
'stylistic/keyword-spacing': 'warn',
|
|
265
|
+
'stylistic/lines-around-comment': [
|
|
266
|
+
'warn',
|
|
267
|
+
{
|
|
268
|
+
'allowBlockStart': true,
|
|
269
|
+
'allowClassStart': true,
|
|
270
|
+
'allowEnumStart': true,
|
|
271
|
+
'allowInterfaceStart': true,
|
|
272
|
+
'allowModuleStart': true,
|
|
273
|
+
'allowObjectStart': true,
|
|
274
|
+
'allowTypeStart': true,
|
|
275
|
+
'beforeBlockComment': true,
|
|
276
|
+
'beforeLineComment': true
|
|
277
|
+
}
|
|
278
|
+
],
|
|
279
|
+
'stylistic/lines-between-class-members': [
|
|
280
|
+
'warn',
|
|
281
|
+
'always',
|
|
282
|
+
{
|
|
283
|
+
'exceptAfterSingleLine': true
|
|
284
|
+
}
|
|
285
|
+
],
|
|
286
|
+
'stylistic/multiline-comment-style': 'warn',
|
|
287
|
+
'stylistic/multiline-ternary': [
|
|
288
|
+
'warn',
|
|
289
|
+
'always-multiline'
|
|
290
|
+
],
|
|
291
|
+
'stylistic/new-parens': 'warn',
|
|
292
|
+
'stylistic/newline-per-chained-call': 'warn',
|
|
293
|
+
'stylistic/no-confusing-arrow': 'warn',
|
|
294
|
+
'stylistic/no-extra-parens': [
|
|
295
|
+
'warn',
|
|
296
|
+
'all',
|
|
297
|
+
{
|
|
298
|
+
'nestedBinaryExpressions': false
|
|
299
|
+
}
|
|
300
|
+
],
|
|
301
|
+
'stylistic/no-extra-semi': 'warn',
|
|
302
|
+
'stylistic/no-floating-decimal': 'warn',
|
|
303
|
+
'stylistic/no-mixed-operators': 'warn',
|
|
304
|
+
'stylistic/no-mixed-spaces-and-tabs': 'warn',
|
|
305
|
+
'stylistic/no-multi-spaces': 'warn',
|
|
306
|
+
'stylistic/no-multiple-empty-lines': [
|
|
307
|
+
'warn',
|
|
308
|
+
{
|
|
309
|
+
'max': 1,
|
|
310
|
+
'maxBOF': 0,
|
|
311
|
+
'maxEOF': 1
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
'stylistic/no-tabs': 'warn',
|
|
315
|
+
'stylistic/no-trailing-spaces': 'warn',
|
|
316
|
+
'stylistic/no-whitespace-before-property': 'warn',
|
|
317
|
+
'stylistic/nonblock-statement-body-position': 'warn',
|
|
318
|
+
'stylistic/object-curly-newline': 'warn',
|
|
319
|
+
'stylistic/object-curly-spacing': [
|
|
320
|
+
'warn',
|
|
321
|
+
'always'
|
|
322
|
+
],
|
|
323
|
+
'stylistic/object-property-newline': 'warn',
|
|
324
|
+
'stylistic/one-var-declaration-per-line': 'warn',
|
|
325
|
+
'stylistic/operator-linebreak': 'warn',
|
|
326
|
+
'stylistic/padded-blocks': [
|
|
327
|
+
'warn',
|
|
328
|
+
'never'
|
|
329
|
+
],
|
|
330
|
+
'stylistic/padding-line-between-statements': [
|
|
331
|
+
'warn',
|
|
332
|
+
{
|
|
333
|
+
'blankLine': 'any',
|
|
334
|
+
'next': [
|
|
335
|
+
'const',
|
|
336
|
+
'let',
|
|
337
|
+
'var'
|
|
338
|
+
],
|
|
339
|
+
'prev': [
|
|
340
|
+
'const',
|
|
341
|
+
'let',
|
|
342
|
+
'var'
|
|
343
|
+
]
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
'blankLine': 'always',
|
|
347
|
+
'next': 'iife',
|
|
348
|
+
'prev': 'iife'
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
'blankLine': 'never',
|
|
352
|
+
'next': 'import',
|
|
353
|
+
'prev': 'import'
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
'blankLine': 'always',
|
|
357
|
+
'next': [
|
|
358
|
+
'block-like',
|
|
359
|
+
'break',
|
|
360
|
+
'class',
|
|
361
|
+
'const',
|
|
362
|
+
'do',
|
|
363
|
+
'expression',
|
|
364
|
+
'export',
|
|
365
|
+
'for',
|
|
366
|
+
'function',
|
|
367
|
+
'if',
|
|
368
|
+
'let',
|
|
369
|
+
'return',
|
|
370
|
+
'switch',
|
|
371
|
+
'throw',
|
|
372
|
+
'try',
|
|
373
|
+
'var',
|
|
374
|
+
'while',
|
|
375
|
+
'with'
|
|
376
|
+
],
|
|
377
|
+
'prev': '*'
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
'blankLine': 'never',
|
|
381
|
+
'next': [
|
|
382
|
+
'case',
|
|
383
|
+
'default'
|
|
384
|
+
],
|
|
385
|
+
'prev': '*'
|
|
386
|
+
}
|
|
387
|
+
],
|
|
388
|
+
'stylistic/quote-props': 'warn',
|
|
389
|
+
'stylistic/quotes': [
|
|
390
|
+
'warn',
|
|
391
|
+
'single'
|
|
392
|
+
],
|
|
393
|
+
'stylistic/rest-spread-spacing': 'warn',
|
|
394
|
+
'stylistic/semi': 'warn',
|
|
395
|
+
'stylistic/semi-spacing': 'warn',
|
|
396
|
+
'stylistic/semi-style': 'warn',
|
|
397
|
+
'stylistic/space-before-blocks': 'warn',
|
|
398
|
+
'stylistic/space-before-function-paren': [
|
|
399
|
+
'warn',
|
|
400
|
+
{
|
|
401
|
+
'anonymous': 'always',
|
|
402
|
+
'asyncArrow': 'always',
|
|
403
|
+
'named': 'never'
|
|
404
|
+
}
|
|
405
|
+
],
|
|
406
|
+
'stylistic/space-in-parens': 'warn',
|
|
407
|
+
'stylistic/space-infix-ops': 'warn',
|
|
408
|
+
'stylistic/space-unary-ops': 'warn',
|
|
409
|
+
'stylistic/spaced-comment': 'warn',
|
|
410
|
+
'stylistic/switch-colon-spacing': 'warn',
|
|
411
|
+
'stylistic/template-curly-spacing': [
|
|
412
|
+
'warn',
|
|
413
|
+
'always'
|
|
414
|
+
],
|
|
415
|
+
'stylistic/template-tag-spacing': 'warn',
|
|
416
|
+
'stylistic/wrap-iife': 'warn',
|
|
417
|
+
'stylistic/wrap-regex': 'warn',
|
|
418
|
+
'stylistic/yield-star-spacing': 'warn',
|
|
419
|
+
'symbol-description': 'warn',
|
|
420
|
+
'unicode-bom': 'warn',
|
|
421
|
+
'vars-on-top': 'warn',
|
|
422
|
+
'yoda': 'warn'
|
|
423
|
+
}
|
|
424
|
+
}, {
|
|
425
|
+
'rules': {
|
|
426
|
+
'stylistic/lines-around-comment': 'off'
|
|
427
|
+
},
|
|
428
|
+
'settings': {
|
|
429
|
+
'stylistic': {
|
|
430
|
+
'contexts': ['TSInterfaceDeclaration']
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}, globalIgnores([
|
|
434
|
+
'node_modules/',
|
|
435
|
+
'eslint.config.mjs',
|
|
436
|
+
'eslint.config.js',
|
|
437
|
+
'bin/',
|
|
438
|
+
'dist/'
|
|
439
|
+
]));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
2
|
+
import { eslintConfig as baselineConfig } from './base.js';
|
|
3
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
4
|
+
export const eslintConfig = defineConfig([
|
|
5
|
+
...baselineConfig,
|
|
6
|
+
{
|
|
7
|
+
'settings': { 'react': { 'version': 'detect' } }
|
|
8
|
+
},
|
|
9
|
+
reactHooks.configs.flat.recommended,
|
|
10
|
+
globalIgnores([
|
|
11
|
+
'next.config.mjs',
|
|
12
|
+
'next.config.js',
|
|
13
|
+
'next-env.d.ts',
|
|
14
|
+
'.next/**',
|
|
15
|
+
'out/**',
|
|
16
|
+
'build/**',
|
|
17
|
+
'jest.config.mjs'
|
|
18
|
+
])
|
|
19
|
+
]);
|
package/bin/index.d.ts
ADDED
package/bin/index.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
4
|
+
/* Projects */
|
|
5
|
+
// "incremental": true, /* It is highly encouraged to enable this for the projects extending this config. */
|
|
6
|
+
/* Language and Environment */
|
|
7
|
+
"target": "ES2024",
|
|
8
|
+
/* Modules */
|
|
9
|
+
"module": "node20",
|
|
10
|
+
"moduleResolution": "node16",
|
|
11
|
+
"noUncheckedSideEffectImports": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
/* JavaScript Support */
|
|
14
|
+
"allowJs": false,
|
|
15
|
+
"checkJs": false,
|
|
16
|
+
/* Emit */
|
|
17
|
+
"sourceMap": true,
|
|
18
|
+
// "outDir": "./bin", /* Specify an output folder for all emitted files. Would be different for each project and has to be defined after extending this config. */
|
|
19
|
+
"removeComments": true,
|
|
20
|
+
/* Interop Constraints */
|
|
21
|
+
"isolatedModules": true,
|
|
22
|
+
"verbatimModuleSyntax": true,
|
|
23
|
+
"esModuleInterop": true,
|
|
24
|
+
"forceConsistentCasingInFileNames": true,
|
|
25
|
+
/* Type Checking */
|
|
26
|
+
"strict": true,
|
|
27
|
+
"allowUnreachableCode": false,
|
|
28
|
+
"allowUnusedLabels": false,
|
|
29
|
+
"noImplicitAny": true,
|
|
30
|
+
"strictNullChecks": true,
|
|
31
|
+
"strictFunctionTypes": true,
|
|
32
|
+
"strictBindCallApply": true,
|
|
33
|
+
"strictPropertyInitialization": true,
|
|
34
|
+
"strictBuiltinIteratorReturn": true,
|
|
35
|
+
"noImplicitThis": true,
|
|
36
|
+
"useUnknownInCatchVariables": true,
|
|
37
|
+
"alwaysStrict": true,
|
|
38
|
+
"noUnusedLocals": true,
|
|
39
|
+
"noUnusedParameters": true,
|
|
40
|
+
"noImplicitReturns": true,
|
|
41
|
+
"noFallthroughCasesInSwitch": true,
|
|
42
|
+
"noImplicitOverride": true,
|
|
43
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
44
|
+
"noUncheckedIndexedAccess": true,
|
|
45
|
+
/* Completeness */
|
|
46
|
+
"skipLibCheck": true
|
|
47
|
+
}
|
|
48
|
+
}
|
package/package.json
CHANGED
|
@@ -1,20 +1,72 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@software-hardware-integration-lab/development-utilities",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
3
|
+
"version": "3.0.0-beta.7919f94",
|
|
4
|
+
"description": "Collection of configurations, settings and packages to be common across multiple products/repositories.",
|
|
5
|
+
"main": "bin/index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build:Dev": "tsc",
|
|
9
|
+
"prebuild:Prod": "tsc -p prod.tsconfig.json --emitDeclarationOnly false",
|
|
10
|
+
"build:Prod": "tsc -p prod.tsconfig.json --removeComments false",
|
|
11
|
+
"lint": "eslint --max-warnings 0",
|
|
12
|
+
"test:Unit": "node --experimental-test-module-mocks --test bin/test/unit/**/*.test.js",
|
|
13
|
+
"test:Integration": "node --test bin/test/integration/**/*.test.js"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": "./bin/src/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./optimized/lint/*.js": {
|
|
20
|
+
"import": "./bin/config/linter/*.js"
|
|
21
|
+
},
|
|
22
|
+
"./config/typescript/*.json": "./config/typescript/*.json"
|
|
23
|
+
},
|
|
24
|
+
"packageManager": "npm@12.0.1",
|
|
25
|
+
"devEngines": {
|
|
26
|
+
"runtime": {
|
|
27
|
+
"name": "node",
|
|
28
|
+
"version": ">=24.18.0",
|
|
29
|
+
"onFail": "error"
|
|
30
|
+
},
|
|
31
|
+
"packageManager": {
|
|
32
|
+
"name": "npm",
|
|
33
|
+
"onFail": "error"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=24.15.0"
|
|
8
38
|
},
|
|
9
39
|
"repository": {
|
|
10
40
|
"type": "git",
|
|
11
|
-
"url": "
|
|
41
|
+
"url": "https://github.com/Software-Hardware-Integration-Lab/Development-Utilities"
|
|
12
42
|
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"ESLint",
|
|
45
|
+
"config",
|
|
46
|
+
"lint",
|
|
47
|
+
"standardization",
|
|
48
|
+
"JSDoc",
|
|
49
|
+
"Stylistic",
|
|
50
|
+
"TypeScript",
|
|
51
|
+
"tsconfig"
|
|
52
|
+
],
|
|
53
|
+
"author": "Pasha Zayko <pasha_zayko@shi.com>",
|
|
13
54
|
"license": "MIT",
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
55
|
+
"bugs": {
|
|
56
|
+
"url": "https://github.com/Software-Hardware-Integration-Lab/Development-Utilities/issues"
|
|
57
|
+
},
|
|
58
|
+
"homepage": "https://github.com/Software-Hardware-Integration-Lab/Development-Utilities#readme",
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@eslint/js": "~10.0.1",
|
|
61
|
+
"@stylistic/eslint-plugin": "~5.10.0",
|
|
62
|
+
"eslint": "~10.7.0",
|
|
63
|
+
"eslint-plugin-jsdoc": "~63.0.13",
|
|
64
|
+
"eslint-plugin-react-hooks": "~7.1.1",
|
|
65
|
+
"typescript-eslint": "~8.63.0"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@types/eslint": "~9.6.1",
|
|
69
|
+
"@types/node": "~26.1.1",
|
|
70
|
+
"typescript": "~6.0.3"
|
|
19
71
|
}
|
|
20
72
|
}
|
package/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
console.log('Hello world!')
|