From ccd4fef5607eb9e8c47ef3b615f91025da23699f Mon Sep 17 00:00:00 2001 From: Lexus Drumgold Date: Mon, 20 Feb 2023 06:16:43 -0500 Subject: [PATCH] chore: update config files Signed-off-by: Lexus Drumgold --- .commitlintrc.json | 5 + .cspell.json | 21 +- .dictionary.txt | 13 +- .env.zsh | 2 +- .eslintignore | 31 +- .eslintrc.base.cjs | 1482 ++++--- .eslintrc.cjs | 6 +- .gitattributes | 3 + .github/.gitconfig | 3 + .github/ISSUE_TEMPLATE/bug.yml | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 8 +- .github/dependabot.yml | 13 +- .github/labels.yml | 8 + .github/workflows/integrity.yml | 3 + .github/workflows/publish.yml | 23 +- .github/workflows/release.yml | 2 +- .gitignore | 37 +- .husky/pre-commit | 4 +- .husky/pre-push | 6 - .lintstagedrc.json | 10 +- .markdownlint.jsonc | 5 +- .markdownlintignore | 1 + .nvmrc | 2 +- .prettierignore | 31 +- .prettierrc.json | 13 +- .vscode/launch.json | 5 + .vscode/settings.json | 174 +- .yarnrc.yml | 6 +- CONTRIBUTING.md | 49 +- __tests__/interfaces/index.ts | 6 - __tests__/interfaces/testcase-called.ts | 17 - __tests__/interfaces/testcase-fn.ts | 20 - __tests__/interfaces/testcase.ts | 36 - __tests__/interfaces/vi-assertion-result.ts | 22 - __tests__/interfaces/vi-test-result.ts | 22 - __tests__/interfaces/vi-test-results.ts | 28 - __tests__/reporters/notifier.ts | 14 +- __tests__/setup/chai.ts | 19 +- __tests__/setup/faker.ts | 9 - __tests__/setup/index.ts | 2 - __tests__/setup/pf.ts | 21 - __tests__/setup/setup.ts | 14 - __tests__/setup/teardown.ts | 14 - __tests__/ts/v4/tsconfig.build.json | 10 + __tests__/ts/v4/tsconfig.json | 54 + __tests__/ts/v4/tsconfig.typecheck.json | 6 + build.config.ts | 20 +- changelog.config.cts | 204 - config/changelog.config.ts | 408 ++ .../templates}/changelog/header.hbs | 0 loader.mjs | 164 +- package.json | 84 +- patches/vitest+0.25.3.dev.patch | 13 - scripts/release.sh | 22 +- scripts/typecheck-build.sh | 12 + src/__tests__/toggle.functional.spec.ts | 4 +- tsconfig.build.json | 5 +- tsconfig.json | 43 +- typings/@faker-js/faker/global.d.ts | 5 - typings/add-stream/index.d.ts | 14 + typings/chai/global.d.ts | 6 - typings/conventional-changelog-cli/index.d.ts | 18 - .../conventional-changelog-writer/index.d.ts | 3 + .../conventional-commits-parser/index.d.ts | 25 +- typings/node/global.d.ts | 3 - typings/node/loader.d.ts | 141 +- typings/node/module.d.ts | 15 - typings/pretty-format/global.d.ts | 5 - vitest-env.d.ts | 7 +- vitest.config.ts | 58 +- yarn.lock | 3574 +++++++++-------- 71 files changed, 3937 insertions(+), 3198 deletions(-) create mode 100644 .vscode/launch.json delete mode 100644 __tests__/interfaces/testcase-called.ts delete mode 100644 __tests__/interfaces/testcase-fn.ts delete mode 100644 __tests__/interfaces/testcase.ts delete mode 100644 __tests__/interfaces/vi-assertion-result.ts delete mode 100644 __tests__/interfaces/vi-test-result.ts delete mode 100644 __tests__/interfaces/vi-test-results.ts delete mode 100644 __tests__/setup/faker.ts delete mode 100644 __tests__/setup/pf.ts delete mode 100644 __tests__/setup/setup.ts delete mode 100644 __tests__/setup/teardown.ts create mode 100644 __tests__/ts/v4/tsconfig.build.json create mode 100644 __tests__/ts/v4/tsconfig.json create mode 100644 __tests__/ts/v4/tsconfig.typecheck.json delete mode 100644 changelog.config.cts create mode 100644 config/changelog.config.ts rename {templates => config/templates}/changelog/header.hbs (100%) delete mode 100644 patches/vitest+0.25.3.dev.patch create mode 100644 scripts/typecheck-build.sh delete mode 100644 typings/@faker-js/faker/global.d.ts create mode 100644 typings/add-stream/index.d.ts delete mode 100644 typings/chai/global.d.ts delete mode 100644 typings/conventional-changelog-cli/index.d.ts delete mode 100644 typings/node/global.d.ts delete mode 100644 typings/node/module.d.ts delete mode 100644 typings/pretty-format/global.d.ts diff --git a/.commitlintrc.json b/.commitlintrc.json index c47b9133..9eb4241d 100644 --- a/.commitlintrc.json +++ b/.commitlintrc.json @@ -9,6 +9,7 @@ 2, "always", [ + "build", "cli", "deps", "deps-bundle", @@ -18,11 +19,15 @@ "esm", "exports", "github", + "install", + "loader", "node", + "nvm", "patches", "pkg", "release", "scripts", + "spelling", "tests", "ts", "vscode", diff --git a/.cspell.json b/.cspell.json index 317ba7bd..13b66065 100644 --- a/.cspell.json +++ b/.cspell.json @@ -14,25 +14,17 @@ "flagWords": [], "ignorePaths": [ "**/*.snap", + "**/.*ignore", "**/.gitconfig", - "**/.gitignore", - "**/.gitkeep", - "**/.npmignore", + "**/CHANGELOG.md", + "**/LICENSE.md", + "**/RELEASE_NOTES.md", ".cspell.json", - ".env*", - ".eslintignore", ".git/", ".husky/_/", - ".markdownlintignore", - ".nvmrc", - ".prettierignore", + ".vscode/settings.json", ".yarn/", - "CHANGELOG.md", - "LICENSE.md", - "__tests__/report.json", - "dist/", "patches/", - "tsconfig.temp.json", "yarn.lock" ], "ignoreRegExpList": [ @@ -46,6 +38,5 @@ "readonly": true, "useGitignore": true, "usePnP": false, - "version": "0.2", - "words": ["fldv", "flexdevelopmentllc"] + "version": "0.2" } diff --git a/.dictionary.txt b/.dictionary.txt index 47228f06..fa4e9c70 100644 --- a/.dictionary.txt +++ b/.dictionary.txt @@ -1,34 +1,35 @@ ardatan bdougie cefc +codecov commitlintrc dawidd dedupe dessant dohm -esbenp esbuild evanw fbca gpgsign -graphqlrc hmarr iife +infile keyid larsgw lcov +lintstagedrc memfs micnncim mkbuild +mlly nocheck npmrc -nums +nvmrc ohmyzsh +pathe pkgs preid syncer -testts +unstub vates -vitest -vsicons yarnrc diff --git a/.env.zsh b/.env.zsh index 7c211615..4c9b87c5 100644 --- a/.env.zsh +++ b/.env.zsh @@ -4,5 +4,5 @@ # # - https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/dotenv +[ -f $PWD/.env.local ] && source $PWD/.env.local NODE_NO_WARNINGS=1 -VITEST_SEGFAULT_RETRY=3 diff --git a/.eslintignore b/.eslintignore index d3ef867f..ac266802 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,17 +1,30 @@ # ESLINT IGNORE -# https://eslint.org/docs/user-guide/configuring#ignoring-files-and-directories +# https://eslint.org/docs/user-guide/configuring/ignoring-code#the-eslintignore-file # DIRECTORIES & FILES **/*.snap +**/*config.*.timestamp* **/.DS_Store -.eslintcache -.yarn/* -__tests__/report.json -coverage/* -dist/* -node_modules/* -tsconfig.temp.json +**/__tests__/report.json +**/coverage/ +**/.temp/ +**/dist/ +**/node_modules/ +**/tsconfig*temp.json yarn.lock # NEGATED PATTERNS -!/.* +!**/.eslintrc* +!**/__fixtures__/**/dist/ +!**/__fixtures__/**/node_modules/ +!**/typings/**/dist/ +!.codecov.yml +!.commitlintrc.json +!.cspell.json +!.github/ +!.graphqlrc.yml +!.lintstagedrc.json +!.markdownlint.jsonc +!.prettierrc.json +!.vscode/ +!.yarnrc.yml diff --git a/.eslintrc.base.cjs b/.eslintrc.base.cjs index dca73e45..4e419f78 100644 --- a/.eslintrc.base.cjs +++ b/.eslintrc.base.cjs @@ -4,6 +4,12 @@ * @see https://eslint.org/docs/user-guide/configuring */ +/** + * @type {typeof import('node:fs')} + * @const fs + */ +const fs = require('node:fs') + /** * @type {typeof import('./tsconfig.json')} * @const tsconfig - Tsconfig object @@ -25,647 +31,87 @@ const config = { [require('./tsconfig.build.json').compilerOptions.target]: true, node: true }, - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:prettier/recommended' - ], - globals: { - Chai: 'readonly', - Console: 'readonly', - JSX: jsx ? 'readonly' : false, - LoadHook: 'readonly', - LoadHookContext: 'readonly', - LoadHookResult: 'readonly', - LoaderHookFormat: 'readonly', - NodeJS: 'readonly', - ResolveFilename: 'readonly', - ResolveHook: 'readonly', - ResolveHookContext: 'readonly', - ResolveHookResult: 'readonly' - }, - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaFeatures: { - jsx, - impliedStrict: true - }, - emitDecoratorMetadata: tsconfig.compilerOptions.emitDecoratorMetadata, - extraFileExtensions: [], - project: ['./tsconfig.json'], - sourceType: 'module', - tsconfigRootDir: __dirname, - warnOnUnsupportedTypeScriptVersion: true - }, - plugins: [ - '@typescript-eslint', - 'jsdoc', - 'node', - 'prettier', - 'promise', - 'unicorn' - ], - reportUnusedDisableDirectives: true, - rules: { - '@typescript-eslint/adjacent-overload-signatures': 2, - '@typescript-eslint/array-type': [ - 2, - { - default: 'array', - readonly: 'array' - } - ], - '@typescript-eslint/ban-ts-comment': [ - 2, - { - minimumDescriptionLength: 3, - 'ts-nocheck': 'allow-with-description', - 'ts-ignore': 'allow-with-description', - 'ts-expect-error': 'allow-with-description' - } - ], - '@typescript-eslint/ban-tslint-comment': 2, - '@typescript-eslint/ban-types': [ - 2, - { - extendDefaults: true, - types: {} - } - ], - '@typescript-eslint/camelcase': 0, - '@typescript-eslint/class-literal-property-style': [2, 'getters'], - '@typescript-eslint/consistent-indexed-object-style': [2, 'record'], - '@typescript-eslint/consistent-type-assertions': [ - 2, - { - assertionStyle: 'as', - objectLiteralTypeAssertions: 'allow' - } - ], - '@typescript-eslint/consistent-type-definitions': 0, - '@typescript-eslint/consistent-type-imports': 0, - '@typescript-eslint/default-param-last': 2, - '@typescript-eslint/explicit-function-return-type': 0, - '@typescript-eslint/explicit-member-accessibility': [ - 2, - { - accessibility: 'explicit', - overrides: { - constructors: 'no-public' - } - } - ], - '@typescript-eslint/explicit-module-boundary-types': [ - 2, - { - allowArgumentsExplicitlyTypedAsAny: true, - allowDirectConstAssertionInArrowFunctions: true, - allowHigherOrderFunctions: false, - allowTypedFunctionExpressions: true, - allowedNames: [], - shouldTrackReferences: true - } - ], - '@typescript-eslint/init-declarations': 0, - '@typescript-eslint/lines-between-class-members': [ - 2, - 'always', - { - exceptAfterOverload: true, - exceptAfterSingleLine: false - } - ], - '@typescript-eslint/member-ordering': [ - 2, - { - default: { - memberTypes: [ - 'static-field', - 'decorated-field', - 'instance-field', - 'abstract-field', - - 'constructor', - - 'signature', - - 'static-get', - 'static-set', - 'static-method', - - 'decorated-get', - 'decorated-set', - 'decorated-method', - - 'instance-get', - 'instance-set', - 'instance-method', - - 'abstract-get', - 'abstract-set', - 'abstract-method' - ], - order: 'alphabetically' - } - } - ], - '@typescript-eslint/method-signature-style': [2, 'method'], - '@typescript-eslint/no-array-constructor': 2, - '@typescript-eslint/no-confusing-non-null-assertion': 0, - '@typescript-eslint/no-confusing-void-expression': [ - 2, - { - ignoreArrowShorthand: true, - ignoreVoidOperator: true - } - ], - '@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, - { - allow: ['constructors', 'decoratedFunctions'] - } - ], - '@typescript-eslint/no-empty-interface': 0, - '@typescript-eslint/no-explicit-any': 0, - '@typescript-eslint/no-extra-non-null-assertion': 2, - '@typescript-eslint/no-extra-parens': 0, - '@typescript-eslint/no-extra-semi': 0, - '@typescript-eslint/no-extraneous-class': [ - 2, - { - allowConstructorOnly: false, - allowEmpty: true, - allowStaticOnly: true, - allowWithDecorator: true - } - ], - '@typescript-eslint/no-implicit-any-catch': [ - 2, - { - allowExplicitAny: false - } - ], - '@typescript-eslint/no-inferrable-types': 0, - '@typescript-eslint/no-invalid-this': [2, { capIsConstructor: true }], - '@typescript-eslint/no-invalid-void-type': [ - 2, - { - allowInGenericTypeArguments: true, - allowAsThisParameter: true - } - ], - '@typescript-eslint/no-loop-func': 2, - '@typescript-eslint/no-loss-of-precision': 2, - '@typescript-eslint/no-magic-numbers': 0, - '@typescript-eslint/no-meaningless-void-operator': 0, - '@typescript-eslint/no-misused-new': 2, - '@typescript-eslint/no-namespace': 0, - '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 2, - '@typescript-eslint/no-non-null-asserted-optional-chain': 0, - '@typescript-eslint/no-non-null-assertion': 0, - '@typescript-eslint/no-parameter-properties': 0, - '@typescript-eslint/no-redeclare': [ - 2, - { - builtinGlobals: true, - ignoreDeclarationMerge: true - } - ], - '@typescript-eslint/no-require-imports': 2, - '@typescript-eslint/no-restricted-imports': 0, - '@typescript-eslint/no-shadow': 0, - '@typescript-eslint/no-this-alias': [ - 2, - { - allowDestructuring: false, - allowedNames: ['self'] - } - ], - '@typescript-eslint/no-type-alias': 0, - '@typescript-eslint/no-unnecessary-type-constraint': 2, - '@typescript-eslint/no-unsafe-assignment': 0, - '@typescript-eslint/no-unused-expressions': [ - 2, - { - allowShortCircuit: true, - allowTaggedTemplates: true, - allowTernary: true, - enforceForJSX: jsx - } - ], - '@typescript-eslint/no-unused-vars': [ - 2, - { - args: 'after-used', - caughtErrors: 'all', - ignoreRestSiblings: false, - vars: 'all' - } - ], - '@typescript-eslint/no-use-before-define': [ - 2, - { - classes: true, - enums: true, - functions: true, - ignoreTypeReferences: true, - typedefs: true, - variables: true - } - ], - '@typescript-eslint/no-useless-constructor': 2, - '@typescript-eslint/no-useless-empty-export': 2, - '@typescript-eslint/no-var-requires': 2, - '@typescript-eslint/padding-line-between-statements': 0, - '@typescript-eslint/prefer-as-const': 2, - '@typescript-eslint/prefer-enum-initializers': 0, - '@typescript-eslint/prefer-for-of': 2, - '@typescript-eslint/prefer-function-type': 2, - '@typescript-eslint/prefer-includes': 0, - '@typescript-eslint/prefer-literal-enum-member': [ - 2, - { - allowBitwiseExpressions: true - } - ], - '@typescript-eslint/prefer-namespace-keyword': 2, - '@typescript-eslint/prefer-readonly-parameter-types': 0, - '@typescript-eslint/prefer-return-this-type': 0, - '@typescript-eslint/prefer-ts-expect-error': 2, - '@typescript-eslint/quotes': [ - 2, - 'single', - { - avoidEscape: true, - allowTemplateLiterals: true - } - ], - '@typescript-eslint/sort-type-union-intersection-members': 2, - '@typescript-eslint/triple-slash-reference': [ - 2, - { - lib: 'never', - path: 'never', - types: 'prefer-import' - } - ], - '@typescript-eslint/typedef': 0, - '@typescript-eslint/unified-signatures': 2, - 'default-param-last': 0, - eqeqeq: 1, - 'init-declarations': 0, - 'jsdoc/check-access': 1, - 'jsdoc/check-alignment': 1, - 'jsdoc/check-examples': 0, - // https://github.com/gajus/eslint-plugin-jsdoc/issues/541 - 'jsdoc/check-indentation': 0, - 'jsdoc/check-line-alignment': 1, - 'jsdoc/check-param-names': [ - 1, - { - allowExtraTrailingParamDocs: false, - checkDestructured: true, - checkRestProperty: true, - disableExtraPropertyReporting: true, - enableFixer: true - } - ], - 'jsdoc/check-property-names': [1, { enableFixer: true }], - 'jsdoc/check-syntax': 1, - 'jsdoc/check-tag-names': [ - 1, - { - definedTags: ['experimental', 'next', 'visibleName'], - jsxTags: jsx - } - ], - 'jsdoc/check-types': [1, { unifyParentAndChildTypeChecks: true }], - 'jsdoc/check-values': 1, - 'jsdoc/empty-tags': 1, - 'jsdoc/implements-on-classes': 1, - '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, - 'jsdoc/no-multi-asterisks': [ - 1, - { - allowWhitespace: true, - preventAtEnd: true, - preventAtMiddleLines: true - } - ], - 'jsdoc/no-restricted-syntax': 0, - 'jsdoc/no-types': 0, - 'jsdoc/no-undefined-types': [1, { definedTypes: ['never', 'unknown'] }], - 'jsdoc/require-asterisk-prefix': [1, 'always'], - 'jsdoc/require-description-complete-sentence': 0, - 'jsdoc/require-description': [ - 1, - { - checkConstructors: true, - checkGetters: true, - checkSetters: true, - descriptionStyle: 'body' - } - ], - 'jsdoc/require-example': 0, - 'jsdoc/require-hyphen-before-param-description': 1, - 'jsdoc/require-jsdoc': [ - 1, - { - checkConstructors: true, - checkGetters: true, - checkSetters: true, - enableFixer: true, - exemptEmptyConstructors: true, - exemptEmptyFunctions: false - } - ], - 'jsdoc/require-param-description': 1, - 'jsdoc/require-param-name': 1, - 'jsdoc/require-param-type': 1, - 'jsdoc/require-param': [ - 1, - { - autoIncrementBase: 0, - checkConstructors: true, - checkDestructured: true, - checkDestructuredRoots: true, - checkGetters: true, - checkRestProperty: true, - checkSetters: true, - enableFixer: true, - enableRestElementFixer: true, - enableRootFixer: true, - exemptedBy: ['inheritdoc', 'this'], - unnamedRootBase: ['param'], - useDefaultObjectProperties: true - } - ], - 'jsdoc/require-property': 1, - 'jsdoc/require-property-description': 1, - 'jsdoc/require-property-name': 1, - 'jsdoc/require-property-type': 1, - 'jsdoc/require-returns-check': [ - 1, - { - exemptAsync: false, - exemptGenerators: true, - reportMissingReturnForUndefinedTypes: true - } - ], - 'jsdoc/require-returns-description': 1, - 'jsdoc/require-returns-type': 1, - 'jsdoc/require-returns': [ - 1, - { - checkConstructors: false, - checkGetters: true, - forceRequireReturn: true, - forceReturnsWithAsync: true - } - ], - 'jsdoc/require-throws': 1, - 'jsdoc/require-yields': [ - 1, - { - forceRequireNext: true, - forceRequireYields: true, - next: true, - nextWithGeneratorTag: true, - withGeneratorTag: true - } - ], - 'jsdoc/require-yields-check': [ - 1, - { - checkGeneratorsOnly: true, - next: true - } - ], - 'jsdoc/sort-tags': 0, - 'jsdoc/tag-lines': [ - 1, - 'any', - { - dropEndLines: true, - count: 1, - noEndLines: false, - tags: {} - } - ], - 'jsdoc/valid-types': [1, { allowEmptyNamepaths: true }], - 'lines-between-class-members': 0, - 'no-array-constructor': 0, - 'no-case-declarations': 0, - 'no-duplicate-imports': 0, - 'no-empty-function': 0, - 'no-ex-assign': 0, - 'no-invalid-this': 0, - 'no-loop-func': 0, - 'no-loss-of-precision': 0, - 'no-magic-numbers': 0, - 'no-restricted-imports': 0, - 'no-shadow': 0, - 'no-unused-expressions': 0, - 'no-unused-vars': 0, - 'no-use-before-define': 0, - 'no-useless-constructor': 0, - 'no-warning-comments': 0, - 'node/callback-return': [2, ['callback', 'cb', 'done', 'next']], - 'node/exports-style': [2, 'module.exports', { allowBatchAssign: true }], - 'node/file-extension-in-import': 0, - 'node/global-require': 0, - 'node/handle-callback-err': [2, '^(err|error)$'], - 'node/no-callback-literal': 2, - 'node/no-deprecated-api': 2, - 'node/no-exports-assign': 2, - 'node/no-extraneous-import': 0, - 'node/no-extraneous-require': 0, - 'node/no-missing-import': 0, - 'node/no-new-require': 2, - 'node/no-path-concat': 2, - 'node/no-process-env': 0, - 'node/no-process-exit': 0, - 'node/no-unpublished-bin': 0, - 'node/no-unpublished-import': 0, - 'node/no-unpublished-require': 0, - 'node/no-unsupported-features/es-builtins': 2, - 'node/no-unsupported-features/es-syntax': 0, - 'node/no-unsupported-features/node-builtins': 2, - 'node/prefer-global/buffer': 2, - 'node/prefer-global/console': 2, - 'node/prefer-global/process': 2, - 'node/prefer-global/text-decoder': 2, - 'node/prefer-global/text-encoder': 2, - 'node/prefer-global/url': 2, - 'node/prefer-global/url-search-params': 2, - 'node/prefer-promises/dns': 2, - 'node/prefer-promises/fs': 2, - 'node/process-exit-as-throw': 2, - 'node/shebang': 0, - 'padding-line-between-statements': 0, - 'prefer-arrow-callback': 0, - 'prettier/prettier': [2, require('./.prettierrc.json')], - 'promise/always-return': 2, - 'promise/avoid-new': 2, - 'promise/catch-or-return': [2, { allowFinally: true, allowThen: true }], - 'promise/no-callback-in-promise': 2, - 'promise/no-native': 0, - 'promise/no-nesting': 2, - 'promise/no-new-statics': 2, - 'promise/no-promise-in-callback': 2, - 'promise/no-return-in-finally': 2, - 'promise/no-return-wrap': [2, { allowReject: false }], - 'promise/param-names': 2, - 'promise/prefer-await-to-callbacks': 2, - 'promise/prefer-await-to-then': 2, - 'promise/valid-params': 2, - quotes: 0, - 'sort-keys': [2, 'asc', { caseSensitive: true, minKeys: 2, natural: true }], - 'unicorn/better-regex': [2, { sortCharacterClasses: true }], - 'unicorn/catch-error-name': [2, { name: 'e' }], - 'unicorn/consistent-destructuring': 2, - 'unicorn/custom-error-definition': 2, - '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/explicit-length-check': 2, - 'unicorn/filename-case': [ - 2, - { - cases: { kebabCase: true }, - ignore: [] - } - ], - 'unicorn/import-index': 2, - 'unicorn/import-style': [ - 2, - { - styles: { - chalk: { default: true }, - shelljs: { default: true } - } - } - ], - 'unicorn/new-for-builtins': 2, - 'unicorn/no-abusive-eslint-disable': 2, - 'unicorn/no-array-callback-reference': 2, - 'unicorn/no-array-for-each': 2, - 'unicorn/no-array-method-this-argument': 2, - 'unicorn/no-array-push-push': 2, - 'unicorn/no-array-reduce': 0, - 'unicorn/no-await-expression-member': 0, - 'unicorn/no-console-spaces': 2, - 'unicorn/no-empty-file': 2, - 'unicorn/no-for-loop': 0, - 'unicorn/no-hex-escape': 2, - 'unicorn/no-instanceof-array': 2, - 'unicorn/no-keyword-prefix': [ - 2, - { - checkProperties: false, - disallowedPrefixes: ['class', 'new'], - onlyCamelCase: true - } - ], - 'unicorn/no-lonely-if': 0, - 'unicorn/no-nested-ternary': 0, - 'unicorn/no-new-array': 2, - 'unicorn/no-new-buffer': 2, - 'unicorn/no-null': 0, - 'unicorn/no-object-as-default-parameter': 2, - 'unicorn/no-process-exit': 2, - 'unicorn/no-static-only-class': 0, - 'unicorn/no-thenable': 2, - 'unicorn/no-this-assignment': 2, - 'unicorn/no-unreadable-array-destructuring': 2, - 'unicorn/no-unsafe-regex': 0, - 'unicorn/no-unused-properties': 2, - 'unicorn/no-useless-fallback-in-spread': 2, - 'unicorn/no-useless-length-check': 2, - 'unicorn/no-useless-promise-resolve-reject': 2, - 'unicorn/no-useless-spread': 2, - 'unicorn/no-useless-undefined': 2, - 'unicorn/no-zero-fractions': 2, - 'unicorn/number-literal-case': 2, - 'unicorn/numeric-separators-style': 2, - 'unicorn/prefer-add-event-listener': 2, - 'unicorn/prefer-array-find': 2, - 'unicorn/prefer-array-flat': [2, { functions: [] }], - 'unicorn/prefer-array-flat-map': 2, - 'unicorn/prefer-array-index-of': 2, - 'unicorn/prefer-array-some': 2, - 'unicorn/prefer-at': 0, - 'unicorn/prefer-code-point': 2, - 'unicorn/prefer-date-now': 2, - 'unicorn/prefer-default-parameters': 2, - 'unicorn/prefer-export-from': [2, { ignoreUsedVariables: true }], - 'unicorn/prefer-includes': 2, - 'unicorn/prefer-json-parse-buffer': 2, - 'unicorn/prefer-math-trunc': 2, - 'unicorn/prefer-module': 2, - 'unicorn/prefer-negative-index': 2, - 'unicorn/prefer-node-protocol': 2, - 'unicorn/prefer-number-properties': 2, - 'unicorn/prefer-object-from-entries': [2, { functions: [] }], - 'unicorn/prefer-optional-catch-binding': 2, - 'unicorn/prefer-prototype-methods': 2, - 'unicorn/prefer-reflect-apply': 2, - 'unicorn/prefer-regexp-test': 0, - 'unicorn/prefer-set-has': 2, - 'unicorn/prefer-spread': 2, - 'unicorn/prefer-string-replace-all': 0, - 'unicorn/prefer-string-slice': 2, - 'unicorn/prefer-string-starts-ends-with': 2, - 'unicorn/prefer-string-trim-start-end': 2, - 'unicorn/prefer-switch': 2, - 'unicorn/prefer-ternary': 2, - 'unicorn/prefer-top-level-await': 0, - 'unicorn/prefer-type-error': 2, - 'unicorn/prevent-abbreviations': 0, - 'unicorn/relative-url-style': [2, 'never'], - 'unicorn/require-array-join-separator': 2, - 'unicorn/require-number-to-fixed-digits-argument': 2, - 'unicorn/string-content': [ - 2, - { - patterns: { - '^http:\\/\\/': '^https:\\/\\/' - } - } - ], - 'unicorn/template-indent': [2, { indent: 2 }], - 'unicorn/text-encoding-identifier-case': 2, - 'unicorn/throw-new-error': 2 - }, + extends: ['plugin:prettier/recommended'], overrides: [ { - files: ['*.cjs', '*.cts', '*.mjs', '*.ts'], + extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], + files: '**/*.+(cjs|cts|js|jsx|mjs|mts|ts|tsx)', + globals: { + BufferEncoding: 'readonly', + Chai: 'readonly', + Console: 'readonly', + JSX: jsx ? 'readonly' : false, + LoadHook: 'readonly', + LoadHookContext: 'readonly', + LoadHookResult: 'readonly', + LoaderHookFormat: 'readonly', + NodeJS: 'readonly', + ResolveHook: 'readonly', + ResolveHookContext: 'readonly', + ResolveHookResult: 'readonly' + }, + parser: '@typescript-eslint/parser', + parserOptions: { + extraFileExtensions: [], + project: './tsconfig.json', + sourceType: require('./package.json').type, + tsconfigRootDir: process.cwd(), + warnOnUnsupportedTypeScriptVersion: true + }, + plugins: [ + '@typescript-eslint', + 'jsdoc', + 'node', + 'prettier', + 'promise', + 'unicorn' + ], rules: { + '@typescript-eslint/adjacent-overload-signatures': 2, + '@typescript-eslint/array-type': [ + 2, + { + default: 'array', + readonly: 'array' + } + ], '@typescript-eslint/await-thenable': 2, + '@typescript-eslint/ban-ts-comment': [ + 2, + { + minimumDescriptionLength: 3, + 'ts-expect-error': 'allow-with-description', + 'ts-ignore': 'allow-with-description', + 'ts-nocheck': 'allow-with-description' + } + ], + '@typescript-eslint/ban-tslint-comment': 2, + '@typescript-eslint/ban-types': [ + 2, + { + extendDefaults: true, + types: {} + } + ], + '@typescript-eslint/camelcase': 0, + '@typescript-eslint/class-literal-property-style': [2, 'getters'], + '@typescript-eslint/consistent-indexed-object-style': [2, 'record'], + '@typescript-eslint/consistent-type-assertions': [ + 2, + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow' + } + ], + '@typescript-eslint/consistent-type-definitions': 0, '@typescript-eslint/consistent-type-exports': [ 2, { fixMixedExportsWithInlineTypeSpecifier: true } ], + '@typescript-eslint/consistent-type-imports': 0, + '@typescript-eslint/default-param-last': 2, '@typescript-eslint/dot-notation': [ 2, { @@ -676,10 +122,90 @@ const config = { allowProtectedClassPropertyAccess: false } ], + '@typescript-eslint/explicit-function-return-type': 0, + '@typescript-eslint/explicit-member-accessibility': [ + 2, + { + accessibility: 'explicit', + overrides: { + constructors: 'no-public' + } + } + ], + '@typescript-eslint/init-declarations': 0, + '@typescript-eslint/lines-between-class-members': [ + 2, + 'always', + { + exceptAfterOverload: true, + exceptAfterSingleLine: false + } + ], + '@typescript-eslint/member-ordering': [ + 2, + { + default: { + memberTypes: [ + 'static-field', + 'decorated-field', + 'instance-field', + 'abstract-field', + 'constructor', + 'signature', + 'static-get', + 'static-set', + 'static-method', + 'decorated-get', + 'decorated-set', + 'decorated-method', + 'instance-get', + 'instance-set', + 'instance-method', + 'abstract-get', + 'abstract-set', + 'abstract-method' + ], + order: 'alphabetically' + } + } + ], + '@typescript-eslint/method-signature-style': [2, 'method'], + '@typescript-eslint/no-array-constructor': 2, '@typescript-eslint/no-base-to-string': [ 2, { - ignoredTypeNames: ['RegExp'] + ignoredTypeNames: ['Error', 'RegExp', 'URL', 'URLSearchParams'] + } + ], + '@typescript-eslint/no-confusing-non-null-assertion': 0, + '@typescript-eslint/no-confusing-void-expression': [ + 2, + { + ignoreArrowShorthand: true, + ignoreVoidOperator: true + } + ], + '@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, + { + allow: ['constructors', 'decoratedFunctions'] + } + ], + '@typescript-eslint/no-empty-interface': 0, + '@typescript-eslint/no-explicit-any': 0, + '@typescript-eslint/no-extra-non-null-assertion': 2, + '@typescript-eslint/no-extra-parens': 0, + '@typescript-eslint/no-extra-semi': 0, + '@typescript-eslint/no-extraneous-class': [ + 2, + { + allowConstructorOnly: false, + allowEmpty: true, + allowStaticOnly: true, + allowWithDecorator: true } ], '@typescript-eslint/no-floating-promises': [ @@ -691,6 +217,20 @@ const config = { ], '@typescript-eslint/no-for-in-array': 2, '@typescript-eslint/no-implied-eval': 2, + '@typescript-eslint/no-inferrable-types': 0, + '@typescript-eslint/no-invalid-this': [2, { capIsConstructor: true }], + '@typescript-eslint/no-invalid-void-type': [ + 2, + { + allowAsThisParameter: true, + allowInGenericTypeArguments: true + } + ], + '@typescript-eslint/no-loop-func': 2, + '@typescript-eslint/no-loss-of-precision': 2, + '@typescript-eslint/no-magic-numbers': 0, + '@typescript-eslint/no-meaningless-void-operator': 0, + '@typescript-eslint/no-misused-new': 2, '@typescript-eslint/no-misused-promises': [ 2, { @@ -698,9 +238,31 @@ const config = { checksVoidReturn: true } ], - + '@typescript-eslint/no-namespace': 0, + '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 2, + '@typescript-eslint/no-non-null-asserted-optional-chain': 0, + '@typescript-eslint/no-non-null-assertion': 0, + '@typescript-eslint/no-parameter-properties': 0, + '@typescript-eslint/no-redeclare': [ + 2, + { + builtinGlobals: true, + ignoreDeclarationMerge: true + } + ], '@typescript-eslint/no-redundant-type-constituents': 2, + '@typescript-eslint/no-require-imports': 2, + '@typescript-eslint/no-restricted-imports': 0, + '@typescript-eslint/no-shadow': 0, + '@typescript-eslint/no-this-alias': [ + 2, + { + allowDestructuring: false, + allowedNames: ['self'] + } + ], '@typescript-eslint/no-throw-literal': 2, + '@typescript-eslint/no-type-alias': 0, '@typescript-eslint/no-unnecessary-boolean-literal-compare': [ 2, { @@ -723,11 +285,58 @@ const config = { typesToIgnore: [] } ], + '@typescript-eslint/no-unnecessary-type-constraint': 2, '@typescript-eslint/no-unsafe-argument': 2, + '@typescript-eslint/no-unsafe-assignment': 0, '@typescript-eslint/no-unsafe-call': 2, '@typescript-eslint/no-unsafe-member-access': 2, '@typescript-eslint/no-unsafe-return': 2, + '@typescript-eslint/no-unused-expressions': [ + 2, + { + allowShortCircuit: true, + allowTaggedTemplates: true, + allowTernary: true, + enforceForJSX: true + } + ], + '@typescript-eslint/no-unused-vars': [ + 2, + { + args: 'after-used', + caughtErrors: 'all', + ignoreRestSiblings: false, + vars: 'all' + } + ], + '@typescript-eslint/no-use-before-define': [ + 2, + { + classes: true, + enums: true, + functions: true, + ignoreTypeReferences: true, + typedefs: true, + variables: true + } + ], + '@typescript-eslint/no-useless-constructor': 2, + '@typescript-eslint/no-useless-empty-export': 2, + '@typescript-eslint/no-var-requires': 2, '@typescript-eslint/non-nullable-type-assertion-style': 2, + '@typescript-eslint/padding-line-between-statements': 0, + '@typescript-eslint/prefer-as-const': 2, + '@typescript-eslint/prefer-enum-initializers': 0, + '@typescript-eslint/prefer-for-of': 2, + '@typescript-eslint/prefer-function-type': 2, + '@typescript-eslint/prefer-includes': 0, + '@typescript-eslint/prefer-literal-enum-member': [ + 2, + { + allowBitwiseExpressions: true + } + ], + '@typescript-eslint/prefer-namespace-keyword': 2, '@typescript-eslint/prefer-nullish-coalescing': [ 2, { @@ -737,10 +346,21 @@ const config = { ], '@typescript-eslint/prefer-optional-chain': 2, '@typescript-eslint/prefer-readonly': 2, + '@typescript-eslint/prefer-readonly-parameter-types': 0, '@typescript-eslint/prefer-reduce-type-parameter': 2, '@typescript-eslint/prefer-regexp-exec': 2, + '@typescript-eslint/prefer-return-this-type': 0, '@typescript-eslint/prefer-string-starts-ends-with': 2, + '@typescript-eslint/prefer-ts-expect-error': 2, '@typescript-eslint/promise-function-async': 2, + '@typescript-eslint/quotes': [ + 2, + 'single', + { + allowTemplateLiterals: true, + avoidEscape: true + } + ], '@typescript-eslint/require-array-sort-compare': 2, '@typescript-eslint/require-await': 2, '@typescript-eslint/restrict-plus-operands': [ @@ -761,6 +381,7 @@ const config = { } ], '@typescript-eslint/return-await': [2, 'in-try-catch'], + '@typescript-eslint/sort-type-union-intersection-members': 2, '@typescript-eslint/strict-boolean-expressions': [ 2, { @@ -775,7 +396,79 @@ const config = { } ], '@typescript-eslint/switch-exhaustiveness-check': 2, + '@typescript-eslint/triple-slash-reference': [ + 2, + { + lib: 'never', + path: 'never', + types: 'prefer-import' + } + ], + '@typescript-eslint/typedef': 0, '@typescript-eslint/unbound-method': [2, { ignoreStatic: true }], + '@typescript-eslint/unified-signatures': 2, + 'default-param-last': 0, + eqeqeq: 1, + 'init-declarations': 0, + 'jsdoc/check-access': 1, + 'jsdoc/check-alignment': 1, + 'jsdoc/check-examples': 0, + // https://github.com/gajus/eslint-plugin-jsdoc/issues/541 + 'jsdoc/check-indentation': 0, + 'jsdoc/check-line-alignment': 1, + 'jsdoc/check-param-names': [ + 1, + { + allowExtraTrailingParamDocs: false, + checkDestructured: true, + checkRestProperty: true, + disableExtraPropertyReporting: true, + enableFixer: true + } + ], + 'jsdoc/check-property-names': [1, { enableFixer: true }], + 'jsdoc/check-syntax': 1, + 'jsdoc/check-tag-names': [ + 1, + { + definedTags: ['experimental', 'next', 'visibleName'], + jsxTags: false + } + ], + 'jsdoc/check-types': [1, { unifyParentAndChildTypeChecks: true }], + 'jsdoc/check-values': 1, + 'jsdoc/empty-tags': 1, + 'jsdoc/implements-on-classes': 1, + '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, + 'jsdoc/no-multi-asterisks': [ + 1, + { + allowWhitespace: true, + preventAtEnd: true, + preventAtMiddleLines: true + } + ], + 'jsdoc/no-restricted-syntax': 0, + 'jsdoc/no-types': 0, + 'jsdoc/no-undefined-types': [1, { definedTypes: ['never', 'unknown'] }], + 'jsdoc/require-asterisk-prefix': [1, 'always'], + 'jsdoc/require-description': [ + 1, + { + checkConstructors: true, + checkGetters: true, + checkSetters: true, + descriptionStyle: 'body' + } + ], + 'jsdoc/require-description-complete-sentence': 0, + 'jsdoc/require-example': 0, 'jsdoc/require-file-overview': [ 1, { @@ -793,63 +486,426 @@ const config = { } } ], + 'jsdoc/require-hyphen-before-param-description': 1, + 'jsdoc/require-jsdoc': [ + 1, + { + checkConstructors: true, + checkGetters: true, + checkSetters: true, + enableFixer: true, + exemptEmptyConstructors: true, + exemptEmptyFunctions: false + } + ], + 'jsdoc/require-param': [ + 1, + { + autoIncrementBase: 0, + checkConstructors: true, + checkDestructured: true, + checkDestructuredRoots: true, + checkGetters: true, + checkRestProperty: true, + checkSetters: true, + enableFixer: true, + enableRestElementFixer: true, + enableRootFixer: true, + exemptedBy: ['inheritdoc', 'this'], + unnamedRootBase: ['param'], + useDefaultObjectProperties: true + } + ], + 'jsdoc/require-param-description': 1, + 'jsdoc/require-param-name': 1, + 'jsdoc/require-param-type': 1, + 'jsdoc/require-property': 1, + 'jsdoc/require-property-description': 1, + 'jsdoc/require-property-name': 1, + 'jsdoc/require-property-type': 1, + 'jsdoc/require-returns': [ + 1, + { + checkConstructors: false, + checkGetters: true, + forceRequireReturn: true, + forceReturnsWithAsync: true + } + ], + 'jsdoc/require-returns-check': [ + 1, + { + exemptAsync: false, + exemptGenerators: true, + reportMissingReturnForUndefinedTypes: true + } + ], + 'jsdoc/require-returns-description': 1, + 'jsdoc/require-returns-type': 1, + 'jsdoc/require-throws': 1, + 'jsdoc/require-yields': [ + 1, + { + forceRequireNext: true, + forceRequireYields: true, + next: true, + nextWithGeneratorTag: true, + withGeneratorTag: true + } + ], + 'jsdoc/require-yields-check': [ + 1, + { + checkGeneratorsOnly: true, + next: true + } + ], + 'jsdoc/sort-tags': 0, + 'jsdoc/tag-lines': [ + 1, + 'any', + { + count: 1, + dropEndLines: true, + noEndLines: false, + tags: {} + } + ], + 'jsdoc/valid-types': [1, { allowEmptyNamepaths: true }], + 'lines-between-class-members': 0, + 'no-array-constructor': 0, + 'no-case-declarations': 0, + 'no-duplicate-imports': 0, + 'no-empty': [2, { allowEmptyCatch: true }], + 'no-empty-function': 0, + 'no-ex-assign': 0, 'no-implied-eval': 0, + 'no-invalid-this': 0, + 'no-loop-func': 0, + 'no-loss-of-precision': 0, + 'no-magic-numbers': 0, + 'no-restricted-imports': 0, 'no-return-await': 0, - 'require-await': 0 + 'no-shadow': 0, + 'no-sparse-arrays': 0, + 'no-unused-expressions': 0, + 'no-unused-vars': 0, + 'no-use-before-define': 0, + 'no-useless-constructor': 0, + 'no-warning-comments': 0, + 'node/callback-return': [2, ['callback', 'cb', 'done', 'next']], + 'node/exports-style': [2, 'module.exports', { allowBatchAssign: true }], + 'node/file-extension-in-import': 0, + 'node/global-require': 0, + 'node/handle-callback-err': [2, '^(err|error)$'], + 'node/no-callback-literal': 2, + 'node/no-deprecated-api': 2, + 'node/no-exports-assign': 2, + 'node/no-extraneous-import': 0, + 'node/no-extraneous-require': 0, + 'node/no-missing-import': 0, + 'node/no-new-require': 2, + 'node/no-path-concat': 2, + 'node/no-process-env': 0, + 'node/no-process-exit': 0, + 'node/no-unpublished-bin': 0, + 'node/no-unpublished-import': 0, + 'node/no-unpublished-require': 0, + 'node/no-unsupported-features/es-builtins': 2, + 'node/no-unsupported-features/es-syntax': 0, + 'node/no-unsupported-features/node-builtins': 2, + 'node/prefer-global/buffer': 2, + 'node/prefer-global/console': 2, + 'node/prefer-global/process': 2, + 'node/prefer-global/text-decoder': 2, + 'node/prefer-global/text-encoder': 2, + 'node/prefer-global/url': 2, + 'node/prefer-global/url-search-params': 2, + 'node/prefer-promises/dns': 2, + 'node/prefer-promises/fs': 2, + 'node/process-exit-as-throw': 2, + 'node/shebang': 0, + 'padding-line-between-statements': 0, + 'prefer-arrow-callback': 0, + 'promise/always-return': 2, + 'promise/avoid-new': 2, + 'promise/catch-or-return': [2, { allowFinally: true, allowThen: true }], + 'promise/no-callback-in-promise': 2, + 'promise/no-native': 0, + 'promise/no-nesting': 2, + 'promise/no-new-statics': 2, + 'promise/no-promise-in-callback': 2, + 'promise/no-return-in-finally': 2, + 'promise/no-return-wrap': [2, { allowReject: false }], + 'promise/param-names': 2, + 'promise/prefer-await-to-callbacks': 2, + 'promise/prefer-await-to-then': 2, + 'promise/valid-params': 2, + quotes: 0, + 'require-await': 0, + 'sort-keys': [ + 2, + 'asc', + { + caseSensitive: true, + minKeys: 2, + natural: true + } + ], + 'unicorn/better-regex': [2, { sortCharacterClasses: true }], + 'unicorn/catch-error-name': [2, { name: 'e' }], + 'unicorn/consistent-destructuring': 2, + 'unicorn/custom-error-definition': 2, + '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/explicit-length-check': 2, + 'unicorn/filename-case': [ + 2, + { + cases: { kebabCase: true }, + ignore: [] + } + ], + 'unicorn/import-index': 2, + 'unicorn/import-style': [ + 2, + { + styles: { + chalk: { default: true }, + shelljs: { default: true } + } + } + ], + 'unicorn/new-for-builtins': 2, + 'unicorn/no-abusive-eslint-disable': 2, + 'unicorn/no-array-callback-reference': 2, + 'unicorn/no-array-for-each': 2, + 'unicorn/no-array-method-this-argument': 2, + 'unicorn/no-array-push-push': 2, + 'unicorn/no-array-reduce': 0, + 'unicorn/no-await-expression-member': 0, + 'unicorn/no-console-spaces': 2, + 'unicorn/no-empty-file': 2, + 'unicorn/no-for-loop': 0, + 'unicorn/no-hex-escape': 2, + 'unicorn/no-instanceof-array': 2, + 'unicorn/no-keyword-prefix': [ + 2, + { + checkProperties: false, + disallowedPrefixes: ['class', 'new'], + onlyCamelCase: true + } + ], + 'unicorn/no-lonely-if': 0, + 'unicorn/no-nested-ternary': 0, + 'unicorn/no-new-array': 2, + 'unicorn/no-new-buffer': 2, + 'unicorn/no-null': 0, + 'unicorn/no-object-as-default-parameter': 2, + 'unicorn/no-process-exit': 2, + 'unicorn/no-static-only-class': 0, + 'unicorn/no-thenable': 2, + 'unicorn/no-this-assignment': 2, + 'unicorn/no-unreadable-array-destructuring': 2, + 'unicorn/no-unsafe-regex': 0, + 'unicorn/no-unused-properties': 2, + 'unicorn/no-useless-fallback-in-spread': 2, + 'unicorn/no-useless-length-check': 2, + 'unicorn/no-useless-promise-resolve-reject': 2, + 'unicorn/no-useless-spread': 2, + 'unicorn/no-useless-undefined': 2, + 'unicorn/no-zero-fractions': 2, + 'unicorn/number-literal-case': 0, + // https://github.com/sindresorhus/eslint-plugin-unicorn/issues/2003 + 'unicorn/numeric-separators-style': 0, + 'unicorn/prefer-add-event-listener': 2, + 'unicorn/prefer-array-find': 2, + 'unicorn/prefer-array-flat': [2, { functions: [] }], + 'unicorn/prefer-array-flat-map': 2, + 'unicorn/prefer-array-index-of': 2, + 'unicorn/prefer-array-some': 2, + 'unicorn/prefer-at': 0, + 'unicorn/prefer-code-point': 2, + 'unicorn/prefer-date-now': 2, + 'unicorn/prefer-default-parameters': 2, + 'unicorn/prefer-export-from': [2, { ignoreUsedVariables: true }], + 'unicorn/prefer-includes': 2, + 'unicorn/prefer-json-parse-buffer': 0, + 'unicorn/prefer-math-trunc': 2, + 'unicorn/prefer-module': 2, + 'unicorn/prefer-negative-index': 2, + 'unicorn/prefer-node-protocol': 2, + 'unicorn/prefer-number-properties': 2, + 'unicorn/prefer-object-from-entries': [2, { functions: [] }], + 'unicorn/prefer-optional-catch-binding': 2, + 'unicorn/prefer-prototype-methods': 2, + 'unicorn/prefer-reflect-apply': 2, + 'unicorn/prefer-regexp-test': 0, + 'unicorn/prefer-set-has': 2, + 'unicorn/prefer-spread': 2, + 'unicorn/prefer-string-replace-all': 0, + 'unicorn/prefer-string-slice': 2, + 'unicorn/prefer-string-starts-ends-with': 2, + 'unicorn/prefer-string-trim-start-end': 2, + 'unicorn/prefer-switch': 2, + 'unicorn/prefer-ternary': 2, + 'unicorn/prefer-top-level-await': 0, + 'unicorn/prefer-type-error': 2, + 'unicorn/prevent-abbreviations': 0, + 'unicorn/relative-url-style': [2, 'never'], + 'unicorn/require-array-join-separator': 2, + 'unicorn/require-number-to-fixed-digits-argument': 2, + 'unicorn/string-content': [ + 2, + { + patterns: { + '^http:\\/\\/': '^https:\\/\\/' + } + } + ], + 'unicorn/template-indent': [2, { indent: 2 }], + 'unicorn/text-encoding-identifier-case': 2, + 'unicorn/throw-new-error': 2 } }, { - files: ['*.cjs', '*.md/*.cjs', '*.mjs'], + files: '**/*.+(cts|mts|ts)', rules: { - '@typescript-eslint/explicit-module-boundary-types': 0, - '@typescript-eslint/no-implicit-any-catch': 0 + '@typescript-eslint/explicit-module-boundary-types': [ + 2, + { + allowArgumentsExplicitlyTypedAsAny: true, + allowDirectConstAssertionInArrowFunctions: true, + allowHigherOrderFunctions: false, + allowTypedFunctionExpressions: true, + allowedNames: [], + shouldTrackReferences: true + } + ], + '@typescript-eslint/no-implicit-any-catch': [ + 2, + { + allowExplicitAny: false + } + ], + 'no-undef': 0 } }, { - files: ['*.cjs', '*.cts'], + files: '**/*.d.+(cts|mts|ts)', + rules: { + '@typescript-eslint/ban-types': 0, + '@typescript-eslint/triple-slash-reference': 0, + 'jsdoc/no-undefined-types': 0, + 'jsdoc/require-file-overview': 0, + 'no-var': 0, + 'unicorn/no-keyword-prefix': 0 + } + }, + { + files: '**/*.+(cjs|cts)', rules: { '@typescript-eslint/no-require-imports': 0, - '@typescript-eslint/no-var-requires': 0 + '@typescript-eslint/no-var-requires': 0, + 'unicorn/prefer-module': 0 } }, { - files: ['*.cts', '*.d.ts', '*.ts'], + files: '**/__mocks__/*.ts', rules: { - 'no-undef': 0 + '@typescript-eslint/require-await': 0 } }, { - files: ['*.cts'], + files: '**/__tests__/*.+(spec|spec-d).ts', + globals: { + afterAll: true, + afterEach: true, + assert: true, + beforeAll: true, + beforeEach: true, + chai: true, + describe: true, + expect: true, + faker: fs.existsSync('node_modules/@faker-js/faker/package.json'), + it: true, + pf: fs.existsSync('node_modules/pretty-format/package.json'), + suite: true, + test: true, + vi: true, + vitest: true + }, + plugins: ['chai-expect', 'jest-formatting'], rules: { - 'unicorn/prefer-module': 0 + '@typescript-eslint/consistent-indexed-object-style': 0, + '@typescript-eslint/no-base-to-string': 0, + '@typescript-eslint/no-empty-function': 0, + '@typescript-eslint/no-unused-expressions': 0, + '@typescript-eslint/prefer-ts-expect-error': 0, + '@typescript-eslint/restrict-template-expressions': 0, + '@typescript-eslint/unbound-method': 0, + 'chai-expect/missing-assertion': 2, + 'chai-expect/no-inner-compare': 2, + 'chai-expect/no-inner-literal': 2, + 'chai-expect/terminating-properties': [2, { properties: [] }], + 'jest-formatting/padding-around-after-all-blocks': 1, + 'jest-formatting/padding-around-after-each-blocks': 1, + 'jest-formatting/padding-around-before-all-blocks': 1, + 'jest-formatting/padding-around-before-each-blocks': 1, + 'jest-formatting/padding-around-describe-blocks': 1, + 'jest-formatting/padding-around-expect-groups': 1, + 'jest-formatting/padding-around-test-blocks': 1, + 'promise/prefer-await-to-callbacks': 0, + 'promise/valid-params': 0, + 'unicorn/consistent-destructuring': 0, + 'unicorn/error-message': 0, + 'unicorn/explicit-length-check': 0, + 'unicorn/no-array-for-each': 0, + 'unicorn/no-hex-escape': 0, + 'unicorn/no-useless-undefined': 0, + 'unicorn/prefer-at': 0, + 'unicorn/prefer-dom-node-append': 0, + 'unicorn/string-content': 0 } }, { - files: ['*.d.ts'], + files: '**/__tests__/*.spec-d.ts', + globals: { + assertType: true, + expectTypeOf: true + }, rules: { - '@typescript-eslint/ban-types': 0, - '@typescript-eslint/lines-between-class-members': 0, - '@typescript-eslint/no-redundant-type-constituents': 0, - '@typescript-eslint/triple-slash-reference': 0, - 'jsdoc/no-undefined-types': 0, - 'jsdoc/require-file-overview': 0, - 'no-var': 0, - 'unicorn/filename-case': 0, - 'unicorn/no-empty-file': 0, + '@typescript-eslint/ban-types': 0 + } + }, + { + files: ['**/enums/*.ts', '**/interfaces/*.ts', '**/types/*.ts'], + rules: { + 'jsdoc/check-indentation': 0, 'unicorn/no-keyword-prefix': 0 } }, { - files: ['*.gql'], extends: ['plugin:@graphql-eslint/operations-all'], + files: '**/*.gql', rules: { '@graphql-eslint/no-anonymous-operations': 0, '@graphql-eslint/require-id-when-available': 0 } }, { - files: ['*.json', '*.jsonc'], - extends: ['plugin:jsonc/prettier'], + files: '**/*.+(json|jsonc)', parser: 'jsonc-eslint-parser', plugins: ['jsonc'], rules: { @@ -924,19 +980,19 @@ const config = { } }, { - files: ['*.jsonc'], + files: ['**/*.jsonc', 'tsconfig*.json'], rules: { 'jsonc/no-comments': 0 } }, { - files: ['*.md'], + files: '**/*.md', parser: 'eslint-plugin-markdownlint/parser', plugins: ['markdown', 'markdownlint'], processor: 'markdown/markdown' }, { - files: ['*.yml'], + files: '**/*.yml', parser: 'yaml-eslint-parser', plugins: ['yml'], rules: { @@ -995,85 +1051,14 @@ const config = { } }, { - files: ['**/__tests__/*.spec.*', '**/__tests__/*.spec-d.ts'], - globals: { - afterAll: true, - afterEach: true, - assert: true, - assertType: true, - beforeAll: true, - beforeEach: true, - chai: true, - describe: true, - expect: true, - expectTypeOf: true, - faker: true, - it: true, - pf: true, - suite: true, - test: true, - vi: true, - vitest: true - }, - plugins: ['chai-expect', 'jest-formatting'], + files: '.eslintrc.*', rules: { - '@typescript-eslint/no-base-to-string': 0, - '@typescript-eslint/no-empty-function': 0, - '@typescript-eslint/no-unused-expressions': 0, - '@typescript-eslint/restrict-template-expressions': 0, - '@typescript-eslint/unbound-method': 0, - 'chai-expect/missing-assertion': 2, - 'chai-expect/no-inner-compare': 2, - 'chai-expect/no-inner-literal': 2, - 'chai-expect/terminating-properties': [2, { properties: [] }], - 'jest-formatting/padding-around-after-all-blocks': 1, - 'jest-formatting/padding-around-after-each-blocks': 1, - 'jest-formatting/padding-around-before-all-blocks': 1, - 'jest-formatting/padding-around-before-each-blocks': 1, - 'jest-formatting/padding-around-describe-blocks': 1, - 'jest-formatting/padding-around-expect-groups': 1, - 'jest-formatting/padding-around-test-blocks': 1, - 'promise/prefer-await-to-callbacks': 0, - 'promise/valid-params': 0, - 'unicorn/consistent-destructuring': 0, - 'unicorn/explicit-length-check': 0, - 'unicorn/no-array-for-each': 0, - 'unicorn/no-useless-undefined': 0, - 'unicorn/prefer-at': 0, - 'unicorn/prefer-dom-node-append': 0, + '@typescript-eslint/no-unsafe-member-access': 0, 'unicorn/string-content': 0 } }, { - files: ['**/enums/*.ts', '**/interfaces/*.ts', '**/types/*.ts'], - rules: { - 'jsdoc/check-indentation': 0, - 'unicorn/no-keyword-prefix': 0 - } - }, - { - files: ['.eslintrc.*'], - rules: { - 'sort-keys': 0, - 'unicorn/string-content': 0 - } - }, - { - files: ['.github/ISSUE_TEMPLATE/*.yml'], - overrides: [ - { - files: ['.github/ISSUE_TEMPLATE/config.yml'], - rules: { - 'yml/sort-keys': [ - 2, - { - order: { caseSensitive: true, type: 'asc' }, - pathPattern: '^$' - } - ] - } - } - ], + files: '.github/ISSUE_TEMPLATE/*.yml', rules: { 'yml/sort-keys': [ 2, @@ -1092,24 +1077,35 @@ const config = { } }, { - files: ['.github/dependabot.yml', '.github/workflows/*.yml'], + files: '.github/ISSUE_TEMPLATE/config.yml', rules: { - 'yml/sort-keys': 0 + 'yml/sort-keys': [ + 2, + { + order: { caseSensitive: true, type: 'asc' }, + pathPattern: '^$' + } + ] } }, { - files: ['.github/workflows/no-response-handler.yml', '.yarnrc.yml'], + files: ['.github/dependabot.yml', '.github/workflows/*.yml'], rules: { - 'yml/key-name-casing': 0 + 'yml/sort-keys': 0 } }, { - files: ['tsconfig*.json'], + files: ['.github/workflows/no-response-handler.yml', '.yarnrc.yml'], rules: { - 'jsonc/no-comments': 0 + 'yml/key-name-casing': 0 } } ], + plugins: ['prettier'], + reportUnusedDisableDirectives: true, + rules: { + 'prettier/prettier': [2, {}, { usePrettierrc: true }] + }, settings: { jsdoc: { augmentsExtendsReplacesDocs: true, @@ -1140,14 +1136,14 @@ const config = { name: 'namepath-defining', required: ['name', 'type'] }, - param: { - name: 'namepath-defining', - required: ['name', 'type'] - }, next: { name: 'namepath-defining', required: ['type'] }, + param: { + name: 'namepath-defining', + required: ['name', 'type'] + }, return: { name: 'namepath-defining', required: ['type'] diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 20ee5753..2a0a23e8 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -9,17 +9,17 @@ * @const config - ESLint configuration object */ const config = { - root: true, extends: ['./.eslintrc.base.cjs'], overrides: [ ...require('./.eslintrc.base.cjs').overrides, { - files: ['./src/toggle.ts'], + files: ['src/toggle.ts'], rules: { 'unicorn/prefer-json-parse-buffer': 0 } } - ] + ], + root: true } module.exports = config diff --git a/.gitattributes b/.gitattributes index f189ff3e..ac4b1285 100644 --- a/.gitattributes +++ b/.gitattributes @@ -24,13 +24,16 @@ *.hbs text eol=lf *.js text eol=lf *.json text eol=lf +*.json5 text eol=lf *.jsonc text eol=lf +*.jsx text eol=lf *.md text eol=lf diff=markdown *.mjs text eol=lf *.mts text eol=lf *.sh text eol=lf *.snap text eol=lf *.ts text eol=lf +*.tsx text eol=lf *.txt text eol=lf *.yml text eol=lf diff --git a/.github/.gitconfig b/.github/.gitconfig index 92aae385..e8c5ba3b 100644 --- a/.github/.gitconfig +++ b/.github/.gitconfig @@ -109,6 +109,9 @@ rebase = true [rebase] autoStash = true +[tag] +forceSignAnnotated = true + [url "git@github.com:"] insteadOf = gh: diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 20c1e644..79ffd08d 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -68,7 +68,7 @@ body: type: dropdown attributes: label: Operating system (environment) - description: Provide the operating system that you are using + description: Operating system you are using options: - linux - macos diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 60ccf2f7..4dcde772 100755 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,10 +2,6 @@ -## Tests - - - ## Linked issues + ## Submission checklist diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d64c3f6b..c4e6ce97 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,33 +4,32 @@ # # - https://docs.github.com/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates +--- version: 2 updates: - package-ecosystem: github-actions - directory: / - schedule: - interval: daily commit-message: prefix: ci include: scope + directory: / labels: - scope:dependencies - type:ci reviewers: - flex-development/dependabot-review - flexdevelopment - - package-ecosystem: npm - directory: / schedule: interval: daily + - package-ecosystem: npm commit-message: prefix: build include: scope - ignore: - - dependency-name: typescript + directory: / labels: - scope:dependencies - type:build reviewers: - flex-development/dependabot-review - flexdevelopment + schedule: + interval: daily diff --git a/.github/labels.yml b/.github/labels.yml index ed6d1d79..b2ba76c4 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -38,6 +38,10 @@ description: es modules color: 74cefc +- name: scope:install + description: package install + color: 74cefc + - name: scope:patches description: patches color: 74cefc @@ -105,6 +109,10 @@ description: superseded by different issue, pull request, or discussion color: e7034b +- name: status:triaged + description: bug confirmed + color: e7034b + - name: status:wip description: work in progress color: e7034b diff --git a/.github/workflows/integrity.yml b/.github/workflows/integrity.yml index 99e2f8b4..1abbba5b 100644 --- a/.github/workflows/integrity.yml +++ b/.github/workflows/integrity.yml @@ -2,6 +2,9 @@ # # References: # +# - https://docs.github.com/actions/learn-github-actions/expressions +# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#create +# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#pull_request # - https://github.com/actions/checkout # - https://yarnpkg.com/cli/dedupe diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2177c78f..6caea352 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -28,13 +28,10 @@ on: env: ARTIFACT: | ${{ github.event.inputs.artifact || github.event.release.assets[0].browser_download_url }} - NODE_VERSION: 16 - SCOPE: ${{ format('@{0}', github.repository_owner) }} + TAG: ${{ github.event.inputs.tag || github.event.release.tag_name }} jobs: metadata: runs-on: ubuntu-latest - env: - TAG: ${{ github.event.inputs.tag || github.event.release.tag_name }} outputs: dist-tag: ${{ steps.dist-tag.outputs.flag }} version: ${{ steps.version.outputs.result }} @@ -66,14 +63,19 @@ jobs: ${{ format('{0}/{1}/pkgs/npm/{2}', github.server_url, github.repository, github.event.repository.name) }} steps: + - id: checkout + name: Checkout ${{ env.TAG }} + uses: actions/checkout@v3.3.0 + with: + ref: ${{ format('refs/tags/{0}', env.TAG) }} - id: npmrc name: Setup .npmrc file uses: actions/setup-node@v3.5.1 with: always-auth: true - node-version: ${{ env.NODE_VERSION }} + node-version-file: .nvmrc registry-url: https://npm.pkg.github.com - scope: ${{ env.SCOPE }} + scope: ${{ github.repository_owner }} - id: publish name: Publish package run: npm publish $ARTIFACT ${{ needs.metadata.outputs.dist-tag }} @@ -88,14 +90,19 @@ jobs: ${{ format('https://npmjs.com/package/@{0}/v/{1}', github.repository, needs.metadata.outputs.version) }} steps: + - id: checkout + name: Checkout ${{ env.TAG }} + uses: actions/checkout@v3.3.0 + with: + ref: ${{ format('refs/tags/{0}', env.TAG) }} - id: npmrc name: Setup .npmrc file uses: actions/setup-node@v3.5.1 with: always-auth: true - node-version: ${{ env.NODE_VERSION }} + node-version-file: .nvmrc registry-url: https://registry.npmjs.org - scope: ${{ env.SCOPE }} + scope: ${{ github.repository_owner }} - id: publish name: Publish package run: npm publish $ARTIFACT ${{ needs.metadata.outputs.dist-tag }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index abf84285..50aa449d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -116,7 +116,7 @@ jobs: NODE_ENV: production - id: release-notes name: Generate release notes - run: yarn conventional-changelog -o $NOTES_FILE + run: yarn changelog -w -o $NOTES_FILE env: NODE_NO_WARNINGS: 1 - id: tag diff --git a/.gitignore b/.gitignore index 152598f9..830b0f02 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,11 @@ # macOS # ------------------------------------------------------------------------------ -.DS_* -._* +**/._* +**/.DS_* # Node # ------------------------------------------------------------------------------ +**/node_modules/ *.log *.pid *.pid.lock @@ -14,12 +15,12 @@ .npm .yarn-integrity logs -node_modules/ npm-debug.log* pids report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json yarn-debug.log* yarn-error.log* +!**/__fixtures__/**/node_modules/ # Yarn 2 (Not using Zero-Installs) # https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored @@ -33,7 +34,8 @@ yarn-error.log* # Environment # ------------------------------------------------------------------------------ -.env*.local +**/.env +**/.env*.local # TypeScript # ------------------------------------------------------------------------------ @@ -41,21 +43,32 @@ yarn-error.log* # Testing # ------------------------------------------------------------------------------ +**/*config.*.timestamp* +**/__tests__/report.json +**/coverage/ +**/tsconfig*temp.json *.lcov -__tests__/report.json -coverage/ -tsconfig.temp.json -vitest.config.*.timestamp-*.mjs +codecov # ESLint # ------------------------------------------------------------------------------ -.eslintcache +**/.eslintcache # Builds # ------------------------------------------------------------------------------ -dist/ -!typings/**/dist/ +**/.temp/ +**/dist/ +!**/__fixtures__/**/dist/ +!**/typings/**/dist/ + +# Releases +# ------------------------------------------------------------------------------ +RELEASE_NOTES.md + +# Vercel +# ------------------------------------------------------------------------------ +**/.vercel/ # Misc # ------------------------------------------------------------------------------ -scratch.ts +**/scratch.ts diff --git a/.husky/pre-commit b/.husky/pre-commit index 5c91c6da..68a9d1fd 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -6,6 +6,4 @@ # # - https://github.com/okonet/lint-staged#command-line-flags -yarn typecheck -yarn check:types:build -lint-staged +cross-env LINT_STAGED=1 lint-staged --config=.lintstagedrc.json --relative --verbose diff --git a/.husky/pre-push b/.husky/pre-push index e3094964..1e41a157 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,11 +1,5 @@ #!/bin/sh # Pre-Push Workflow -# -# References: -# -# - https://vitest.dev/guide/cli.html#changed -yarn typecheck -yarn test --changed HEAD^ yarn build diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 126e85a8..8b992c0f 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,5 +1,9 @@ { - "*": ["yarn check:format", "yarn check:spelling"], - "**/*.{cjs,cts,gql,json,jsonc,md,mjs,ts,yml}": ["yarn check:lint"], - "**/yarn.lock": "yarn dedupe --check" + "*": ["prettier --check", "cspell lint --color --no-progress --relative $@"], + "**/*.{cjs,gql,json,jsonc,md,mjs,mts,ts,yml}": [ + "eslint --exit-on-fatal-error" + ], + "**/*.{cjs,mjs,mts,ts}": "vitest typecheck --changed --run", + "**/yarn.lock": "yarn dedupe --check", + "src/**/*.ts": "vitest --changed --coverage --run" } diff --git a/.markdownlint.jsonc b/.markdownlint.jsonc index b8b93b8d..b5f45f35 100644 --- a/.markdownlint.jsonc +++ b/.markdownlint.jsonc @@ -1,3 +1,5 @@ +// MARKDOWNLINT CONFIGURATION +// https://github.com/DavidAnson/vscode-markdownlint#configure { "MD001": true, "MD002": { @@ -50,8 +52,7 @@ }, "MD023": true, "MD024": { - "allow_different_nesting": false, - "siblings_only": false + "siblings_only": true }, "MD025": { "front_matter_title": "^\\s*title\\s*[:=]", diff --git a/.markdownlintignore b/.markdownlintignore index 10cb713c..4a4c8c79 100644 --- a/.markdownlintignore +++ b/.markdownlintignore @@ -4,3 +4,4 @@ # DIRECTORIES & FILES **/CHANGELOG.md **/LICENSE.md +**/RELEASE_NOTES.md diff --git a/.nvmrc b/.nvmrc index b6a7d89c..d6b24041 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16 +19 diff --git a/.prettierignore b/.prettierignore index b20a187c..8ab88ab4 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,20 +5,19 @@ **/*.hbs **/*.md **/*.snap -**/.gitignore -**/.gitkeep -**/.npmignore -.eslintcache -.eslintignore -.husky/_/* -.markdownlintignore -.nvmrc -.prettierignore -.yarn/* -Brewfile -__tests__/report.json -coverage/* -dist/* -node_modules/* -tsconfig.temp.json +**/*config.*.timestamp* +**/.temp/ +**/.vercel/ +**/__tests__/report.json +**/coverage/ +**/dist/ +**/node_modules/ +**/tsconfig*temp.json +.husky/_/ +.yarn/ yarn.lock + +# NEGATIONS +!**/__fixtures__/**/dist/ +!**/__fixtures__/**/node_modules/ +!**/typings/**/dist/ diff --git a/.prettierrc.json b/.prettierrc.json index 83ddc5f1..ed5a4615 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -8,13 +8,18 @@ "overrides": [ { "files": [ - "*.sh", - "*.txt", + "**/*.sh", + "**/*.txt", + "**/.*ignore", + "**/.*rc", + "**/.env*", + "**/.eslintcache", + "**/.git*", ".editorconfig", - ".env*", ".husky/commit-msg", ".husky/pre-commit", - ".husky/pre-push" + ".husky/pre-push", + "Brewfile" ], "options": { "functionNextLine": true, diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..dcf4f800 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,5 @@ +// https://code.visualstudio.com/docs/editor/debugging +{ + "version": "0.2.0", + "configurations": [] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 847c5c08..000b30eb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,7 @@ { + "[dotenv]": { + "editor.defaultFormatter": "foxundermoon.shell-format" + }, "[handlebars]": { "editor.defaultFormatter": "Greenbyte.handlebars-preview", "editor.rulers": [ @@ -14,8 +17,12 @@ "editor.defaultFormatter": "foxundermoon.shell-format" }, "[jest-snapshot]": { - "editor.rulers": [130], - "editor.wordWrap": "wordWrapColumn", + "editor.rulers": [ + { + "color": "var(--vscode-editorRuler-foreground)", + "column": 130 + } + ], "editor.wordWrapColumn": 130, "rewrap.wrappingColumn": 130 }, @@ -34,6 +41,7 @@ "editor.defaultFormatter": "foxundermoon.shell-format" }, "[shellscript]": { + "editor.defaultFormatter": "foxundermoon.shell-format", "editor.rulers": [ { "color": "var(--vscode-editorRuler-foreground)", @@ -54,7 +62,57 @@ "editor.wordWrapColumn": 100, "rewrap.wrappingColumn": 100 }, + "better-comments.highlightPlainText": true, + "better-comments.tags": [ + { + "backgroundColor": "transparent", + "bold": false, + "color": "#ff2d00", + "italic": false, + "strikethrough": false, + "tag": "!", + "underline": false + }, + { + "backgroundColor": "transparent", + "bold": false, + "color": "#3498db", + "italic": false, + "strikethrough": false, + "tag": "?", + "underline": false + }, + { + "backgroundColor": "transparent", + "bold": false, + "color": "#474747", + "italic": false, + "strikethrough": true, + "tag": "//", + "underline": false + }, + { + "backgroundColor": "transparent", + "bold": false, + "color": "#ff8c00", + "italic": false, + "strikethrough": false, + "tag": "todo", + "underline": false + }, + { + "backgroundColor": "transparent", + "bold": false, + "color": "#98c379", + "italic": false, + "strikethrough": false, + "tag": "*", + "underline": false + } + ], + "breadcrumbs.enabled": true, "cSpell.enabled": true, + "debug.showBreakpointsInOverviewRuler": true, "diffEditor.ignoreTrimWhitespace": false, "diffEditor.renderSideBySide": false, "editor.acceptSuggestionOnEnter": "smart", @@ -68,13 +126,13 @@ }, "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.detectIndentation": false, - "editor.renderFinalNewline": false, "editor.formatOnPaste": true, "editor.formatOnSave": true, "editor.formatOnType": true, "editor.guides.indentation": true, "editor.multiCursorModifier": "ctrlCmd", "editor.overviewRulerBorder": true, + "editor.renderFinalNewline": "off", "editor.rulers": [ { // microsoft/vscode#166261 @@ -92,25 +150,31 @@ "emmet.showExpandedAbbreviation": "always", "emmet.triggerExpansionOnTab": true, "eslint.enable": true, - "eslint.nodePath": "./node_modules/eslint", + "eslint.lintTask.enable": true, + "eslint.nodePath": "node_modules/.bin/eslint", "eslint.options": { "extensions": [ "cjs", "cts", "gql", + "js", "json", + "json5", "jsonc", "md", "mjs", + "mts", "ts", "yml" ], - "overrideConfigFile": "./.eslintrc.cjs" + "overrideConfigFile": ".eslintrc.cjs" }, + "eslint.packageManager": "yarn", "eslint.validate": [ "graphql", "javascript", "json", + "json5", "jsonc", "markdown", "typescript", @@ -120,6 +184,7 @@ "*.snap": "jest-snapshot", ".env.zsh": "shellscript", ".markdownlintignore": "ignore", + ".npmrc": "ini", "commit-msg": "shellscript", "pre-commit": "shellscript", "pre-push": "shellscript" @@ -133,30 +198,106 @@ "files.trimTrailingWhitespace": true, "git.autofetch": true, "git.enableSmartCommit": true, + "githubPullRequests.pullBranch": "never", + "javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false, + "javascript.format.semicolons": "remove", + "javascript.inlayHints.enumMemberValues.enabled": true, + "javascript.preferences.importModuleSpecifierEnding": "minimal", + "javascript.preferences.quoteStyle": "single", + "javascript.preferences.useAliasesForRenames": true, + "javascript.suggest.completeFunctionCalls": true, + "javascript.suggest.completeJSDocs": true, + "javascript.suggest.includeAutomaticOptionalChainCompletions": true, + "javascript.suggest.includeCompletionsForImportStatements": true, + "javascript.suggest.jsdoc.generateReturns": true, + "javascript.suggest.paths": true, + "javascript.updateImportsOnFileMove.enabled": "always", + "javascript.validate.enable": true, "markdown.extension.toc.slugifyMode": "github", "markdown.extension.toc.updateOnSave": false, - "markdownlint.ignore": "./.markdownlintignore", + "markdownlint.ignore": ".markdownlintignore", "markdownlint.lintWorkspaceGlobs": [ "**/*.md", "!**/node_modules", "!**/.git", "!**/CHANGELOG.md", - "!**/LICENSE.md" + "!**/LICENSE.md", + "!**/RELEASE_NOTES.md" ], "npm-intellisense.scanDevDependencies": true, - "prettier.enable": false, + "prettier.configPath": ".prettierrc.json", + "prettier.enable": true, + "prettier.ignorePath": ".prettierignore", + "prettier.prettierPath": "node_modules/prettier", "prettier.useEditorConfig": true, + "rewrap.autoWrap.enabled": true, + "rewrap.doubleSentenceSpacing": true, + "rewrap.reformat": true, + "rewrap.wrappingColumn": 80, "shellformat.flag": "-ci -fn -i=2 -sr", "shellformat.useEditorConfig": true, + "terminal.integrated.copyOnSelection": true, + "todo-tree.filtering.ignoreGitSubmodules": true, + "todo-tree.filtering.includeHiddenFiles": false, + "todo-tree.filtering.useBuiltInExcludes": "file and search excludes", + "todo-tree.general.debug": true, + "todo-tree.general.revealBehaviour": "start of todo", + "todo-tree.general.showActivityBarBadge": true, + "todo-tree.general.showIconsInsteadOfTagsInStatusBar": true, + "todo-tree.general.statusBar": "current file", + "todo-tree.general.statusBarClickBehaviour": "reveal", + "todo-tree.general.tags": [ + "BUG", + "FIXME", + "HACK", + "TODO", + "[ ]", + "[x]", + "@todo", + "describe.skip", + "describe.todo", + "it.skip", + "it.todo" + ], + "todo-tree.highlights.enabled": false, + "todo-tree.regex.regex": "((/?\\*|//|#|