Skip to content

Commit 4cda056

Browse files
committed
chore: update dev environment
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent c2e040c commit 4cda056

File tree

5 files changed

+1226
-656
lines changed

5 files changed

+1226
-656
lines changed

.eslintrc.base.cjs

+63-27
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,
@@ -180,7 +180,13 @@ const config = {
180180
}
181181
],
182182
'@typescript-eslint/no-empty-interface': 0,
183-
'@typescript-eslint/no-explicit-any': 0,
183+
'@typescript-eslint/no-explicit-any': [
184+
2,
185+
{
186+
fixToUnknown: true,
187+
ignoreRestArgs: true
188+
}
189+
],
184190
'@typescript-eslint/no-extra-non-null-assertion': 2,
185191
'@typescript-eslint/no-extra-parens': 0,
186192
'@typescript-eslint/no-extra-semi': 0,
@@ -352,7 +358,11 @@ const config = {
352358
2,
353359
{
354360
allowAny: false,
355-
checkCompoundAssignments: false
361+
allowBoolean: false,
362+
allowNullish: false,
363+
allowNumberAndString: true,
364+
allowRegExp: false,
365+
skipCompoundAssignments: true
356366
}
357367
],
358368
'@typescript-eslint/restrict-template-expressions': [
@@ -366,7 +376,7 @@ const config = {
366376
}
367377
],
368378
'@typescript-eslint/return-await': [2, 'in-try-catch'],
369-
'@typescript-eslint/sort-type-union-intersection-members': 2,
379+
'@typescript-eslint/sort-type-constituents': 2,
370380
'@typescript-eslint/strict-boolean-expressions': [
371381
2,
372382
{
@@ -394,6 +404,13 @@ const config = {
394404
'@typescript-eslint/unified-signatures': 2,
395405
'default-param-last': 0,
396406
eqeqeq: 1,
407+
'import/no-duplicates': [
408+
2,
409+
{
410+
considerQueryString: true,
411+
'prefer-inline': true
412+
}
413+
],
397414
'init-declarations': 0,
398415
'jsdoc/check-access': 1,
399416
'jsdoc/check-alignment': 1,
@@ -417,6 +434,7 @@ const config = {
417434
1,
418435
{
419436
definedTags: [
437+
'decorator',
420438
'experimental',
421439
'maximum',
422440
'minimum',
@@ -434,7 +452,6 @@ const config = {
434452
'jsdoc/match-description': 0,
435453
'jsdoc/match-name': 0,
436454
'jsdoc/multiline-blocks': 1,
437-
'jsdoc/newline-after-description': [1, 'always'],
438455
'jsdoc/no-bad-blocks': [1, { preventAllMultiAsteriskBlocks: true }],
439456
'jsdoc/no-defaults': 0,
440457
'jsdoc/no-missing-syntax': 0,
@@ -557,9 +574,10 @@ const config = {
557574
1,
558575
'any',
559576
{
577+
applyToEndTag: true,
560578
count: 1,
561-
dropEndLines: true,
562-
noEndLines: false,
579+
endLines: 0,
580+
startLines: 1,
563581
tags: {}
564582
}
565583
],
@@ -572,6 +590,7 @@ const config = {
572590
'no-empty-function': 0,
573591
'no-ex-assign': 0,
574592
'no-extra-parens': 0,
593+
'no-extra-semi': 0,
575594
'no-implied-eval': 0,
576595
'no-invalid-this': 0,
577596
'no-loop-func': 0,
@@ -652,15 +671,15 @@ const config = {
652671
'unicorn/empty-brace-spaces': 2,
653672
'unicorn/error-message': 2,
654673
'unicorn/escape-case': 2,
655-
'unicorn/expiring-todo-comments': [
656-
2,
657-
{
658-
allowWarningComments: true,
659-
ignore: [],
660-
ignoreDatesOnPullRequests: true,
661-
terms: ['@fixme', '@todo']
662-
}
663-
],
674+
// 'unicorn/expiring-todo-comments': [
675+
// 2,
676+
// {
677+
// allowWarningComments: true,
678+
// ignore: [],
679+
// ignoreDatesOnPullRequests: true,
680+
// terms: ['@fixme', '@todo']
681+
// }
682+
// ],
664683
'unicorn/explicit-length-check': 0,
665684
'unicorn/filename-case': [
666685
2,
@@ -774,15 +793,8 @@ const config = {
774793
allowArgumentsExplicitlyTypedAsAny: true,
775794
allowDirectConstAssertionInArrowFunctions: true,
776795
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
796+
allowTypedFunctionExpressions: false,
797+
allowedNames: []
786798
}
787799
],
788800
'no-undef': 0
@@ -878,6 +890,12 @@ const config = {
878890
'@typescript-eslint/no-redundant-type-constituents': 0
879891
}
880892
},
893+
{
894+
files: ['**/decorators/*.constraint.ts', '**/*.decorator.ts'],
895+
rules: {
896+
'@typescript-eslint/ban-types': 0
897+
}
898+
},
881899
{
882900
files: ['**/enums/*.ts', '**/interfaces/*.ts', '**/types/*.ts'],
883901
rules: {
@@ -990,6 +1008,7 @@ const config = {
9901008
'@typescript-eslint/naming-convention': 0,
9911009
'@typescript-eslint/no-base-to-string': 0,
9921010
'@typescript-eslint/no-confusing-void-expression': 0,
1011+
'@typescript-eslint/no-duplicate-type-constituents': 0,
9931012
'@typescript-eslint/no-floating-promises': 0,
9941013
'@typescript-eslint/no-for-in-array': 0,
9951014
'@typescript-eslint/no-implied-eval': 0,
@@ -1006,12 +1025,14 @@ const config = {
10061025
'@typescript-eslint/no-unsafe-argument': 0,
10071026
'@typescript-eslint/no-unsafe-assignment': 0,
10081027
'@typescript-eslint/no-unsafe-call': 0,
1028+
'@typescript-eslint/no-unsafe-enum-comparison': 0,
10091029
'@typescript-eslint/no-unsafe-member-access': 0,
10101030
'@typescript-eslint/no-unsafe-return': 0,
10111031
'@typescript-eslint/no-unused-expressions': 0,
10121032
'@typescript-eslint/non-nullable-type-assertion-style': 0,
10131033
'@typescript-eslint/prefer-includes': 0,
10141034
'@typescript-eslint/prefer-nullish-coalescing': 0,
1035+
'@typescript-eslint/prefer-optional-chain': 0,
10151036
'@typescript-eslint/prefer-readonly': 0,
10161037
'@typescript-eslint/prefer-readonly-parameter-types': 0,
10171038
'@typescript-eslint/prefer-reduce-type-parameter': 0,
@@ -1032,7 +1053,7 @@ const config = {
10321053
}
10331054
},
10341055
{
1035-
files: '**/*.yml',
1056+
files: '**/*.+(yaml|yml)',
10361057
parser: 'yaml-eslint-parser',
10371058
plugins: ['yml'],
10381059
rules: {
@@ -1151,20 +1172,35 @@ const config = {
11511172
'prettier/prettier': [2, {}, { usePrettierrc: true }]
11521173
},
11531174
settings: {
1175+
'import/parsers': {
1176+
'@typescript-eslint/parser': ['.cts', '.mts', '.ts', '.tsx']
1177+
},
1178+
'import/resolver': {
1179+
node: true,
1180+
typescript: true
1181+
},
11541182
jsdoc: {
11551183
augmentsExtendsReplacesDocs: true,
11561184
ignoreInternal: false,
11571185
ignorePrivate: false,
11581186
implementsReplacesDocs: true,
11591187
overrideReplacesDocs: true,
11601188
preferredTypes: {
1161-
'*': false
1189+
'*': false,
1190+
'.<>': false,
1191+
'Array<>': { replacement: '[]' },
1192+
Object: { replacement: 'object' },
1193+
'Object<>': { replacement: 'Record<>' },
1194+
object: 'object'
11621195
},
11631196
structuredTags: {
11641197
const: {
11651198
name: 'namepath-defining',
11661199
required: ['name']
11671200
},
1201+
decorator: {
1202+
name: 'none'
1203+
},
11681204
enum: {
11691205
name: 'namepath-defining',
11701206
required: ['name', 'type']

__tests__/reporters/notifier.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ class Notifier implements Reporter {
111111

112112
message = dedent`
113113
${passes} tests passed in ${
114-
time > 1000 ? `${(time / 1000).toFixed(2)}ms` : `${Math.round(time)}ms`
115-
}
114+
time > 1000
115+
? `${(time / 1000).toFixed(2)}ms`
116+
: `${Math.round(time)}ms`
117+
}
116118
`
117119

118120
title = '\u2705 Passed'

config/changelog.config.ts

+13-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ import {
1414
type Commit
1515
} from '@flex-development/commitlint-config'
1616
import pathe from '@flex-development/pathe'
17-
import { CompareResult, isNIL } from '@flex-development/tutils'
17+
import {
18+
CompareResult,
19+
at,
20+
includes,
21+
isNIL,
22+
select
23+
} from '@flex-development/tutils'
1824
import addStream from 'add-stream'
1925
import conventionalChangelog from 'conventional-changelog'
2026
import type { Options } from 'conventional-changelog-core'
@@ -198,10 +204,10 @@ sade('changelog', true)
198204
return void apply(null, {
199205
...commit,
200206
committerDate: dateformat(commit.committerDate, 'yyyy-mm-dd', true),
201-
mentions: commit.mentions.filter(m => m !== 'flexdevelopment'),
207+
mentions: select(commit.mentions, m => m !== 'flexdevelopment'),
202208
// @ts-expect-error ts(2322)
203209
raw: commit,
204-
references: commit.references.filter(ref => ref.action !== null),
210+
references: select(commit.references, ref => ref.action !== null),
205211
version: commit.gitTags ? vgx.exec(commit.gitTags)?.[1] : undefined
206212
})
207213
},
@@ -296,21 +302,21 @@ sade('changelog', true)
296302
*
297303
* @const {CommitEnhanced?} first_commit
298304
*/
299-
const first_commit: CommitEnhanced | undefined = commits.at(0)
305+
const first_commit: CommitEnhanced | undefined = at(commits, 0)
300306

301307
/**
302308
* Last commit in release.
303309
*
304310
* @const {CommitEnhanced?} last_commit
305311
*/
306-
const last_commit: CommitEnhanced | undefined = commits.at(-1)
312+
const last_commit: CommitEnhanced | undefined = at(commits, -1)
307313

308314
// set current and previous tags
309315
if (key && (!currentTag || !previousTag)) {
310316
currentTag = key.version ?? undefined
311317

312318
// try setting previous tag based on current tag
313-
if (gitSemverTags.includes(currentTag ?? '')) {
319+
if (includes(gitSemverTags, currentTag)) {
314320
const { version = '' } = key
315321
previousTag = gitSemverTags[gitSemverTags.indexOf(version) + 1]
316322
if (!previousTag) previousTag = last_commit?.hash ?? undefined
@@ -324,7 +330,7 @@ sade('changelog', true)
324330
: !currentTag && version
325331
? pkg.tagPrefix + version
326332
: currentTag ?? version
327-
previousTag = previousTag ?? gitSemverTags[0]
333+
previousTag = previousTag ?? at(gitSemverTags, 0)
328334
}
329335

330336
// set release date

package.json

+20-20
Original file line numberDiff line numberDiff line change
@@ -79,59 +79,59 @@
7979
"@flex-development/mlly": "1.0.0-alpha.15",
8080
"@flex-development/pathe": "1.0.3",
8181
"@flex-development/tsconfig-utils": "1.1.2",
82-
"@graphql-eslint/eslint-plugin": "3.18.0",
83-
"@types/chai": "4.3.4",
82+
"@graphql-eslint/eslint-plugin": "3.20.1",
8483
"@types/conventional-changelog": "3.1.1",
8584
"@types/conventional-changelog-core": "4.2.1",
8685
"@types/conventional-changelog-writer": "4.0.2",
8786
"@types/conventional-recommended-bump": "6.1.0",
8887
"@types/dateformat": "5.0.0",
89-
"@types/eslint": "8.37.0",
88+
"@types/eslint": "8.44.1",
9089
"@types/git-raw-commits": "2.0.1",
9190
"@types/is-ci": "3.0.0",
92-
"@types/node": "18.14.6",
91+
"@types/node": "20.4.5",
9392
"@types/node-notifier": "8.0.2",
94-
"@types/prettier": "2.7.2",
93+
"@types/prettier": "2.7.3",
9594
"@types/semver": "7.3.13",
96-
"@typescript-eslint/eslint-plugin": "5.59.8",
97-
"@typescript-eslint/parser": "5.59.8",
95+
"@typescript-eslint/eslint-plugin": "6.2.0",
96+
"@typescript-eslint/parser": "6.2.0",
9897
"@vates/toggle-scripts": "1.0.0",
9998
"add-stream": "1.0.0",
100-
"chai": "4.3.7",
10199
"conventional-changelog": "3.1.25",
102100
"conventional-changelog-conventionalcommits": "5.0.0",
103101
"conventional-changelog-core": "4.2.4",
104102
"conventional-changelog-writer": "5.0.1",
105103
"conventional-recommended-bump": "6.1.0",
106104
"cross-env": "7.0.3",
107-
"cspell": "6.31.1",
105+
"cspell": "6.31.2",
108106
"dateformat": "5.0.3",
109-
"esbuild": "0.17.19",
110-
"eslint": "8.39.0",
107+
"esbuild": "0.18.17",
108+
"eslint": "8.45.0",
111109
"eslint-config-prettier": "8.8.0",
110+
"eslint-import-resolver-typescript": "3.5.5",
112111
"eslint-plugin-chai-expect": "3.0.0",
112+
"eslint-plugin-import": "2.27.5",
113113
"eslint-plugin-jest-formatting": "3.1.0",
114-
"eslint-plugin-jsdoc": "40.3.0",
115-
"eslint-plugin-jsonc": "2.8.0",
114+
"eslint-plugin-jsdoc": "44.1.0",
115+
"eslint-plugin-jsonc": "2.9.0",
116116
"eslint-plugin-markdown": "3.0.0",
117117
"eslint-plugin-markdownlint": "0.4.1",
118118
"eslint-plugin-node": "11.1.0",
119-
"eslint-plugin-prettier": "4.2.1",
119+
"eslint-plugin-prettier": "5.0.0",
120120
"eslint-plugin-promise": "6.1.1",
121-
"eslint-plugin-unicorn": "46.0.0",
122-
"eslint-plugin-yml": "1.7.0",
123-
"graphql": "16.6.0",
121+
"eslint-plugin-unicorn": "48.0.1",
122+
"eslint-plugin-yml": "1.8.0",
123+
"graphql": "16.7.1",
124124
"graphql-config": "4.5.0",
125125
"growl": "1.10.5",
126126
"husky": "8.0.3",
127127
"is-ci": "3.0.1",
128128
"jsonc-eslint-parser": "2.3.0",
129-
"lint-staged": "13.2.2",
129+
"lint-staged": "13.2.3",
130130
"mri": "1.2.0",
131131
"node-notifier": "10.0.1",
132132
"pkg-size": "2.4.0",
133-
"prettier": "2.8.8",
134-
"prettier-plugin-sh": "0.12.8",
133+
"prettier": "3.0.0",
134+
"prettier-plugin-sh": "0.13.1",
135135
"sade": "1.8.1",
136136
"semver": "7.5.2",
137137
"tempfile": "5.0.0",

0 commit comments

Comments
 (0)