@mnaoumov/typescript-dev-toolkit 0.0.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +15 -1
- package/bundlers/esbuild-impl/change-extension-plugin/package.json +6 -0
- package/bundlers/esbuild-impl/custom-esbuild-options-plugin/package.json +6 -0
- package/bundlers/esbuild-impl/fix-esm-plugin/package.json +6 -0
- package/bundlers/esbuild-impl/index/package.json +6 -0
- package/bundlers/esbuild-impl/package.json +6 -0
- package/bundlers/esbuild-impl/preprocess-plugin/package.json +6 -0
- package/bundlers/esbuild-impl/svelte-wrapper-plugin/package.json +6 -0
- package/bundlers/index/package.json +6 -0
- package/bundlers/package.json +6 -0
- package/dist/lib/cjs/build.cjs +191 -0
- package/dist/lib/cjs/build.d.cts +59 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/change-extension-plugin.cjs +139 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/change-extension-plugin.d.cts +25 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/custom-esbuild-options-plugin.cjs +96 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/custom-esbuild-options-plugin.d.cts +14 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/fix-esm-plugin.cjs +106 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/fix-esm-plugin.d.cts +13 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/index.cjs +111 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/index.d.cts +6 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/preprocess-plugin.cjs +211 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/preprocess-plugin.d.cts +143 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/svelte-wrapper-plugin.cjs +129 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/svelte-wrapper-plugin.d.cts +14 -0
- package/dist/lib/cjs/bundlers/index.cjs +99 -0
- package/dist/lib/cjs/bundlers/index.d.cts +2 -0
- package/dist/lib/cjs/check-project-types.cjs +163 -0
- package/dist/lib/cjs/check-project-types.d.cts +92 -0
- package/dist/lib/cjs/cli-utils.cjs +276 -0
- package/dist/lib/cjs/cli-utils.d.cts +123 -0
- package/dist/lib/cjs/code-generator.cjs +96 -0
- package/dist/lib/cjs/code-generator.d.cts +14 -0
- package/dist/lib/cjs/commitlint-config.cjs +110 -0
- package/dist/lib/cjs/commitlint-config.d.cts +14 -0
- package/dist/lib/cjs/commitlint-forbidden-patterns.cjs +110 -0
- package/dist/lib/cjs/commitlint-forbidden-patterns.d.cts +37 -0
- package/dist/lib/cjs/commitlint-spellcheck-header.cjs +126 -0
- package/dist/lib/cjs/commitlint-spellcheck-header.d.cts +40 -0
- package/dist/lib/cjs/env-toggle.cjs +133 -0
- package/dist/lib/cjs/env-toggle.d.cts +42 -0
- package/dist/lib/cjs/exec.cjs +455 -0
- package/dist/lib/cjs/exec.d.cts +162 -0
- package/dist/lib/cjs/forbidden-patterns.cjs +157 -0
- package/dist/lib/cjs/forbidden-patterns.d.cts +57 -0
- package/dist/lib/cjs/formatters/dprint.cjs +108 -0
- package/dist/lib/cjs/formatters/dprint.d.cts +33 -0
- package/dist/lib/cjs/formatters/index.cjs +99 -0
- package/dist/lib/cjs/formatters/index.d.cts +2 -0
- package/dist/lib/cjs/fs.cjs +123 -0
- package/dist/lib/cjs/fs.d.cts +80 -0
- package/dist/lib/cjs/gate.cjs +140 -0
- package/dist/lib/cjs/gate.d.cts +93 -0
- package/dist/lib/cjs/git.cjs +109 -0
- package/dist/lib/cjs/git.d.cts +37 -0
- package/dist/lib/cjs/index.cjs +186 -0
- package/dist/lib/cjs/index.d.cts +35 -0
- package/dist/lib/cjs/json.cjs +141 -0
- package/dist/lib/cjs/json.d.cts +102 -0
- package/dist/lib/cjs/library-build.cjs +475 -0
- package/dist/lib/cjs/library-build.d.cts +97 -0
- package/dist/lib/cjs/linters/cspell-content.cjs +124 -0
- package/dist/lib/cjs/linters/cspell-content.d.cts +46 -0
- package/dist/lib/cjs/linters/cspell.cjs +103 -0
- package/dist/lib/cjs/linters/cspell.d.cts +36 -0
- package/dist/lib/cjs/linters/eslint-agnostic-core-boundary.cjs +94 -0
- package/dist/lib/cjs/linters/eslint-agnostic-core-boundary.d.cts +49 -0
- package/dist/lib/cjs/linters/eslint-config.cjs +1068 -0
- package/dist/lib/cjs/linters/eslint-config.d.cts +123 -0
- package/dist/lib/cjs/linters/eslint-no-restricted-syntax.cjs +130 -0
- package/dist/lib/cjs/linters/eslint-no-restricted-syntax.d.cts +27 -0
- package/dist/lib/cjs/linters/eslint-rules/in-house-plugin.cjs +116 -0
- package/dist/lib/cjs/linters/eslint-rules/in-house-plugin.d.cts +26 -0
- package/dist/lib/cjs/linters/eslint-rules/index.cjs +132 -0
- package/dist/lib/cjs/linters/eslint-rules/index.d.cts +13 -0
- package/dist/lib/cjs/linters/eslint-rules/no-async-callback-to-unsafe-return.cjs +175 -0
- package/dist/lib/cjs/linters/eslint-rules/no-async-callback-to-unsafe-return.d.cts +10 -0
- package/dist/lib/cjs/linters/eslint-rules/no-unresolved-jsdoc-link.cjs +290 -0
- package/dist/lib/cjs/linters/eslint-rules/no-unresolved-jsdoc-link.d.cts +10 -0
- package/dist/lib/cjs/linters/eslint-rules/no-unused-params-members.cjs +265 -0
- package/dist/lib/cjs/linters/eslint-rules/no-unused-params-members.d.cts +41 -0
- package/dist/lib/cjs/linters/eslint-rules/no-used-underscore-variables.cjs +134 -0
- package/dist/lib/cjs/linters/eslint-rules/no-used-underscore-variables.d.cts +20 -0
- package/dist/lib/cjs/linters/eslint-rules/params-options-name-match.cjs +217 -0
- package/dist/lib/cjs/linters/eslint-rules/params-options-name-match.d.cts +36 -0
- package/dist/lib/cjs/linters/eslint-rules/prefer-noop-async.cjs +126 -0
- package/dist/lib/cjs/linters/eslint-rules/prefer-noop-async.d.cts +10 -0
- package/dist/lib/cjs/linters/eslint-rules/readonly-params-options-result-members.cjs +125 -0
- package/dist/lib/cjs/linters/eslint-rules/readonly-params-options-result-members.d.cts +20 -0
- package/dist/lib/cjs/linters/eslint-rules/require-method-template.cjs +181 -0
- package/dist/lib/cjs/linters/eslint-rules/require-method-template.d.cts +14 -0
- package/dist/lib/cjs/linters/eslint-rules/require-super-call.cjs +217 -0
- package/dist/lib/cjs/linters/eslint-rules/require-super-call.d.cts +10 -0
- package/dist/lib/cjs/linters/eslint-rules/rule-tester-helper.cjs +92 -0
- package/dist/lib/cjs/linters/eslint-rules/rule-tester-helper.d.cts +18 -0
- package/dist/lib/cjs/linters/eslint-rules/ts-estree-node.cjs +92 -0
- package/dist/lib/cjs/linters/eslint-rules/ts-estree-node.d.cts +23 -0
- package/dist/lib/cjs/linters/eslint-types/@types/@eslint-community__eslint-plugin-eslint-comments__configs.d.cts +20 -0
- package/dist/lib/cjs/linters/eslint-types/@types/eslint-plugin-verify-tsdoc.d.cts +17 -0
- package/dist/lib/cjs/linters/eslint.cjs +122 -0
- package/dist/lib/cjs/linters/eslint.d.cts +35 -0
- package/dist/lib/cjs/linters/index.cjs +138 -0
- package/dist/lib/cjs/linters/index.d.cts +15 -0
- package/dist/lib/cjs/linters/lint-ignores.cjs +91 -0
- package/dist/lib/cjs/linters/lint-ignores.d.cts +30 -0
- package/dist/lib/cjs/linters/markdownlint-cli2-config.cjs +169 -0
- package/dist/lib/cjs/linters/markdownlint-cli2-config.d.cts +11 -0
- package/dist/lib/cjs/linters/markdownlint-content.cjs +120 -0
- package/dist/lib/cjs/linters/markdownlint-content.d.cts +47 -0
- package/dist/lib/cjs/linters/markdownlint-ignores.cjs +95 -0
- package/dist/lib/cjs/linters/markdownlint-ignores.d.cts +35 -0
- package/dist/lib/cjs/linters/markdownlint-rules/index.cjs +99 -0
- package/dist/lib/cjs/linters/markdownlint-rules/index.d.cts +2 -0
- package/dist/lib/cjs/linters/markdownlint-rules/no-soft-break-in-paragraph.cjs +152 -0
- package/dist/lib/cjs/linters/markdownlint-rules/no-soft-break-in-paragraph.d.cts +35 -0
- package/dist/lib/cjs/linters/markdownlint-types/@types/markdownlint-cli2-config-schema.d.cts +1344 -0
- package/dist/lib/cjs/linters/markdownlint-types/@types/markdownlint-cli2.d.cts +67 -0
- package/dist/lib/cjs/linters/markdownlint.cjs +151 -0
- package/dist/lib/cjs/linters/markdownlint.d.cts +32 -0
- package/dist/lib/cjs/linters/over-exposure.cjs +685 -0
- package/dist/lib/cjs/linters/over-exposure.d.cts +357 -0
- package/dist/lib/cjs/nano-staged-config.cjs +148 -0
- package/dist/lib/cjs/nano-staged-config.d.cts +54 -0
- package/dist/lib/cjs/npm-publish.cjs +93 -0
- package/dist/lib/cjs/npm-publish.d.cts +19 -0
- package/dist/lib/cjs/npm-run.cjs +120 -0
- package/dist/lib/cjs/npm-run.d.cts +34 -0
- package/dist/lib/cjs/npm.cjs +200 -0
- package/dist/lib/cjs/npm.d.cts +168 -0
- package/dist/lib/cjs/package-lock-integrity.cjs +134 -0
- package/dist/lib/cjs/package-lock-integrity.d.cts +38 -0
- package/dist/lib/cjs/package-manager.cjs +291 -0
- package/dist/lib/cjs/package-manager.d.cts +93 -0
- package/dist/lib/cjs/released-issues.cjs +178 -0
- package/dist/lib/cjs/released-issues.d.cts +79 -0
- package/dist/lib/cjs/repo-paths.cjs +167 -0
- package/dist/lib/cjs/repo-paths.d.cts +318 -0
- package/dist/lib/cjs/root.cjs +150 -0
- package/dist/lib/cjs/root.d.cts +107 -0
- package/dist/lib/cjs/test-runners/index.cjs +102 -0
- package/dist/lib/cjs/test-runners/index.d.cts +3 -0
- package/dist/lib/cjs/test-runners/vitest-config.cjs +126 -0
- package/dist/lib/cjs/test-runners/vitest-config.d.cts +90 -0
- package/dist/lib/cjs/test-runners/vitest.cjs +115 -0
- package/dist/lib/cjs/test-runners/vitest.d.cts +52 -0
- package/dist/lib/cjs/validate-declarations.cjs +120 -0
- package/dist/lib/cjs/validate-declarations.d.cts +37 -0
- package/dist/lib/cjs/version.cjs +758 -0
- package/dist/lib/cjs/version.d.cts +418 -0
- package/dist/lib/esm/build.d.mts +59 -0
- package/dist/lib/esm/build.mjs +165 -0
- package/dist/lib/esm/bundlers/esbuild-impl/change-extension-plugin.d.mts +25 -0
- package/dist/lib/esm/bundlers/esbuild-impl/change-extension-plugin.mjs +101 -0
- package/dist/lib/esm/bundlers/esbuild-impl/custom-esbuild-options-plugin.d.mts +14 -0
- package/dist/lib/esm/bundlers/esbuild-impl/custom-esbuild-options-plugin.mjs +59 -0
- package/dist/lib/esm/bundlers/esbuild-impl/fix-esm-plugin.d.mts +13 -0
- package/dist/lib/esm/bundlers/esbuild-impl/fix-esm-plugin.mjs +69 -0
- package/dist/lib/esm/bundlers/esbuild-impl/index.d.mts +6 -0
- package/dist/lib/esm/bundlers/esbuild-impl/index.mjs +60 -0
- package/dist/lib/esm/bundlers/esbuild-impl/preprocess-plugin.d.mts +143 -0
- package/dist/lib/esm/bundlers/esbuild-impl/preprocess-plugin.mjs +176 -0
- package/dist/lib/esm/bundlers/esbuild-impl/svelte-wrapper-plugin.d.mts +14 -0
- package/dist/lib/esm/bundlers/esbuild-impl/svelte-wrapper-plugin.mjs +82 -0
- package/dist/lib/esm/bundlers/index.d.mts +2 -0
- package/dist/lib/esm/bundlers/index.mjs +52 -0
- package/dist/lib/esm/check-project-types.d.mts +92 -0
- package/dist/lib/esm/check-project-types.mjs +123 -0
- package/dist/lib/esm/cli-utils.d.mts +123 -0
- package/dist/lib/esm/cli-utils.mjs +225 -0
- package/dist/lib/esm/code-generator.d.mts +14 -0
- package/dist/lib/esm/code-generator.mjs +59 -0
- package/dist/lib/esm/commitlint-config.d.mts +14 -0
- package/dist/lib/esm/commitlint-config.mjs +79 -0
- package/dist/lib/esm/commitlint-forbidden-patterns.d.mts +37 -0
- package/dist/lib/esm/commitlint-forbidden-patterns.mjs +75 -0
- package/dist/lib/esm/commitlint-spellcheck-header.d.mts +40 -0
- package/dist/lib/esm/commitlint-spellcheck-header.mjs +87 -0
- package/dist/lib/esm/env-toggle.d.mts +42 -0
- package/dist/lib/esm/env-toggle.mjs +84 -0
- package/dist/lib/esm/exec.d.mts +162 -0
- package/dist/lib/esm/exec.mjs +410 -0
- package/dist/lib/esm/forbidden-patterns.d.mts +57 -0
- package/dist/lib/esm/forbidden-patterns.mjs +108 -0
- package/dist/lib/esm/formatters/dprint.d.mts +33 -0
- package/dist/lib/esm/formatters/dprint.mjs +75 -0
- package/dist/lib/esm/formatters/index.d.mts +2 -0
- package/dist/lib/esm/formatters/index.mjs +52 -0
- package/dist/lib/esm/fs.d.mts +80 -0
- package/dist/lib/esm/fs.mjs +89 -0
- package/dist/lib/esm/gate.d.mts +93 -0
- package/dist/lib/esm/gate.mjs +106 -0
- package/dist/lib/esm/git.d.mts +37 -0
- package/dist/lib/esm/git.mjs +72 -0
- package/dist/lib/esm/index.d.mts +35 -0
- package/dist/lib/esm/index.mjs +110 -0
- package/dist/lib/esm/json.d.mts +102 -0
- package/dist/lib/esm/json.mjs +106 -0
- package/dist/lib/esm/library-build.d.mts +97 -0
- package/dist/lib/esm/library-build.mjs +435 -0
- package/dist/lib/esm/linters/cspell-content.d.mts +46 -0
- package/dist/lib/esm/linters/cspell-content.mjs +87 -0
- package/dist/lib/esm/linters/cspell.d.mts +36 -0
- package/dist/lib/esm/linters/cspell.mjs +69 -0
- package/dist/lib/esm/linters/eslint-agnostic-core-boundary.d.mts +49 -0
- package/dist/lib/esm/linters/eslint-agnostic-core-boundary.mjs +57 -0
- package/dist/lib/esm/linters/eslint-config.d.mts +123 -0
- package/dist/lib/esm/linters/eslint-config.mjs +1022 -0
- package/dist/lib/esm/linters/eslint-no-restricted-syntax.d.mts +27 -0
- package/dist/lib/esm/linters/eslint-no-restricted-syntax.mjs +93 -0
- package/dist/lib/esm/linters/eslint-rules/in-house-plugin.d.mts +26 -0
- package/dist/lib/esm/linters/eslint-rules/in-house-plugin.mjs +77 -0
- package/dist/lib/esm/linters/eslint-rules/index.d.mts +13 -0
- package/dist/lib/esm/linters/eslint-rules/index.mjs +74 -0
- package/dist/lib/esm/linters/eslint-rules/no-async-callback-to-unsafe-return.d.mts +10 -0
- package/dist/lib/esm/linters/eslint-rules/no-async-callback-to-unsafe-return.mjs +144 -0
- package/dist/lib/esm/linters/eslint-rules/no-unresolved-jsdoc-link.d.mts +10 -0
- package/dist/lib/esm/linters/eslint-rules/no-unresolved-jsdoc-link.mjs +277 -0
- package/dist/lib/esm/linters/eslint-rules/no-unused-params-members.d.mts +41 -0
- package/dist/lib/esm/linters/eslint-rules/no-unused-params-members.mjs +227 -0
- package/dist/lib/esm/linters/eslint-rules/no-used-underscore-variables.d.mts +20 -0
- package/dist/lib/esm/linters/eslint-rules/no-used-underscore-variables.mjs +96 -0
- package/dist/lib/esm/linters/eslint-rules/params-options-name-match.d.mts +36 -0
- package/dist/lib/esm/linters/eslint-rules/params-options-name-match.mjs +179 -0
- package/dist/lib/esm/linters/eslint-rules/prefer-noop-async.d.mts +10 -0
- package/dist/lib/esm/linters/eslint-rules/prefer-noop-async.mjs +88 -0
- package/dist/lib/esm/linters/eslint-rules/readonly-params-options-result-members.d.mts +20 -0
- package/dist/lib/esm/linters/eslint-rules/readonly-params-options-result-members.mjs +87 -0
- package/dist/lib/esm/linters/eslint-rules/require-method-template.d.mts +14 -0
- package/dist/lib/esm/linters/eslint-rules/require-method-template.mjs +142 -0
- package/dist/lib/esm/linters/eslint-rules/require-super-call.d.mts +10 -0
- package/dist/lib/esm/linters/eslint-rules/require-super-call.mjs +183 -0
- package/dist/lib/esm/linters/eslint-rules/rule-tester-helper.d.mts +18 -0
- package/dist/lib/esm/linters/eslint-rules/rule-tester-helper.mjs +55 -0
- package/dist/lib/esm/linters/eslint-rules/ts-estree-node.d.mts +23 -0
- package/dist/lib/esm/linters/eslint-rules/ts-estree-node.mjs +55 -0
- package/dist/lib/esm/linters/eslint-types/@types/@eslint-community__eslint-plugin-eslint-comments__configs.d.mts +20 -0
- package/dist/lib/esm/linters/eslint-types/@types/eslint-plugin-verify-tsdoc.d.mts +17 -0
- package/dist/lib/esm/linters/eslint.d.mts +35 -0
- package/dist/lib/esm/linters/eslint.mjs +88 -0
- package/dist/lib/esm/linters/index.d.mts +15 -0
- package/dist/lib/esm/linters/index.mjs +78 -0
- package/dist/lib/esm/linters/lint-ignores.d.mts +30 -0
- package/dist/lib/esm/linters/lint-ignores.mjs +54 -0
- package/dist/lib/esm/linters/markdownlint-cli2-config.d.mts +11 -0
- package/dist/lib/esm/linters/markdownlint-cli2-config.mjs +122 -0
- package/dist/lib/esm/linters/markdownlint-content.d.mts +47 -0
- package/dist/lib/esm/linters/markdownlint-content.mjs +83 -0
- package/dist/lib/esm/linters/markdownlint-ignores.d.mts +35 -0
- package/dist/lib/esm/linters/markdownlint-ignores.mjs +57 -0
- package/dist/lib/esm/linters/markdownlint-rules/index.d.mts +2 -0
- package/dist/lib/esm/linters/markdownlint-rules/index.mjs +52 -0
- package/dist/lib/esm/linters/markdownlint-rules/no-soft-break-in-paragraph.d.mts +35 -0
- package/dist/lib/esm/linters/markdownlint-rules/no-soft-break-in-paragraph.mjs +114 -0
- package/dist/lib/esm/linters/markdownlint-types/@types/markdownlint-cli2-config-schema.d.mts +1344 -0
- package/dist/lib/esm/linters/markdownlint-types/@types/markdownlint-cli2.d.mts +67 -0
- package/dist/lib/esm/linters/markdownlint.d.mts +32 -0
- package/dist/lib/esm/linters/markdownlint.mjs +124 -0
- package/dist/lib/esm/linters/over-exposure.d.mts +357 -0
- package/dist/lib/esm/linters/over-exposure.mjs +672 -0
- package/dist/lib/esm/nano-staged-config.d.mts +54 -0
- package/dist/lib/esm/nano-staged-config.mjs +103 -0
- package/dist/lib/esm/npm-publish.d.mts +19 -0
- package/dist/lib/esm/npm-publish.mjs +56 -0
- package/dist/lib/esm/npm-run.d.mts +34 -0
- package/dist/lib/esm/npm-run.mjs +81 -0
- package/dist/lib/esm/npm.d.mts +168 -0
- package/dist/lib/esm/npm.mjs +155 -0
- package/dist/lib/esm/package-lock-integrity.d.mts +38 -0
- package/dist/lib/esm/package-lock-integrity.mjs +99 -0
- package/dist/lib/esm/package-manager.d.mts +93 -0
- package/dist/lib/esm/package-manager.mjs +245 -0
- package/dist/lib/esm/released-issues.d.mts +79 -0
- package/dist/lib/esm/released-issues.mjs +143 -0
- package/dist/lib/esm/repo-paths.d.mts +318 -0
- package/dist/lib/esm/repo-paths.mjs +130 -0
- package/dist/lib/esm/root.d.mts +107 -0
- package/dist/lib/esm/root.mjs +115 -0
- package/dist/lib/esm/test-runners/index.d.mts +3 -0
- package/dist/lib/esm/test-runners/index.mjs +54 -0
- package/dist/lib/esm/test-runners/vitest-config.d.mts +90 -0
- package/dist/lib/esm/test-runners/vitest-config.mjs +86 -0
- package/dist/lib/esm/test-runners/vitest.d.mts +52 -0
- package/dist/lib/esm/test-runners/vitest.mjs +76 -0
- package/dist/lib/esm/validate-declarations.d.mts +37 -0
- package/dist/lib/esm/validate-declarations.mjs +87 -0
- package/dist/lib/esm/version.d.mts +418 -0
- package/dist/lib/esm/version.mjs +723 -0
- package/formatters/dprint/package.json +6 -0
- package/formatters/index/package.json +6 -0
- package/formatters/package.json +6 -0
- package/linters/cspell/package.json +6 -0
- package/linters/cspell-content/package.json +6 -0
- package/linters/eslint/package.json +6 -0
- package/linters/eslint-agnostic-core-boundary/package.json +6 -0
- package/linters/eslint-config/package.json +6 -0
- package/linters/eslint-no-restricted-syntax/package.json +6 -0
- package/linters/eslint-rules/in-house-plugin/package.json +6 -0
- package/linters/eslint-rules/index/package.json +6 -0
- package/linters/eslint-rules/no-async-callback-to-unsafe-return/package.json +6 -0
- package/linters/eslint-rules/no-unresolved-jsdoc-link/package.json +6 -0
- package/linters/eslint-rules/no-unused-params-members/package.json +6 -0
- package/linters/eslint-rules/no-used-underscore-variables/package.json +6 -0
- package/linters/eslint-rules/package.json +6 -0
- package/linters/eslint-rules/params-options-name-match/package.json +6 -0
- package/linters/eslint-rules/prefer-noop-async/package.json +6 -0
- package/linters/eslint-rules/readonly-params-options-result-members/package.json +6 -0
- package/linters/eslint-rules/require-method-template/package.json +6 -0
- package/linters/eslint-rules/require-super-call/package.json +6 -0
- package/linters/eslint-rules/rule-tester-helper/package.json +6 -0
- package/linters/eslint-rules/ts-estree-node/package.json +6 -0
- package/linters/eslint-types/@types/@eslint-community__eslint-plugin-eslint-comments__configs/package.json +4 -0
- package/linters/eslint-types/@types/eslint-plugin-verify-tsdoc/package.json +4 -0
- package/linters/index/package.json +6 -0
- package/linters/lint-ignores/package.json +6 -0
- package/linters/markdownlint/package.json +6 -0
- package/linters/markdownlint-cli2-config/package.json +6 -0
- package/linters/markdownlint-content/package.json +6 -0
- package/linters/markdownlint-ignores/package.json +6 -0
- package/linters/markdownlint-rules/index/package.json +6 -0
- package/linters/markdownlint-rules/no-soft-break-in-paragraph/package.json +6 -0
- package/linters/markdownlint-rules/package.json +6 -0
- package/linters/markdownlint-types/@types/markdownlint-cli2/package.json +4 -0
- package/linters/markdownlint-types/@types/markdownlint-cli2-config-schema/package.json +4 -0
- package/linters/over-exposure/package.json +6 -0
- package/linters/package.json +6 -0
- package/package.json +329 -13
- package/test-runners/index/package.json +6 -0
- package/test-runners/package.json +6 -0
- package/test-runners/vitest/package.json +6 -0
- package/test-runners/vitest-config/package.json +6 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/// <reference path="../index.d.mts" />
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
*
|
|
5
|
+
* Spellchecks markdown that is still in memory, with the repository's own `spellcheck` configuration.
|
|
6
|
+
*
|
|
7
|
+
* The sibling of `markdownlint-content.ts`, for the other half of the same gap: `spellcheck` can only answer
|
|
8
|
+
* for what is already on disk, so a document composed during a run — the release's changelog being the one
|
|
9
|
+
* that costs a red `main` — is checked by nothing until the next gate. A coined word in a release note lands
|
|
10
|
+
* on the default branch inside the release commit, and the NEXT release aborts in its second preflight step,
|
|
11
|
+
* in a repository nobody was working on.
|
|
12
|
+
*
|
|
13
|
+
* It SHELLS OUT where the markdownlint half calls a library, and the difference has a reason rather than
|
|
14
|
+
* being an oversight. `cspell` does export a CLI-layer `lint(fileGlobs, options, reporter)` that would be the
|
|
15
|
+
* exact analogue of `markdownlint-cli2`'s `main`, but the only way to hand it content that is not on disk is
|
|
16
|
+
* a `stdin://` glob, and its reader is `streamConsumers.text(process.stdin)` — the HOST process's own stdin,
|
|
17
|
+
* which the release's interactive review also uses. Reaching for it in-process would mean monkey-patching
|
|
18
|
+
* `process.stdin` for the whole process, so the content goes to a child's stdin instead.
|
|
19
|
+
*
|
|
20
|
+
* The `stdin://<path>` form is what makes the check the repository's own rather than a generic one: the
|
|
21
|
+
* virtual document is attributed to a REAL path, so `cspell.json` beside it — its `words`, its dictionaries,
|
|
22
|
+
* its `ignorePaths` — resolves exactly as it would for the written file. A temp file outside the repository
|
|
23
|
+
* would lose all of that, which is why it is not used.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Parameters for {@link spellcheckContent}.
|
|
27
|
+
*/
|
|
28
|
+
export interface SpellcheckContentParams {
|
|
29
|
+
/**
|
|
30
|
+
* The content to spellcheck.
|
|
31
|
+
*/
|
|
32
|
+
readonly content: string;
|
|
33
|
+
/**
|
|
34
|
+
* The path the content is checked AS — normally the path it is about to be written to. It decides which
|
|
35
|
+
* `cspell` configuration applies, and it is what every reported finding is named after.
|
|
36
|
+
*/
|
|
37
|
+
readonly filePath: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Spellchecks content that is not on disk, with the configuration `spellcheck` would have used for it.
|
|
41
|
+
*
|
|
42
|
+
* @param params - The {@link SpellcheckContentParams}.
|
|
43
|
+
* @returns A {@link Promise} that resolves to the findings, each one the line the `spellcheck` output would
|
|
44
|
+
* have carried — `<path>:<line>:<column> - Unknown word (<word>)` — or an empty array when there are none.
|
|
45
|
+
*/
|
|
46
|
+
export declare function spellcheckContent(params: SpellcheckContentParams): Promise<string[]>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
3
|
+
if you want to view the source, please visit the github repository of this plugin
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function () {
|
|
7
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
8
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for('Symbol.asyncDispose');
|
|
9
|
+
symbolConstructor.dispose ??= symbolConstructor.for('Symbol.dispose');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function ensureBrowserProcess() {
|
|
13
|
+
const browserProcess = {
|
|
14
|
+
browser: true,
|
|
15
|
+
cwd() {
|
|
16
|
+
return '/';
|
|
17
|
+
},
|
|
18
|
+
env: {},
|
|
19
|
+
platform: 'android'
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const existingProcess = globalThis.process;
|
|
23
|
+
|
|
24
|
+
if (!existingProcess) {
|
|
25
|
+
globalThis.process = browserProcess;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (existingProcess.versions?.node) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const existingProcessRecord = existingProcess;
|
|
34
|
+
|
|
35
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
36
|
+
existingProcessRecord[key] ??= value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
existingProcessRecord['browser'] = true;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
(function initEsm() {
|
|
43
|
+
ensureDisposeSymbols();
|
|
44
|
+
ensureBrowserProcess();
|
|
45
|
+
})();
|
|
46
|
+
})();
|
|
47
|
+
|
|
48
|
+
import { getLibDebugger } from "@mnaoumov/typescript-lib/debug";
|
|
49
|
+
import { toPosixPath } from "@mnaoumov/typescript-lib/path";
|
|
50
|
+
import { resolveToolCommand } from "../package-manager.mjs";
|
|
51
|
+
import { execFromRoot } from "../root.mjs";
|
|
52
|
+
const SUCCESS_EXIT_CODE = 0;
|
|
53
|
+
async function spellcheckContent(params) {
|
|
54
|
+
const { content, filePath } = params;
|
|
55
|
+
const contentDebugger = getLibDebugger("cspell:spellcheckContent");
|
|
56
|
+
const result = await execFromRoot([
|
|
57
|
+
...resolveToolCommand({ tool: "cspell" }),
|
|
58
|
+
"lint",
|
|
59
|
+
"--no-progress",
|
|
60
|
+
"--no-must-find-files",
|
|
61
|
+
// The `CSpell: Files checked: …` summary and the color codes are both noise in a finding that ends up
|
|
62
|
+
// quoted in an error message, and both are printed by default when they are not asked away.
|
|
63
|
+
"--no-summary",
|
|
64
|
+
"--no-color",
|
|
65
|
+
// A POSIX path, because this is parsed as a URL: a Windows path's backslashes do not survive that.
|
|
66
|
+
`stdin://${toPosixPath(filePath)}`
|
|
67
|
+
], {
|
|
68
|
+
isQuiet: true,
|
|
69
|
+
shouldIgnoreExitCode: true,
|
|
70
|
+
shouldIncludeDetails: true,
|
|
71
|
+
stdin: content
|
|
72
|
+
});
|
|
73
|
+
contentDebugger(result.stderr);
|
|
74
|
+
if (result.exitCode === SUCCESS_EXIT_CODE) {
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
const findings = result.stdout.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
78
|
+
if (findings.length === 0) {
|
|
79
|
+
throw new Error(`\`cspell\` exited with ${String(result.exitCode)} without reporting anything:
|
|
80
|
+
${result.stderr}`);
|
|
81
|
+
}
|
|
82
|
+
return findings;
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
spellcheckContent
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL2xpbnRlcnMvY3NwZWxsLWNvbnRlbnQudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGZpbGVcbiAqXG4gKiBTcGVsbGNoZWNrcyBtYXJrZG93biB0aGF0IGlzIHN0aWxs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QUM7QUFBQSxFQUNsQyxHQUFHO0FBQUEsSUFDRCxTQUFTO0FBQUEsSUFDVCxzQkFBc0I7QUFBQSxJQUN0QixzQkFBc0I7QUFBQSxJQUN0QixPQUFPO0FBQUEsRUFDVCxDQUFDO0FBRUQsa0JBQWdCLE9BQU8sTUFBTTtBQUU3QixNQUFJLE9BQU8sYUFBYSxtQkFBbUI7QUFDekMsV0FBTyxDQUFDO0FBQUEsRUFDVjtBQUVBLFFBQU0sV0FBVyxPQUFPLE9BQU8sTUFBTSxJQUFJLEVBQUUsSUFBSSxDQUFDLFNBQVMsS0FBSyxLQUFLLENBQUMsRUFBRSxPQUFPLE9BQU87QUFLcEYsTUFBSSxTQUFTLFdBQVcsR0FBRztBQUN6QixVQUFNLElBQUksTUFBTSwwQkFBMEIsT0FBTyxPQUFPLFFBQVEsQ0FBQztBQUFBLEVBQWlDLE9BQU8sTUFBTSxFQUFFO0FBQUEsRUFDbkg7QUFFQSxTQUFPO0FBQ1Q7IiwKICAibmFtZXMiOiBbXQp9Cg==
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference path="../index.d.mts" />
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
*
|
|
5
|
+
* This module provides a function for running a spellcheck on the codebase using the `cspell` library.
|
|
6
|
+
* It reports any spelling issues found in the code and returns a {@link CliTaskResult} indicating whether the spellcheck was successful.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Parameters for the {@link spellcheck} function.
|
|
10
|
+
*/
|
|
11
|
+
export interface SpellcheckOptions {
|
|
12
|
+
/**
|
|
13
|
+
* Optional file paths to check. If omitted, checks the entire project.
|
|
14
|
+
*/
|
|
15
|
+
readonly paths?: string[] | undefined;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Runs a spellcheck on the entire codebase using `cspell`.
|
|
19
|
+
*
|
|
20
|
+
* Checks all files in the current folder and its subfolders for spelling issues.
|
|
21
|
+
* If issues are found, they are logged to the console with their file path, line, and column number.
|
|
22
|
+
*
|
|
23
|
+
* Uses `--no-must-find-files` so that cspell does not fail when all provided paths
|
|
24
|
+
* are excluded by built-in ignore rules (e.g., `package-lock.json`).
|
|
25
|
+
*
|
|
26
|
+
* Uses `--gitignore` so a path git ignores is a path cspell skips — generated output, build folders and
|
|
27
|
+
* every `node_modules` are covered without a hand-maintained `ignorePaths` list that drifts from
|
|
28
|
+
* `.gitignore`. It is passed on the command line rather than set in `cspell.json` so that every project
|
|
29
|
+
* consuming this function inherits it, rather than each having to edit its own config. `--gitignore-root`
|
|
30
|
+
* stops the search at the project root, so a `.gitignore` in some parent folder outside the project cannot
|
|
31
|
+
* silently remove files from the check.
|
|
32
|
+
*
|
|
33
|
+
* @param options - The {@link SpellcheckOptions}.
|
|
34
|
+
* @returns A {@link Promise} that resolves to a {@link CliTaskResult}, indicating the success or failure of the spellcheck.
|
|
35
|
+
*/
|
|
36
|
+
export declare function spellcheck(options?: SpellcheckOptions): Promise<void>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
3
|
+
if you want to view the source, please visit the github repository of this plugin
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function () {
|
|
7
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
8
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for('Symbol.asyncDispose');
|
|
9
|
+
symbolConstructor.dispose ??= symbolConstructor.for('Symbol.dispose');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function ensureBrowserProcess() {
|
|
13
|
+
const browserProcess = {
|
|
14
|
+
browser: true,
|
|
15
|
+
cwd() {
|
|
16
|
+
return '/';
|
|
17
|
+
},
|
|
18
|
+
env: {},
|
|
19
|
+
platform: 'android'
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const existingProcess = globalThis.process;
|
|
23
|
+
|
|
24
|
+
if (!existingProcess) {
|
|
25
|
+
globalThis.process = browserProcess;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (existingProcess.versions?.node) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const existingProcessRecord = existingProcess;
|
|
34
|
+
|
|
35
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
36
|
+
existingProcessRecord[key] ??= value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
existingProcessRecord['browser'] = true;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
(function initEsm() {
|
|
43
|
+
ensureDisposeSymbols();
|
|
44
|
+
ensureBrowserProcess();
|
|
45
|
+
})();
|
|
46
|
+
})();
|
|
47
|
+
|
|
48
|
+
import { resolveToolCommand } from "../package-manager.mjs";
|
|
49
|
+
import {
|
|
50
|
+
execFromRoot,
|
|
51
|
+
getRootFolder
|
|
52
|
+
} from "../root.mjs";
|
|
53
|
+
async function spellcheck(options) {
|
|
54
|
+
const { paths } = options ?? {};
|
|
55
|
+
const targets = paths?.length ? paths : ["."];
|
|
56
|
+
const rootFolder = getRootFolder();
|
|
57
|
+
await execFromRoot([
|
|
58
|
+
...resolveToolCommand({ tool: "cspell" }),
|
|
59
|
+
"--no-progress",
|
|
60
|
+
"--no-must-find-files",
|
|
61
|
+
"--gitignore",
|
|
62
|
+
...rootFolder === null ? [] : ["--gitignore-root", rootFolder],
|
|
63
|
+
{ batchedArguments: targets }
|
|
64
|
+
]);
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
spellcheck
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL2xpbnRlcnMvY3NwZWxsLnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyIvKipcbiAqIEBmaWxlXG4gKlxuICogVGhpcyBtb2R1bGUgcHJvdmlkZXMg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ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFPQSxTQUFTLDBCQUEwQjtBQUNuQztBQUFBLEVBQ0U7QUFBQSxFQUNBO0FBQUEsT0FDSztBQStCUCxlQUFzQixXQUFXLFNBQTRDO0FBQzNFLFFBQU0sRUFBRSxNQUFNLElBQUksV0FBVyxDQUFDO0FBRTlCLFFBQU0sVUFBVSxPQUFPLFNBQVMsUUFBUSxDQUFDLEdBQUc7QUFFNUMsUUFBTSxhQUFhLGNBQWM7QUFDakMsUUFBTSxhQUFhO0FBQUEsSUFDakIsR0FBRyxtQkFBbUIsRUFBRSxNQUFNLFNBQVMsQ0FBQztBQUFBLElBQ3hDO0FBQUEsSUFDQTtBQUFBLElBQ0E7QUFBQSxJQUNBLEdBQUcsZUFBZSxPQUFPLENBQUMsSUFBSSxDQUFDLG9CQUFvQixVQUFVO0FBQUEsSUFDN0QsRUFBRSxrQkFBa0IsUUFBUTtBQUFBLEVBQzlCLENBQUM7QUFDSDsiLAogICJuYW1lcyI6IFtdCn0K
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/// <reference path="../index.d.mts" />
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
*
|
|
5
|
+
* `no-restricted-imports` pattern entries that enforce the dependency arrows between the packages of a workspace:
|
|
6
|
+
* which packages a package's code may import, by naming the ones it may not.
|
|
7
|
+
*
|
|
8
|
+
* Exported as standalone builders so the patterns can be unit-tested independently of the larger declarative
|
|
9
|
+
* config, and so the owning project can apply them scoped to each package's source files.
|
|
10
|
+
*
|
|
11
|
+
* Workspace `package.json` dependencies enforce the same boundary in the end, because an import of an undeclared
|
|
12
|
+
* package fails to resolve once the package is installed on its own. Inside the workspace every package is
|
|
13
|
+
* resolvable from every other, so without this rule a wrong arrow would surface only after publishing.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Parameters for {@link getPackageBoundaryNoRestrictedImportPatterns}.
|
|
17
|
+
*/
|
|
18
|
+
export interface GetPackageBoundaryNoRestrictedImportPatternsParams {
|
|
19
|
+
/**
|
|
20
|
+
* The packages the package's code must not import, by package name.
|
|
21
|
+
*/
|
|
22
|
+
readonly forbiddenPackageNames: readonly string[];
|
|
23
|
+
/**
|
|
24
|
+
* The name of the package the patterns apply to, named in the message.
|
|
25
|
+
*/
|
|
26
|
+
readonly packageName: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A single `no-restricted-imports` pattern entry pairing a group of banned import specifiers with a
|
|
30
|
+
* human-readable message explaining why they are banned.
|
|
31
|
+
*/
|
|
32
|
+
export interface NoRestrictedImportPatternEntry {
|
|
33
|
+
/**
|
|
34
|
+
* The glob group of import specifiers to ban.
|
|
35
|
+
*/
|
|
36
|
+
group: string[];
|
|
37
|
+
/**
|
|
38
|
+
* Human-readable message shown when an import matches the group.
|
|
39
|
+
*/
|
|
40
|
+
message: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Builds the `no-restricted-imports` pattern entries banning a package's code from importing the given packages,
|
|
44
|
+
* through their root or any subpath.
|
|
45
|
+
*
|
|
46
|
+
* @param params - The {@link GetPackageBoundaryNoRestrictedImportPatternsParams}.
|
|
47
|
+
* @returns One pattern entry per forbidden package; none when nothing is forbidden.
|
|
48
|
+
*/
|
|
49
|
+
export declare function getPackageBoundaryNoRestrictedImportPatterns(params: GetPackageBoundaryNoRestrictedImportPatternsParams): NoRestrictedImportPatternEntry[];
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*
|
|
2
|
+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
3
|
+
if you want to view the source, please visit the github repository of this plugin
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function () {
|
|
7
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
8
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for('Symbol.asyncDispose');
|
|
9
|
+
symbolConstructor.dispose ??= symbolConstructor.for('Symbol.dispose');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function ensureBrowserProcess() {
|
|
13
|
+
const browserProcess = {
|
|
14
|
+
browser: true,
|
|
15
|
+
cwd() {
|
|
16
|
+
return '/';
|
|
17
|
+
},
|
|
18
|
+
env: {},
|
|
19
|
+
platform: 'android'
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const existingProcess = globalThis.process;
|
|
23
|
+
|
|
24
|
+
if (!existingProcess) {
|
|
25
|
+
globalThis.process = browserProcess;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (existingProcess.versions?.node) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const existingProcessRecord = existingProcess;
|
|
34
|
+
|
|
35
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
36
|
+
existingProcessRecord[key] ??= value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
existingProcessRecord['browser'] = true;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
(function initEsm() {
|
|
43
|
+
ensureDisposeSymbols();
|
|
44
|
+
ensureBrowserProcess();
|
|
45
|
+
})();
|
|
46
|
+
})();
|
|
47
|
+
|
|
48
|
+
function getPackageBoundaryNoRestrictedImportPatterns(params) {
|
|
49
|
+
return params.forbiddenPackageNames.map((forbiddenPackageName) => ({
|
|
50
|
+
group: [forbiddenPackageName, `${forbiddenPackageName}/*`, `${forbiddenPackageName}/**`],
|
|
51
|
+
message: `\`${params.packageName}\` must not import \`${forbiddenPackageName}\`: the dependency arrows between the workspace packages point the other way.`
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
getPackageBoundaryNoRestrictedImportPatterns
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL2xpbnR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gJHtmb3JiaWRkZW5QYWNrYWdlTmFtZX1cXGA6IHRoZSBkZXBlbmRlbmN5IGFycm93cyBiZXR3ZWVuIHRoZSB3b3Jrc3BhY2UgcGFja2FnZXMgcG9pbnQgdGhlIG90aGVyIHdheS5gXG4gIH0pKTtcbn1cbiJdLAogICJtYXBwaW5ncyI6ICI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBb0RPLFNBQVMsNkNBQTZDLFFBQThGO0FBQ3pKLFNBQU8sT0FBTyxzQkFBc0IsSUFBSSxDQUFDLDBCQUEwQjtBQUFBLElBQ2pFLE9BQU8sQ0FBQyxzQkFBc0IsR0FBRyxvQkFBb0IsTUFBTSxHQUFHLG9CQUFvQixLQUFLO0FBQUEsSUFDdkYsU0FBUyxLQUFLLE9BQU8sV0FBVyx3QkFBd0Isb0JBQW9CO0FBQUEsRUFDOUUsRUFBRTtBQUNKOyIsCiAgIm5hbWVzIjogW10KfQo=
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/// <reference path="../index.d.mts" />
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
*
|
|
5
|
+
* The generic half of the shared ESLint configuration, for any TypeScript project.
|
|
6
|
+
*
|
|
7
|
+
* It integrates ESLint's own recommended rules, `typescript-eslint`, `@stylistic/eslint-plugin`,
|
|
8
|
+
* `eslint-plugin-import-x` with its TypeScript resolver, `eslint-plugin-perfectionist`, `eslint-plugin-unicorn`,
|
|
9
|
+
* `eslint-plugin-n` and the generic in-house rules. A project-type layer (the Obsidian plugin one lives in
|
|
10
|
+
* `@mnaoumov/obsidian-dev-toolkit`) builds on {@link getTypeScriptEslintConfigs} and adds only what is specific to it.
|
|
11
|
+
*/
|
|
12
|
+
import type { ESLint, Linter } from 'eslint';
|
|
13
|
+
/**
|
|
14
|
+
* The parameters for defining ESLint configurations.
|
|
15
|
+
*/
|
|
16
|
+
export interface DefineEslintConfigsOptions {
|
|
17
|
+
/**
|
|
18
|
+
* A function that builds custom ESLint configurations.
|
|
19
|
+
*
|
|
20
|
+
* @param context - The ESLint configuration context.
|
|
21
|
+
* @returns The custom ESLint configurations.
|
|
22
|
+
*/
|
|
23
|
+
readonly customConfigs?: (context: EslintConfigContext) => Linter.Config[];
|
|
24
|
+
/**
|
|
25
|
+
* A function that edits the ESLint configuration context.
|
|
26
|
+
*
|
|
27
|
+
* @param context - The ESLint configuration context.
|
|
28
|
+
*/
|
|
29
|
+
readonly editContext?: (context: EslintConfigContext) => void;
|
|
30
|
+
/**
|
|
31
|
+
* The oldest Node version shipped source has to run on, as a semver range: a library that also runs inside an
|
|
32
|
+
* older runtime than its own tooling (an Obsidian renderer, say) names that runtime's Node here. When omitted,
|
|
33
|
+
* `eslint-plugin-n` reads the `engines` field of the project's `package.json`.
|
|
34
|
+
*/
|
|
35
|
+
readonly minimumNodeVersion?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The parameters for {@link getTypeScriptEslintConfigs}.
|
|
39
|
+
*/
|
|
40
|
+
export interface GetTypeScriptEslintConfigsParams {
|
|
41
|
+
/**
|
|
42
|
+
* The ESLint configuration context.
|
|
43
|
+
*/
|
|
44
|
+
readonly context: EslintConfigContext;
|
|
45
|
+
/**
|
|
46
|
+
* The plugin registered under the in-house namespace. A project-type layer that adds in-house rules of its own
|
|
47
|
+
* passes ONE plugin carrying the generic rules and its own, because ESLint refuses two plugins under one namespace.
|
|
48
|
+
* Defaults to the plugin carrying the generic rules alone.
|
|
49
|
+
*/
|
|
50
|
+
readonly inHousePlugin?: ESLint.Plugin;
|
|
51
|
+
/**
|
|
52
|
+
* The oldest Node version shipped source has to run on, as a semver range. When omitted, `eslint-plugin-n` reads
|
|
53
|
+
* the `engines` field of the project's `package.json`.
|
|
54
|
+
*/
|
|
55
|
+
readonly minimumNodeVersion?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The context for defining ESLint configurations.
|
|
59
|
+
*/
|
|
60
|
+
export declare class EslintConfigContext {
|
|
61
|
+
/**
|
|
62
|
+
* The root configuration files.
|
|
63
|
+
*/
|
|
64
|
+
readonly rootConfigFiles: string[];
|
|
65
|
+
/**
|
|
66
|
+
* The script files.
|
|
67
|
+
*/
|
|
68
|
+
readonly scriptFiles: string[];
|
|
69
|
+
/**
|
|
70
|
+
* The source files.
|
|
71
|
+
*/
|
|
72
|
+
readonly sourceFiles: string[];
|
|
73
|
+
/**
|
|
74
|
+
* The folders holding the project's sources, by default `src` alone. A workspace whose packages each have their own
|
|
75
|
+
* `src` adds them here, so the rules keyed on a file's name inside a source folder reach those packages too.
|
|
76
|
+
*/
|
|
77
|
+
readonly sourceFolders: string[];
|
|
78
|
+
/**
|
|
79
|
+
* The test files.
|
|
80
|
+
*/
|
|
81
|
+
readonly testFiles: string[];
|
|
82
|
+
/**
|
|
83
|
+
* The all files.
|
|
84
|
+
*
|
|
85
|
+
* @returns The all files.
|
|
86
|
+
*/
|
|
87
|
+
allFiles(): string[];
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Creates the context of a project laid out the conventional way: sources under `src`, scripts under `scripts`, tests
|
|
91
|
+
* beside the sources or under `__tests__`, and the commitlint, ESLint and Vitest configurations at the root.
|
|
92
|
+
*
|
|
93
|
+
* @returns The context.
|
|
94
|
+
*/
|
|
95
|
+
export declare function createDefaultEslintConfigContext(): EslintConfigContext;
|
|
96
|
+
/**
|
|
97
|
+
* Builds the ESLint configurations of a generic TypeScript project.
|
|
98
|
+
*
|
|
99
|
+
* @param options - The parameters for defining ESLint configurations.
|
|
100
|
+
* @returns The ESLint configurations.
|
|
101
|
+
*/
|
|
102
|
+
export declare function defineEslintConfigs(options?: DefineEslintConfigsOptions): Linter.Config[];
|
|
103
|
+
/**
|
|
104
|
+
* The configurations of ESLint's own rules. A project-type layer reads it to learn which core rules this
|
|
105
|
+
* configuration sets itself.
|
|
106
|
+
*
|
|
107
|
+
* @param context - The ESLint configuration context.
|
|
108
|
+
* @returns The configurations.
|
|
109
|
+
*/
|
|
110
|
+
export declare function getEslintCoreConfigs(context: EslintConfigContext): Linter.Config[];
|
|
111
|
+
/**
|
|
112
|
+
* The global ignores: everything `.gitignore` names, plus Claude Code's worktree folder.
|
|
113
|
+
*
|
|
114
|
+
* @returns The configurations.
|
|
115
|
+
*/
|
|
116
|
+
export declare function getGlobalIgnoreConfigs(): Linter.Config[];
|
|
117
|
+
/**
|
|
118
|
+
* The generic layers of the shared configuration, without the global ignores.
|
|
119
|
+
*
|
|
120
|
+
* @param params - The parameters.
|
|
121
|
+
* @returns The configurations.
|
|
122
|
+
*/
|
|
123
|
+
export declare function getTypeScriptEslintConfigs(params: GetTypeScriptEslintConfigsParams): Linter.Config[];
|