Skip to content

Commit 19fcb86

Browse files
committed
chore: update dev and test environments
Signed-off-by: Lexus Drumgold <[email protected]>
1 parent bb8d48a commit 19fcb86

File tree

24 files changed

+4735
-1388
lines changed

24 files changed

+4735
-1388
lines changed

.eslintrc.base.cjs

Lines changed: 49 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const config = {
5353
},
5454
plugins: [
5555
'@typescript-eslint',
56+
'import',
5657
'jsdoc',
5758
'node',
5859
'prettier',
@@ -171,7 +172,6 @@ const config = {
171172
}
172173
],
173174
'@typescript-eslint/no-dupe-class-members': 2,
174-
'@typescript-eslint/no-duplicate-imports': 2,
175175
'@typescript-eslint/no-dynamic-delete': 2,
176176
'@typescript-eslint/no-empty-function': [
177177
2,
@@ -352,7 +352,11 @@ const config = {
352352
2,
353353
{
354354
allowAny: false,
355-
checkCompoundAssignments: false
355+
allowBoolean: false,
356+
allowNullish: false,
357+
allowNumberAndString: true,
358+
allowRegExp: false,
359+
skipCompoundAssignments: true
356360
}
357361
],
358362
'@typescript-eslint/restrict-template-expressions': [
@@ -366,7 +370,7 @@ const config = {
366370
}
367371
],
368372
'@typescript-eslint/return-await': [2, 'in-try-catch'],
369-
'@typescript-eslint/sort-type-union-intersection-members': 2,
373+
'@typescript-eslint/sort-type-constituents': 2,
370374
'@typescript-eslint/strict-boolean-expressions': [
371375
2,
372376
{
@@ -394,6 +398,13 @@ const config = {
394398
'@typescript-eslint/unified-signatures': 2,
395399
'default-param-last': 0,
396400
eqeqeq: 1,
401+
'import/no-duplicates': [
402+
2,
403+
{
404+
considerQueryString: true,
405+
'prefer-inline': true
406+
}
407+
],
397408
'init-declarations': 0,
398409
'jsdoc/check-access': 1,
399410
'jsdoc/check-alignment': 1,
@@ -417,6 +428,7 @@ const config = {
417428
1,
418429
{
419430
definedTags: [
431+
'decorator',
420432
'experimental',
421433
'maximum',
422434
'minimum',
@@ -434,7 +446,6 @@ const config = {
434446
'jsdoc/match-description': 0,
435447
'jsdoc/match-name': 0,
436448
'jsdoc/multiline-blocks': 1,
437-
'jsdoc/newline-after-description': [1, 'always'],
438449
'jsdoc/no-bad-blocks': [1, { preventAllMultiAsteriskBlocks: true }],
439450
'jsdoc/no-defaults': 0,
440451
'jsdoc/no-missing-syntax': 0,
@@ -557,9 +568,10 @@ const config = {
557568
1,
558569
'any',
559570
{
571+
applyToEndTag: true,
560572
count: 1,
561-
dropEndLines: true,
562-
noEndLines: false,
573+
endLines: 0,
574+
startLines: 1,
563575
tags: {}
564576
}
565577
],
@@ -572,6 +584,7 @@ const config = {
572584
'no-empty-function': 0,
573585
'no-ex-assign': 0,
574586
'no-extra-parens': 0,
587+
'no-extra-semi': 0,
575588
'no-implied-eval': 0,
576589
'no-invalid-this': 0,
577590
'no-loop-func': 0,
@@ -661,7 +674,7 @@ const config = {
661674
terms: ['@fixme', '@todo']
662675
}
663676
],
664-
'unicorn/explicit-length-check': 2,
677+
'unicorn/explicit-length-check': 0,
665678
'unicorn/filename-case': [
666679
2,
667680
{
@@ -774,15 +787,8 @@ const config = {
774787
allowArgumentsExplicitlyTypedAsAny: true,
775788
allowDirectConstAssertionInArrowFunctions: true,
776789
allowHigherOrderFunctions: false,
777-
allowTypedFunctionExpressions: true,
778-
allowedNames: [],
779-
shouldTrackReferences: true
780-
}
781-
],
782-
'@typescript-eslint/no-implicit-any-catch': [
783-
2,
784-
{
785-
allowExplicitAny: false
790+
allowTypedFunctionExpressions: false,
791+
allowedNames: []
786792
}
787793
],
788794
'no-undef': 0
@@ -835,6 +841,7 @@ const config = {
835841
},
836842
plugins: ['chai-expect', 'jest-formatting'],
837843
rules: {
844+
'@typescript-eslint/class-literal-property-style': 0,
838845
'@typescript-eslint/consistent-indexed-object-style': 0,
839846
'@typescript-eslint/no-base-to-string': 0,
840847
'@typescript-eslint/no-empty-function': 0,
@@ -858,7 +865,6 @@ const config = {
858865
'promise/valid-params': 0,
859866
'unicorn/consistent-destructuring': 0,
860867
'unicorn/error-message': 0,
861-
'unicorn/explicit-length-check': 0,
862868
'unicorn/no-array-for-each': 0,
863869
'unicorn/no-hex-escape': 0,
864870
'unicorn/no-useless-undefined': 0,
@@ -878,6 +884,12 @@ const config = {
878884
'@typescript-eslint/no-redundant-type-constituents': 0
879885
}
880886
},
887+
{
888+
files: ['**/decorators/*.constraint.ts', '**/*.decorator.ts'],
889+
rules: {
890+
'@typescript-eslint/ban-types': 0
891+
}
892+
},
881893
{
882894
files: ['**/enums/*.ts', '**/interfaces/*.ts', '**/types/*.ts'],
883895
rules: {
@@ -990,6 +1002,7 @@ const config = {
9901002
'@typescript-eslint/naming-convention': 0,
9911003
'@typescript-eslint/no-base-to-string': 0,
9921004
'@typescript-eslint/no-confusing-void-expression': 0,
1005+
'@typescript-eslint/no-duplicate-type-constituents': 0,
9931006
'@typescript-eslint/no-floating-promises': 0,
9941007
'@typescript-eslint/no-for-in-array': 0,
9951008
'@typescript-eslint/no-implied-eval': 0,
@@ -1006,12 +1019,14 @@ const config = {
10061019
'@typescript-eslint/no-unsafe-argument': 0,
10071020
'@typescript-eslint/no-unsafe-assignment': 0,
10081021
'@typescript-eslint/no-unsafe-call': 0,
1022+
'@typescript-eslint/no-unsafe-enum-comparison': 0,
10091023
'@typescript-eslint/no-unsafe-member-access': 0,
10101024
'@typescript-eslint/no-unsafe-return': 0,
10111025
'@typescript-eslint/no-unused-expressions': 0,
10121026
'@typescript-eslint/non-nullable-type-assertion-style': 0,
10131027
'@typescript-eslint/prefer-includes': 0,
10141028
'@typescript-eslint/prefer-nullish-coalescing': 0,
1029+
'@typescript-eslint/prefer-optional-chain': 0,
10151030
'@typescript-eslint/prefer-readonly': 0,
10161031
'@typescript-eslint/prefer-readonly-parameter-types': 0,
10171032
'@typescript-eslint/prefer-reduce-type-parameter': 0,
@@ -1032,7 +1047,7 @@ const config = {
10321047
}
10331048
},
10341049
{
1035-
files: '**/*.yml',
1050+
files: '**/*.+(yaml|yml)',
10361051
parser: 'yaml-eslint-parser',
10371052
plugins: ['yml'],
10381053
rules: {
@@ -1151,20 +1166,35 @@ const config = {
11511166
'prettier/prettier': [2, {}, { usePrettierrc: true }]
11521167
},
11531168
settings: {
1169+
'import/parsers': {
1170+
'@typescript-eslint/parser': ['.cts', '.mts', '.ts', '.tsx']
1171+
},
1172+
'import/resolver': {
1173+
node: true,
1174+
typescript: true
1175+
},
11541176
jsdoc: {
11551177
augmentsExtendsReplacesDocs: true,
11561178
ignoreInternal: false,
11571179
ignorePrivate: false,
11581180
implementsReplacesDocs: true,
11591181
overrideReplacesDocs: true,
11601182
preferredTypes: {
1161-
'*': false
1183+
'*': false,
1184+
'.<>': false,
1185+
'Array<>': { replacement: '[]' },
1186+
Object: { replacement: 'object' },
1187+
'Object<>': { replacement: 'Record<>' },
1188+
object: 'object'
11621189
},
11631190
structuredTags: {
11641191
const: {
11651192
name: 'namepath-defining',
11661193
required: ['name']
11671194
},
1195+
decorator: {
1196+
name: 'none'
1197+
},
11681198
enum: {
11691199
name: 'namepath-defining',
11701200
required: ['name', 'type']

.github/infrastructure.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ branches:
4040
- context: test (18)
4141
- context: test (19)
4242
- context: typescript (5.0.4)
43+
- context: typescript (5.1.6)
4344
- context: typescript (latest)
44-
- context: typescript (~4.9.0)
4545
strict: true
4646
restrictions: null
4747
# https://docs.github.com/rest/deployments/environments#create-or-update-an-environment
@@ -190,8 +190,6 @@ repository:
190190
is_template: false
191191
private: false
192192
security_and_analysis:
193-
advanced_security:
194-
status: disabled
195193
secret_scanning:
196194
status: enabled
197195
secret_scanning_push_protection:

.github/workflows/ci.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ jobs:
236236
typescript-version:
237237
- ${{ needs.preflight.outputs.version-typescript }}
238238
- latest
239-
- ~4.9.0
239+
- 5.0.4
240240
steps:
241241
- id: checkout
242242
name: Checkout ${{ env.REF_NAME }}
@@ -268,14 +268,10 @@ jobs:
268268
if: steps.test-files-check.outputs.files_exists == 'true'
269269
name: Install typescript@${{ matrix.typescript-version }}
270270
run: yarn add -D typescript@${{ matrix.typescript-version }}
271-
- id: set-typescript-version
272-
name: Set env.TYPESCRIPT_VERSION
273-
run: |
274-
echo "TYPESCRIPT_VERSION=$(jq .devDependencies.typescript package.json -r)" >>$GITHUB_ENV
275271
- id: print-typescript-version
276272
if: steps.test-files-check.outputs.files_exists == 'true'
277273
name: Print TypeScript version
278-
run: echo $TYPESCRIPT_VERSION
274+
run: jq .devDependencies.typescript package.json -r
279275
- id: typecheck
280276
if: steps.test-files-check.outputs.files_exists == 'true'
281277
name: Run typecheck

.github/workflows/typescript-canary.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ name: typescript-canary
2121
on:
2222
schedule:
2323
# every day, 3 hours after typescript@next release
24-
# https://github.com/microsoft/TypeScript/blob/v4.9.5/.github/workflows/nightly.yaml
24+
# https://github.com/microsoft/TypeScript/blob/v5.0.4/.github/workflows/nightly.yaml
2525
- cron: 0 10 * * *
2626
workflow_dispatch:
2727
permissions:
@@ -65,13 +65,9 @@ jobs:
6565
- id: typescript
6666
name: Install typescript@${{ matrix.typescript-version }}
6767
run: yarn add -D typescript@${{ matrix.typescript-version }}
68-
- id: set-typescript-version
69-
name: Set env.TYPESCRIPT_VERSION
70-
run: |
71-
echo "TYPESCRIPT_VERSION=$(jq .devDependencies.typescript package.json -r)" >>$GITHUB_ENV
7268
- id: print-typescript-version
7369
name: Print TypeScript version
74-
run: echo $TYPESCRIPT_VERSION
70+
run: jq .devDependencies.typescript package.json -r
7571
- id: build
7672
name: Build project
7773
run: yarn build

.prettierrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"arrowParens": "avoid",
33
"bracketSpacing": true,
4+
"plugins": ["prettier-plugin-sh"],
45
"proseWrap": "always",
56
"quoteProps": "as-needed",
67
"semi": false,

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@
256256
"shellformat.flag": "-ci -fn -i=2 -sr",
257257
"shellformat.useEditorConfig": true,
258258
"terminal.integrated.copyOnSelection": true,
259+
"terminal.integrated.scrollback": 10000,
259260
"todo-tree.filtering.ignoreGitSubmodules": true,
260261
"todo-tree.filtering.includeHiddenFiles": false,
261262
"todo-tree.filtering.useBuiltInExcludes": "file and search excludes",

__tests__/interfaces/mock.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @file Test Environment Interfaces - Spy
3-
* @module tests/interfaces/Spy
2+
* @file Test Environment Interfaces - Mock
3+
* @module tests/interfaces/Mock
44
*/
55

66
import type { Fn } from '@flex-development/tutils'
@@ -11,9 +11,11 @@ import type * as vitest from 'vitest'
1111
*
1212
* @template F - Function being mocked
1313
*
14+
* @extends {Fn<Parameters<F>,ReturnType<F>>}
1415
* @extends {vitest.Mock<Parameters<F>,ReturnType<F>>}
1516
*/
1617
interface Mock<F extends Fn = Fn>
17-
extends vitest.Mock<Parameters<F>, ReturnType<F>> {}
18+
extends Fn<Parameters<F>, ReturnType<F>>,
19+
vitest.Mock<Parameters<F>, ReturnType<F>> {}
1820

1921
export type { Mock as default }

__tests__/interfaces/spy.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ import type * as vitest from 'vitest'
1111
*
1212
* @template F - Function being spied on
1313
*
14+
* @extends {Fn<Parameters<F>,ReturnType<F>>}
1415
* @extends {vitest.SpyInstance<Parameters<F>,ReturnType<F>>}
1516
*/
1617
interface Spy<F extends Fn = Fn>
17-
extends vitest.SpyInstance<Parameters<F>, ReturnType<F>> {}
18+
extends Fn<Parameters<F>, ReturnType<F>>,
19+
vitest.SpyInstance<Parameters<F>, ReturnType<F>> {}
1820

1921
export type { Spy as default }

0 commit comments

Comments
 (0)