Skip to content

Commit

Permalink
chore: update dev environment
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
  • Loading branch information
unicornware committed Jul 26, 2023
1 parent c2e040c commit 4cda056
Show file tree
Hide file tree
Showing 5 changed files with 1,226 additions and 656 deletions.
90 changes: 63 additions & 27 deletions .eslintrc.base.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const config = {
},
plugins: [
'@typescript-eslint',
'import',
'jsdoc',
'node',
'prettier',
Expand Down Expand Up @@ -171,7 +172,6 @@ const config = {
}
],
'@typescript-eslint/no-dupe-class-members': 2,
'@typescript-eslint/no-duplicate-imports': 2,
'@typescript-eslint/no-dynamic-delete': 2,
'@typescript-eslint/no-empty-function': [
2,
Expand All @@ -180,7 +180,13 @@ const config = {
}
],
'@typescript-eslint/no-empty-interface': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-explicit-any': [
2,
{
fixToUnknown: true,
ignoreRestArgs: true
}
],
'@typescript-eslint/no-extra-non-null-assertion': 2,
'@typescript-eslint/no-extra-parens': 0,
'@typescript-eslint/no-extra-semi': 0,
Expand Down Expand Up @@ -352,7 +358,11 @@ const config = {
2,
{
allowAny: false,
checkCompoundAssignments: false
allowBoolean: false,
allowNullish: false,
allowNumberAndString: true,
allowRegExp: false,
skipCompoundAssignments: true
}
],
'@typescript-eslint/restrict-template-expressions': [
Expand All @@ -366,7 +376,7 @@ const config = {
}
],
'@typescript-eslint/return-await': [2, 'in-try-catch'],
'@typescript-eslint/sort-type-union-intersection-members': 2,
'@typescript-eslint/sort-type-constituents': 2,
'@typescript-eslint/strict-boolean-expressions': [
2,
{
Expand Down Expand Up @@ -394,6 +404,13 @@ const config = {
'@typescript-eslint/unified-signatures': 2,
'default-param-last': 0,
eqeqeq: 1,
'import/no-duplicates': [
2,
{
considerQueryString: true,
'prefer-inline': true
}
],
'init-declarations': 0,
'jsdoc/check-access': 1,
'jsdoc/check-alignment': 1,
Expand All @@ -417,6 +434,7 @@ const config = {
1,
{
definedTags: [
'decorator',
'experimental',
'maximum',
'minimum',
Expand All @@ -434,7 +452,6 @@ const config = {
'jsdoc/match-description': 0,
'jsdoc/match-name': 0,
'jsdoc/multiline-blocks': 1,
'jsdoc/newline-after-description': [1, 'always'],
'jsdoc/no-bad-blocks': [1, { preventAllMultiAsteriskBlocks: true }],
'jsdoc/no-defaults': 0,
'jsdoc/no-missing-syntax': 0,
Expand Down Expand Up @@ -557,9 +574,10 @@ const config = {
1,
'any',
{
applyToEndTag: true,
count: 1,
dropEndLines: true,
noEndLines: false,
endLines: 0,
startLines: 1,
tags: {}
}
],
Expand All @@ -572,6 +590,7 @@ const config = {
'no-empty-function': 0,
'no-ex-assign': 0,
'no-extra-parens': 0,
'no-extra-semi': 0,
'no-implied-eval': 0,
'no-invalid-this': 0,
'no-loop-func': 0,
Expand Down Expand Up @@ -652,15 +671,15 @@ const config = {
'unicorn/empty-brace-spaces': 2,
'unicorn/error-message': 2,
'unicorn/escape-case': 2,
'unicorn/expiring-todo-comments': [
2,
{
allowWarningComments: true,
ignore: [],
ignoreDatesOnPullRequests: true,
terms: ['@fixme', '@todo']
}
],
// 'unicorn/expiring-todo-comments': [
// 2,
// {
// allowWarningComments: true,
// ignore: [],
// ignoreDatesOnPullRequests: true,
// terms: ['@fixme', '@todo']
// }
// ],
'unicorn/explicit-length-check': 0,
'unicorn/filename-case': [
2,
Expand Down Expand Up @@ -774,15 +793,8 @@ const config = {
allowArgumentsExplicitlyTypedAsAny: true,
allowDirectConstAssertionInArrowFunctions: true,
allowHigherOrderFunctions: false,
allowTypedFunctionExpressions: true,
allowedNames: [],
shouldTrackReferences: true
}
],
'@typescript-eslint/no-implicit-any-catch': [
2,
{
allowExplicitAny: false
allowTypedFunctionExpressions: false,
allowedNames: []
}
],
'no-undef': 0
Expand Down Expand Up @@ -878,6 +890,12 @@ const config = {
'@typescript-eslint/no-redundant-type-constituents': 0
}
},
{
files: ['**/decorators/*.constraint.ts', '**/*.decorator.ts'],
rules: {
'@typescript-eslint/ban-types': 0
}
},
{
files: ['**/enums/*.ts', '**/interfaces/*.ts', '**/types/*.ts'],
rules: {
Expand Down Expand Up @@ -990,6 +1008,7 @@ const config = {
'@typescript-eslint/naming-convention': 0,
'@typescript-eslint/no-base-to-string': 0,
'@typescript-eslint/no-confusing-void-expression': 0,
'@typescript-eslint/no-duplicate-type-constituents': 0,
'@typescript-eslint/no-floating-promises': 0,
'@typescript-eslint/no-for-in-array': 0,
'@typescript-eslint/no-implied-eval': 0,
Expand All @@ -1006,12 +1025,14 @@ const config = {
'@typescript-eslint/no-unsafe-argument': 0,
'@typescript-eslint/no-unsafe-assignment': 0,
'@typescript-eslint/no-unsafe-call': 0,
'@typescript-eslint/no-unsafe-enum-comparison': 0,
'@typescript-eslint/no-unsafe-member-access': 0,
'@typescript-eslint/no-unsafe-return': 0,
'@typescript-eslint/no-unused-expressions': 0,
'@typescript-eslint/non-nullable-type-assertion-style': 0,
'@typescript-eslint/prefer-includes': 0,
'@typescript-eslint/prefer-nullish-coalescing': 0,
'@typescript-eslint/prefer-optional-chain': 0,
'@typescript-eslint/prefer-readonly': 0,
'@typescript-eslint/prefer-readonly-parameter-types': 0,
'@typescript-eslint/prefer-reduce-type-parameter': 0,
Expand All @@ -1032,7 +1053,7 @@ const config = {
}
},
{
files: '**/*.yml',
files: '**/*.+(yaml|yml)',
parser: 'yaml-eslint-parser',
plugins: ['yml'],
rules: {
Expand Down Expand Up @@ -1151,20 +1172,35 @@ const config = {
'prettier/prettier': [2, {}, { usePrettierrc: true }]
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.cts', '.mts', '.ts', '.tsx']
},
'import/resolver': {
node: true,
typescript: true
},
jsdoc: {
augmentsExtendsReplacesDocs: true,
ignoreInternal: false,
ignorePrivate: false,
implementsReplacesDocs: true,
overrideReplacesDocs: true,
preferredTypes: {
'*': false
'*': false,
'.<>': false,
'Array<>': { replacement: '[]' },
Object: { replacement: 'object' },
'Object<>': { replacement: 'Record<>' },
object: 'object'
},
structuredTags: {
const: {
name: 'namepath-defining',
required: ['name']
},
decorator: {
name: 'none'
},
enum: {
name: 'namepath-defining',
required: ['name', 'type']
Expand Down
6 changes: 4 additions & 2 deletions __tests__/reporters/notifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ class Notifier implements Reporter {

message = dedent`
${passes} tests passed in ${
time > 1000 ? `${(time / 1000).toFixed(2)}ms` : `${Math.round(time)}ms`
}
time > 1000
? `${(time / 1000).toFixed(2)}ms`
: `${Math.round(time)}ms`
}
`

title = '\u2705 Passed'
Expand Down
20 changes: 13 additions & 7 deletions config/changelog.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ import {
type Commit
} from '@flex-development/commitlint-config'
import pathe from '@flex-development/pathe'
import { CompareResult, isNIL } from '@flex-development/tutils'
import {
CompareResult,
at,
includes,
isNIL,
select
} from '@flex-development/tutils'
import addStream from 'add-stream'
import conventionalChangelog from 'conventional-changelog'
import type { Options } from 'conventional-changelog-core'
Expand Down Expand Up @@ -198,10 +204,10 @@ sade('changelog', true)
return void apply(null, {
...commit,
committerDate: dateformat(commit.committerDate, 'yyyy-mm-dd', true),
mentions: commit.mentions.filter(m => m !== 'flexdevelopment'),
mentions: select(commit.mentions, m => m !== 'flexdevelopment'),
// @ts-expect-error ts(2322)
raw: commit,
references: commit.references.filter(ref => ref.action !== null),
references: select(commit.references, ref => ref.action !== null),
version: commit.gitTags ? vgx.exec(commit.gitTags)?.[1] : undefined
})
},
Expand Down Expand Up @@ -296,21 +302,21 @@ sade('changelog', true)
*
* @const {CommitEnhanced?} first_commit
*/
const first_commit: CommitEnhanced | undefined = commits.at(0)
const first_commit: CommitEnhanced | undefined = at(commits, 0)

/**
* Last commit in release.
*
* @const {CommitEnhanced?} last_commit
*/
const last_commit: CommitEnhanced | undefined = commits.at(-1)
const last_commit: CommitEnhanced | undefined = at(commits, -1)

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

// try setting previous tag based on current tag
if (gitSemverTags.includes(currentTag ?? '')) {
if (includes(gitSemverTags, currentTag)) {
const { version = '' } = key
previousTag = gitSemverTags[gitSemverTags.indexOf(version) + 1]
if (!previousTag) previousTag = last_commit?.hash ?? undefined
Expand All @@ -324,7 +330,7 @@ sade('changelog', true)
: !currentTag && version
? pkg.tagPrefix + version
: currentTag ?? version
previousTag = previousTag ?? gitSemverTags[0]
previousTag = previousTag ?? at(gitSemverTags, 0)
}

// set release date
Expand Down
40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,59 +79,59 @@
"@flex-development/mlly": "1.0.0-alpha.15",
"@flex-development/pathe": "1.0.3",
"@flex-development/tsconfig-utils": "1.1.2",
"@graphql-eslint/eslint-plugin": "3.18.0",
"@types/chai": "4.3.4",
"@graphql-eslint/eslint-plugin": "3.20.1",
"@types/conventional-changelog": "3.1.1",
"@types/conventional-changelog-core": "4.2.1",
"@types/conventional-changelog-writer": "4.0.2",
"@types/conventional-recommended-bump": "6.1.0",
"@types/dateformat": "5.0.0",
"@types/eslint": "8.37.0",
"@types/eslint": "8.44.1",
"@types/git-raw-commits": "2.0.1",
"@types/is-ci": "3.0.0",
"@types/node": "18.14.6",
"@types/node": "20.4.5",
"@types/node-notifier": "8.0.2",
"@types/prettier": "2.7.2",
"@types/prettier": "2.7.3",
"@types/semver": "7.3.13",
"@typescript-eslint/eslint-plugin": "5.59.8",
"@typescript-eslint/parser": "5.59.8",
"@typescript-eslint/eslint-plugin": "6.2.0",
"@typescript-eslint/parser": "6.2.0",
"@vates/toggle-scripts": "1.0.0",
"add-stream": "1.0.0",
"chai": "4.3.7",
"conventional-changelog": "3.1.25",
"conventional-changelog-conventionalcommits": "5.0.0",
"conventional-changelog-core": "4.2.4",
"conventional-changelog-writer": "5.0.1",
"conventional-recommended-bump": "6.1.0",
"cross-env": "7.0.3",
"cspell": "6.31.1",
"cspell": "6.31.2",
"dateformat": "5.0.3",
"esbuild": "0.17.19",
"eslint": "8.39.0",
"esbuild": "0.18.17",
"eslint": "8.45.0",
"eslint-config-prettier": "8.8.0",
"eslint-import-resolver-typescript": "3.5.5",
"eslint-plugin-chai-expect": "3.0.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-jest-formatting": "3.1.0",
"eslint-plugin-jsdoc": "40.3.0",
"eslint-plugin-jsonc": "2.8.0",
"eslint-plugin-jsdoc": "44.1.0",
"eslint-plugin-jsonc": "2.9.0",
"eslint-plugin-markdown": "3.0.0",
"eslint-plugin-markdownlint": "0.4.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-prettier": "5.0.0",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-unicorn": "46.0.0",
"eslint-plugin-yml": "1.7.0",
"graphql": "16.6.0",
"eslint-plugin-unicorn": "48.0.1",
"eslint-plugin-yml": "1.8.0",
"graphql": "16.7.1",
"graphql-config": "4.5.0",
"growl": "1.10.5",
"husky": "8.0.3",
"is-ci": "3.0.1",
"jsonc-eslint-parser": "2.3.0",
"lint-staged": "13.2.2",
"lint-staged": "13.2.3",
"mri": "1.2.0",
"node-notifier": "10.0.1",
"pkg-size": "2.4.0",
"prettier": "2.8.8",
"prettier-plugin-sh": "0.12.8",
"prettier": "3.0.0",
"prettier-plugin-sh": "0.13.1",
"sade": "1.8.1",
"semver": "7.5.2",
"tempfile": "5.0.0",
Expand Down
Loading

0 comments on commit 4cda056

Please sign in to comment.