@cbnventures/nova 0.13.1 → 0.14.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/build/package.json +9 -13
- package/build/src/api/node-releases.d.ts +1 -1
- package/build/src/api/spdx-licenses.d.ts +1 -1
- package/build/src/cli/index.js +155 -39
- package/build/src/cli/index.js.map +1 -1
- package/build/src/cli/recipe/index.d.ts +3 -0
- package/build/src/cli/recipe/index.d.ts.map +1 -0
- package/build/src/cli/recipe/index.js +57 -0
- package/build/src/cli/recipe/index.js.map +1 -0
- package/build/src/cli/recipe/package-json/cleanup.d.ts +8 -0
- package/build/src/cli/recipe/package-json/cleanup.d.ts.map +1 -0
- package/build/src/cli/recipe/package-json/cleanup.js +174 -0
- package/build/src/cli/recipe/package-json/cleanup.js.map +1 -0
- package/build/src/cli/recipe/package-json/normalize-artifacts.d.ts +8 -0
- package/build/src/cli/recipe/package-json/normalize-artifacts.d.ts.map +1 -0
- package/build/src/cli/recipe/package-json/normalize-artifacts.js +242 -0
- package/build/src/cli/recipe/package-json/normalize-artifacts.js.map +1 -0
- package/build/src/cli/recipe/package-json/normalize-bundler.d.ts +6 -0
- package/build/src/cli/recipe/package-json/normalize-bundler.d.ts.map +1 -0
- package/build/src/cli/recipe/package-json/normalize-bundler.js +145 -0
- package/build/src/cli/recipe/package-json/normalize-bundler.js.map +1 -0
- package/build/src/cli/recipe/package-json/normalize-dependencies.d.ts +9 -0
- package/build/src/cli/recipe/package-json/normalize-dependencies.d.ts.map +1 -0
- package/build/src/cli/recipe/package-json/normalize-dependencies.js +262 -0
- package/build/src/cli/recipe/package-json/normalize-dependencies.js.map +1 -0
- package/build/src/cli/recipe/package-json/normalize-modules.d.ts +6 -0
- package/build/src/cli/recipe/package-json/normalize-modules.d.ts.map +1 -0
- package/build/src/cli/recipe/package-json/normalize-modules.js +249 -0
- package/build/src/cli/recipe/package-json/normalize-modules.js.map +1 -0
- package/build/src/cli/recipe/package-json/normalize-tooling.d.ts +7 -0
- package/build/src/cli/recipe/package-json/normalize-tooling.d.ts.map +1 -0
- package/build/src/cli/recipe/package-json/normalize-tooling.js +168 -0
- package/build/src/cli/recipe/package-json/normalize-tooling.js.map +1 -0
- package/build/src/cli/recipe/package-json/sync-environment.d.ts +9 -0
- package/build/src/cli/recipe/package-json/sync-environment.d.ts.map +1 -0
- package/build/src/cli/recipe/package-json/sync-environment.js +286 -0
- package/build/src/cli/recipe/package-json/sync-environment.js.map +1 -0
- package/build/src/cli/recipe/package-json/sync-identity.d.ts +6 -0
- package/build/src/cli/recipe/package-json/sync-identity.d.ts.map +1 -0
- package/build/src/cli/recipe/package-json/sync-identity.js +219 -0
- package/build/src/cli/recipe/package-json/sync-identity.js.map +1 -0
- package/build/src/cli/recipe/package-json/sync-ownership.d.ts +6 -0
- package/build/src/cli/recipe/package-json/sync-ownership.d.ts.map +1 -0
- package/build/src/cli/recipe/package-json/sync-ownership.js +349 -0
- package/build/src/cli/recipe/package-json/sync-ownership.js.map +1 -0
- package/build/src/cli/utility/changelog.d.ts +1 -1
- package/build/src/cli/utility/changelog.d.ts.map +1 -1
- package/build/src/cli/utility/changelog.js +10 -10
- package/build/src/cli/utility/changelog.js.map +1 -1
- package/build/src/cli/utility/initialize.d.ts +1 -1
- package/build/src/cli/utility/initialize.d.ts.map +1 -1
- package/build/src/cli/utility/initialize.js +259 -74
- package/build/src/cli/utility/initialize.js.map +1 -1
- package/build/src/cli/utility/run-recipes.d.ts +5 -0
- package/build/src/cli/utility/run-recipes.d.ts.map +1 -0
- package/build/src/cli/utility/run-recipes.js +42 -0
- package/build/src/cli/utility/run-recipes.js.map +1 -0
- package/build/src/cli/utility/run-scripts.d.ts +10 -0
- package/build/src/cli/utility/run-scripts.d.ts.map +1 -0
- package/build/src/cli/utility/run-scripts.js +160 -0
- package/build/src/cli/utility/run-scripts.js.map +1 -0
- package/build/src/cli/utility/transpile.d.ts +9 -0
- package/build/src/cli/utility/transpile.d.ts.map +1 -0
- package/build/src/cli/utility/transpile.js +59 -0
- package/build/src/cli/utility/transpile.js.map +1 -0
- package/build/src/cli/utility/type-check.d.ts +1 -1
- package/build/src/cli/utility/type-check.d.ts.map +1 -1
- package/build/src/cli/utility/type-check.js +3 -3
- package/build/src/cli/utility/type-check.js.map +1 -1
- package/build/src/cli/utility/version.d.ts +1 -1
- package/build/src/cli/utility/version.d.ts.map +1 -1
- package/build/src/cli/utility/version.js.map +1 -1
- package/build/src/lib/item.d.ts +7 -2
- package/build/src/lib/item.d.ts.map +1 -1
- package/build/src/lib/item.js +37 -10
- package/build/src/lib/item.js.map +1 -1
- package/build/src/lib/nova-config.d.ts +2 -2
- package/build/src/lib/nova-config.d.ts.map +1 -1
- package/build/src/lib/nova-config.js +46 -21
- package/build/src/lib/nova-config.js.map +1 -1
- package/build/src/lib/utility.d.ts +1 -1
- package/build/src/lib/utility.d.ts.map +1 -1
- package/build/src/lib/utility.js +9 -6
- package/build/src/lib/utility.js.map +1 -1
- package/build/src/presets/eslint/dx-code-style.d.mts +1 -1
- package/build/src/presets/eslint/dx-ignore.d.mts +1 -1
- package/build/src/presets/eslint/env-browser.d.mts +1 -1
- package/build/src/presets/eslint/env-edge.d.mts +1 -1
- package/build/src/presets/eslint/env-node.d.mts +1 -1
- package/build/src/presets/eslint/env-service-worker.d.mts +1 -1
- package/build/src/presets/eslint/env-web-worker.d.mts +1 -1
- package/build/src/presets/eslint/fw-docusaurus.d.mts +1 -1
- package/build/src/presets/eslint/fw-expressjs.d.mts +1 -1
- package/build/src/presets/eslint/fw-nextjs.d.mts +1 -1
- package/build/src/presets/eslint/lang-javascript.d.mts +1 -1
- package/build/src/presets/eslint/lang-mdx.d.mts +1 -1
- package/build/src/presets/eslint/lang-typescript.d.mts +1 -1
- package/build/src/presets/eslint/platform-cloudflare-workers.d.mts +1 -1
- package/build/src/presets/eslint/tool-vite.d.mts +1 -1
- package/build/src/rules/eslint/formatting/no-raw-text-in-code.d.ts.map +1 -0
- package/build/src/rules/eslint/{no-raw-text-in-code.js → formatting/no-raw-text-in-code.js} +1 -1
- package/build/src/rules/eslint/formatting/no-raw-text-in-code.js.map +1 -0
- package/build/src/rules/eslint/formatting/require-padding-lines.d.ts +13 -0
- package/build/src/rules/eslint/formatting/require-padding-lines.d.ts.map +1 -0
- package/build/src/rules/eslint/formatting/require-padding-lines.js +173 -0
- package/build/src/rules/eslint/formatting/require-padding-lines.js.map +1 -0
- package/build/src/rules/eslint/index.d.ts +14 -5
- package/build/src/rules/eslint/index.d.ts.map +1 -1
- package/build/src/rules/eslint/index.js +14 -5
- package/build/src/rules/eslint/index.js.map +1 -1
- package/build/src/rules/eslint/nova/no-logger-dev.d.ts.map +1 -0
- package/build/src/rules/eslint/{no-logger-dev.js → nova/no-logger-dev.js} +6 -4
- package/build/src/rules/eslint/nova/no-logger-dev.js.map +1 -0
- package/build/src/rules/eslint/patterns/no-assign-then-return.d.ts +6 -0
- package/build/src/rules/eslint/patterns/no-assign-then-return.d.ts.map +1 -0
- package/build/src/rules/eslint/patterns/no-assign-then-return.js +55 -0
- package/build/src/rules/eslint/patterns/no-assign-then-return.js.map +1 -0
- package/build/src/rules/eslint/patterns/no-bracket-assignment.d.ts +6 -0
- package/build/src/rules/eslint/patterns/no-bracket-assignment.d.ts.map +1 -0
- package/build/src/rules/eslint/patterns/no-bracket-assignment.js +31 -0
- package/build/src/rules/eslint/patterns/no-bracket-assignment.js.map +1 -0
- package/build/src/rules/eslint/patterns/no-destructuring.d.ts +13 -0
- package/build/src/rules/eslint/patterns/no-destructuring.d.ts.map +1 -0
- package/build/src/rules/eslint/patterns/no-destructuring.js +177 -0
- package/build/src/rules/eslint/patterns/no-destructuring.js.map +1 -0
- package/build/src/rules/eslint/patterns/no-implicit-boolean.d.ts +6 -0
- package/build/src/rules/eslint/patterns/no-implicit-boolean.d.ts.map +1 -0
- package/build/src/rules/eslint/patterns/no-implicit-boolean.js +62 -0
- package/build/src/rules/eslint/patterns/no-implicit-boolean.js.map +1 -0
- package/build/src/rules/eslint/patterns/no-ternary-in-template-literal.d.ts +6 -0
- package/build/src/rules/eslint/patterns/no-ternary-in-template-literal.d.ts.map +1 -0
- package/build/src/rules/eslint/patterns/no-ternary-in-template-literal.js +32 -0
- package/build/src/rules/eslint/patterns/no-ternary-in-template-literal.js.map +1 -0
- package/build/src/rules/eslint/patterns/switch-case-blocks.d.ts.map +1 -0
- package/build/src/rules/eslint/{switch-case-blocks.js → patterns/switch-case-blocks.js} +2 -2
- package/build/src/rules/eslint/patterns/switch-case-blocks.js.map +1 -0
- package/build/src/rules/eslint/regex/no-regex-literal-flags.d.ts.map +1 -0
- package/build/src/rules/eslint/regex/no-regex-literal-flags.js.map +1 -0
- package/build/src/rules/eslint/{no-regex-literals.d.ts → regex/no-regex-literals.d.ts} +1 -1
- package/build/src/rules/eslint/regex/no-regex-literals.d.ts.map +1 -0
- package/build/src/rules/eslint/{no-regex-literals.js → regex/no-regex-literals.js} +4 -4
- package/build/src/rules/eslint/regex/no-regex-literals.js.map +1 -0
- package/build/src/rules/eslint/typescript/no-catch-unknown-annotation.d.ts +6 -0
- package/build/src/rules/eslint/typescript/no-catch-unknown-annotation.d.ts.map +1 -0
- package/build/src/rules/eslint/typescript/no-catch-unknown-annotation.js +38 -0
- package/build/src/rules/eslint/typescript/no-catch-unknown-annotation.js.map +1 -0
- package/build/src/rules/eslint/typescript/no-inline-type-annotation.d.ts +6 -0
- package/build/src/rules/eslint/typescript/no-inline-type-annotation.d.ts.map +1 -0
- package/build/src/rules/eslint/typescript/no-inline-type-annotation.js +36 -0
- package/build/src/rules/eslint/typescript/no-inline-type-annotation.js.map +1 -0
- package/build/src/rules/eslint/typescript/no-shared-type-import.d.ts +9 -0
- package/build/src/rules/eslint/typescript/no-shared-type-import.d.ts.map +1 -0
- package/build/src/rules/eslint/typescript/no-shared-type-import.js +57 -0
- package/build/src/rules/eslint/typescript/no-shared-type-import.js.map +1 -0
- package/build/src/tests/cli/recipe/package-json/cleanup.test.d.ts +2 -0
- package/build/src/tests/cli/recipe/package-json/cleanup.test.d.ts.map +1 -0
- package/build/src/tests/cli/recipe/package-json/cleanup.test.js +240 -0
- package/build/src/tests/cli/recipe/package-json/cleanup.test.js.map +1 -0
- package/build/src/tests/cli/recipe/package-json/normalize-artifacts.test.d.ts +2 -0
- package/build/src/tests/cli/recipe/package-json/normalize-artifacts.test.d.ts.map +1 -0
- package/build/src/tests/cli/recipe/package-json/normalize-artifacts.test.js +161 -0
- package/build/src/tests/cli/recipe/package-json/normalize-artifacts.test.js.map +1 -0
- package/build/src/tests/cli/recipe/package-json/normalize-bundler.test.d.ts +2 -0
- package/build/src/tests/cli/recipe/package-json/normalize-bundler.test.d.ts.map +1 -0
- package/build/src/tests/cli/recipe/package-json/normalize-bundler.test.js +161 -0
- package/build/src/tests/cli/recipe/package-json/normalize-bundler.test.js.map +1 -0
- package/build/src/tests/cli/recipe/package-json/normalize-dependencies.test.d.ts +2 -0
- package/build/src/tests/cli/recipe/package-json/normalize-dependencies.test.d.ts.map +1 -0
- package/build/src/tests/cli/recipe/package-json/normalize-dependencies.test.js +175 -0
- package/build/src/tests/cli/recipe/package-json/normalize-dependencies.test.js.map +1 -0
- package/build/src/tests/cli/recipe/package-json/normalize-modules.test.d.ts +2 -0
- package/build/src/tests/cli/recipe/package-json/normalize-modules.test.d.ts.map +1 -0
- package/build/src/tests/cli/recipe/package-json/normalize-modules.test.js +164 -0
- package/build/src/tests/cli/recipe/package-json/normalize-modules.test.js.map +1 -0
- package/build/src/tests/cli/recipe/package-json/normalize-tooling.test.d.ts +2 -0
- package/build/src/tests/cli/recipe/package-json/normalize-tooling.test.d.ts.map +1 -0
- package/build/src/tests/cli/recipe/package-json/normalize-tooling.test.js +193 -0
- package/build/src/tests/cli/recipe/package-json/normalize-tooling.test.js.map +1 -0
- package/build/src/tests/cli/recipe/package-json/sync-environment.test.d.ts +2 -0
- package/build/src/tests/cli/recipe/package-json/sync-environment.test.d.ts.map +1 -0
- package/build/src/tests/cli/recipe/package-json/sync-environment.test.js +158 -0
- package/build/src/tests/cli/recipe/package-json/sync-environment.test.js.map +1 -0
- package/build/src/tests/cli/recipe/package-json/sync-identity.test.d.ts +2 -0
- package/build/src/tests/cli/recipe/package-json/sync-identity.test.d.ts.map +1 -0
- package/build/src/tests/cli/recipe/package-json/sync-identity.test.js +156 -0
- package/build/src/tests/cli/recipe/package-json/sync-identity.test.js.map +1 -0
- package/build/src/tests/cli/recipe/package-json/sync-ownership.test.d.ts +2 -0
- package/build/src/tests/cli/recipe/package-json/sync-ownership.test.d.ts.map +1 -0
- package/build/src/tests/cli/recipe/package-json/sync-ownership.test.js +164 -0
- package/build/src/tests/cli/recipe/package-json/sync-ownership.test.js.map +1 -0
- package/build/src/tests/cli/utility/changelog.test.d.ts +2 -0
- package/build/src/tests/cli/utility/changelog.test.d.ts.map +1 -0
- package/build/src/tests/cli/utility/changelog.test.js +274 -0
- package/build/src/tests/cli/utility/changelog.test.js.map +1 -0
- package/build/src/tests/cli/utility/initialize.test.d.ts +2 -0
- package/build/src/tests/cli/utility/initialize.test.d.ts.map +1 -0
- package/build/src/tests/cli/utility/initialize.test.js +27 -0
- package/build/src/tests/cli/utility/initialize.test.js.map +1 -0
- package/build/src/tests/cli/utility/run-recipes.test.d.ts +2 -0
- package/build/src/tests/cli/utility/run-recipes.test.d.ts.map +1 -0
- package/build/src/tests/cli/utility/run-recipes.test.js +41 -0
- package/build/src/tests/cli/utility/run-recipes.test.js.map +1 -0
- package/build/src/tests/cli/utility/run-scripts.test.d.ts +2 -0
- package/build/src/tests/cli/utility/run-scripts.test.d.ts.map +1 -0
- package/build/src/tests/cli/utility/run-scripts.test.js +153 -0
- package/build/src/tests/cli/utility/run-scripts.test.js.map +1 -0
- package/build/src/tests/cli/utility/transpile.test.d.ts +2 -0
- package/build/src/tests/cli/utility/transpile.test.d.ts.map +1 -0
- package/build/src/tests/cli/utility/transpile.test.js +65 -0
- package/build/src/tests/cli/utility/transpile.test.js.map +1 -0
- package/build/src/tests/cli/utility/type-check.test.d.ts +2 -0
- package/build/src/tests/cli/utility/type-check.test.d.ts.map +1 -0
- package/build/src/tests/cli/utility/type-check.test.js +63 -0
- package/build/src/tests/cli/utility/type-check.test.js.map +1 -0
- package/build/src/tests/cli/utility/version.test.d.ts +2 -0
- package/build/src/tests/cli/utility/version.test.d.ts.map +1 -0
- package/build/src/tests/cli/utility/version.test.js +38 -0
- package/build/src/tests/cli/utility/version.test.js.map +1 -0
- package/build/src/tests/lib/item.test.js +8 -8
- package/build/src/tests/lib/item.test.js.map +1 -1
- package/build/src/tests/lib/nova-config.test.js +53 -26
- package/build/src/tests/lib/nova-config.test.js.map +1 -1
- package/build/src/tests/rules/eslint/formatting/no-raw-text-in-code.test.d.ts.map +1 -0
- package/build/src/tests/rules/eslint/{no-raw-text-in-code.test.js → formatting/no-raw-text-in-code.test.js} +1 -1
- package/build/src/tests/rules/eslint/formatting/no-raw-text-in-code.test.js.map +1 -0
- package/build/src/tests/rules/eslint/formatting/require-padding-lines.test.d.ts +2 -0
- package/build/src/tests/rules/eslint/formatting/require-padding-lines.test.d.ts.map +1 -0
- package/build/src/tests/rules/eslint/formatting/require-padding-lines.test.js +131 -0
- package/build/src/tests/rules/eslint/formatting/require-padding-lines.test.js.map +1 -0
- package/build/src/tests/rules/eslint/nova/no-logger-dev.test.d.ts.map +1 -0
- package/build/src/tests/rules/eslint/{no-logger-dev.test.js → nova/no-logger-dev.test.js} +1 -1
- package/build/src/tests/rules/eslint/nova/no-logger-dev.test.js.map +1 -0
- package/build/src/tests/rules/eslint/patterns/no-assign-then-return.test.d.ts +2 -0
- package/build/src/tests/rules/eslint/patterns/no-assign-then-return.test.d.ts.map +1 -0
- package/build/src/tests/rules/eslint/patterns/no-assign-then-return.test.js +39 -0
- package/build/src/tests/rules/eslint/patterns/no-assign-then-return.test.js.map +1 -0
- package/build/src/tests/rules/eslint/patterns/no-bracket-assignment.test.d.ts +2 -0
- package/build/src/tests/rules/eslint/patterns/no-bracket-assignment.test.d.ts.map +1 -0
- package/build/src/tests/rules/eslint/patterns/no-bracket-assignment.test.js +40 -0
- package/build/src/tests/rules/eslint/patterns/no-bracket-assignment.test.js.map +1 -0
- package/build/src/tests/rules/eslint/patterns/no-destructuring.test.d.ts +2 -0
- package/build/src/tests/rules/eslint/patterns/no-destructuring.test.d.ts.map +1 -0
- package/build/src/tests/rules/eslint/patterns/no-destructuring.test.js +86 -0
- package/build/src/tests/rules/eslint/patterns/no-destructuring.test.js.map +1 -0
- package/build/src/tests/rules/eslint/patterns/no-implicit-boolean.test.d.ts +2 -0
- package/build/src/tests/rules/eslint/patterns/no-implicit-boolean.test.d.ts.map +1 -0
- package/build/src/tests/rules/eslint/patterns/no-implicit-boolean.test.js +76 -0
- package/build/src/tests/rules/eslint/patterns/no-implicit-boolean.test.js.map +1 -0
- package/build/src/tests/rules/eslint/patterns/no-ternary-in-template-literal.test.d.ts +2 -0
- package/build/src/tests/rules/eslint/patterns/no-ternary-in-template-literal.test.d.ts.map +1 -0
- package/build/src/tests/rules/eslint/patterns/no-ternary-in-template-literal.test.js +42 -0
- package/build/src/tests/rules/eslint/patterns/no-ternary-in-template-literal.test.js.map +1 -0
- package/build/src/tests/rules/eslint/patterns/switch-case-blocks.test.d.ts.map +1 -0
- package/build/src/tests/rules/eslint/{switch-case-blocks.test.js → patterns/switch-case-blocks.test.js} +1 -1
- package/build/src/tests/rules/eslint/patterns/switch-case-blocks.test.js.map +1 -0
- package/build/src/tests/rules/eslint/regex/no-regex-literal-flags.test.d.ts.map +1 -0
- package/build/src/tests/rules/eslint/{no-regex-literal-flags.test.js → regex/no-regex-literal-flags.test.js} +1 -1
- package/build/src/tests/rules/eslint/regex/no-regex-literal-flags.test.js.map +1 -0
- package/build/src/tests/rules/eslint/regex/no-regex-literals.test.d.ts.map +1 -0
- package/build/src/tests/rules/eslint/{no-regex-literals.test.js → regex/no-regex-literals.test.js} +1 -1
- package/build/src/tests/rules/eslint/regex/no-regex-literals.test.js.map +1 -0
- package/build/src/tests/rules/eslint/typescript/no-catch-unknown-annotation.test.d.ts +2 -0
- package/build/src/tests/rules/eslint/typescript/no-catch-unknown-annotation.test.d.ts.map +1 -0
- package/build/src/tests/rules/eslint/typescript/no-catch-unknown-annotation.test.js +34 -0
- package/build/src/tests/rules/eslint/typescript/no-catch-unknown-annotation.test.js.map +1 -0
- package/build/src/tests/rules/eslint/typescript/no-inline-type-annotation.test.d.ts +2 -0
- package/build/src/tests/rules/eslint/typescript/no-inline-type-annotation.test.d.ts.map +1 -0
- package/build/src/tests/rules/eslint/typescript/no-inline-type-annotation.test.js +55 -0
- package/build/src/tests/rules/eslint/typescript/no-inline-type-annotation.test.js.map +1 -0
- package/build/src/tests/rules/eslint/typescript/no-shared-type-import.test.d.ts +2 -0
- package/build/src/tests/rules/eslint/typescript/no-shared-type-import.test.d.ts.map +1 -0
- package/build/src/tests/rules/eslint/typescript/no-shared-type-import.test.js +51 -0
- package/build/src/tests/rules/eslint/typescript/no-shared-type-import.test.js.map +1 -0
- package/build/src/toolkit/cli-header.d.ts +1 -1
- package/build/src/toolkit/cli-header.js +1 -1
- package/build/src/toolkit/logger.d.ts +1 -1
- package/build/src/toolkit/markdown-table.d.ts +1 -1
- package/package.json +9 -13
- package/build/eslint.config.d.ts +0 -34
- package/build/eslint.config.d.ts.map +0 -1
- package/build/eslint.config.js +0 -40
- package/build/eslint.config.js.map +0 -1
- package/build/src/cli/recipe/pin-versions.d.ts +0 -7
- package/build/src/cli/recipe/pin-versions.d.ts.map +0 -1
- package/build/src/cli/recipe/pin-versions.js +0 -145
- package/build/src/cli/recipe/pin-versions.js.map +0 -1
- package/build/src/cli/recipe/sync-lts-engines.d.ts +0 -6
- package/build/src/cli/recipe/sync-lts-engines.d.ts.map +0 -1
- package/build/src/cli/recipe/sync-lts-engines.js +0 -118
- package/build/src/cli/recipe/sync-lts-engines.js.map +0 -1
- package/build/src/cli/recipe/sync-packages.d.ts +0 -18
- package/build/src/cli/recipe/sync-packages.d.ts.map +0 -1
- package/build/src/cli/recipe/sync-packages.js +0 -1212
- package/build/src/cli/recipe/sync-packages.js.map +0 -1
- package/build/src/rules/eslint/no-logger-dev.d.ts.map +0 -1
- package/build/src/rules/eslint/no-logger-dev.js.map +0 -1
- package/build/src/rules/eslint/no-raw-text-in-code.d.ts.map +0 -1
- package/build/src/rules/eslint/no-raw-text-in-code.js.map +0 -1
- package/build/src/rules/eslint/no-regex-literal-flags.d.ts.map +0 -1
- package/build/src/rules/eslint/no-regex-literal-flags.js.map +0 -1
- package/build/src/rules/eslint/no-regex-literals.d.ts.map +0 -1
- package/build/src/rules/eslint/no-regex-literals.js.map +0 -1
- package/build/src/rules/eslint/switch-case-blocks.d.ts.map +0 -1
- package/build/src/rules/eslint/switch-case-blocks.js.map +0 -1
- package/build/src/tests/cli/recipe/pin-versions.test.d.ts +0 -2
- package/build/src/tests/cli/recipe/pin-versions.test.d.ts.map +0 -1
- package/build/src/tests/cli/recipe/pin-versions.test.js +0 -197
- package/build/src/tests/cli/recipe/pin-versions.test.js.map +0 -1
- package/build/src/tests/cli/recipe/sync-lts-engines.test.d.ts +0 -2
- package/build/src/tests/cli/recipe/sync-lts-engines.test.d.ts.map +0 -1
- package/build/src/tests/cli/recipe/sync-lts-engines.test.js +0 -131
- package/build/src/tests/cli/recipe/sync-lts-engines.test.js.map +0 -1
- package/build/src/tests/rules/eslint/no-logger-dev.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/no-logger-dev.test.js.map +0 -1
- package/build/src/tests/rules/eslint/no-raw-text-in-code.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/no-raw-text-in-code.test.js.map +0 -1
- package/build/src/tests/rules/eslint/no-regex-literal-flags.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/no-regex-literal-flags.test.js.map +0 -1
- package/build/src/tests/rules/eslint/no-regex-literals.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/no-regex-literals.test.js.map +0 -1
- package/build/src/tests/rules/eslint/switch-case-blocks.test.d.ts.map +0 -1
- package/build/src/tests/rules/eslint/switch-case-blocks.test.js.map +0 -1
- /package/build/src/rules/eslint/{no-raw-text-in-code.d.ts → formatting/no-raw-text-in-code.d.ts} +0 -0
- /package/build/src/rules/eslint/{no-logger-dev.d.ts → nova/no-logger-dev.d.ts} +0 -0
- /package/build/src/rules/eslint/{switch-case-blocks.d.ts → patterns/switch-case-blocks.d.ts} +0 -0
- /package/build/src/rules/eslint/{no-regex-literal-flags.d.ts → regex/no-regex-literal-flags.d.ts} +0 -0
- /package/build/src/rules/eslint/{no-regex-literal-flags.js → regex/no-regex-literal-flags.js} +0 -0
- /package/build/src/tests/rules/eslint/{no-raw-text-in-code.test.d.ts → formatting/no-raw-text-in-code.test.d.ts} +0 -0
- /package/build/src/tests/rules/eslint/{no-logger-dev.test.d.ts → nova/no-logger-dev.test.d.ts} +0 -0
- /package/build/src/tests/rules/eslint/{switch-case-blocks.test.d.ts → patterns/switch-case-blocks.test.d.ts} +0 -0
- /package/build/src/tests/rules/eslint/{no-regex-literal-flags.test.d.ts → regex/no-regex-literal-flags.test.d.ts} +0 -0
- /package/build/src/tests/rules/eslint/{no-regex-literals.test.d.ts → regex/no-regex-literals.test.d.ts} +0 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
const CALLBACK_METHODS = new Set([
|
|
3
|
+
'map',
|
|
4
|
+
'filter',
|
|
5
|
+
'find',
|
|
6
|
+
'forEach',
|
|
7
|
+
'some',
|
|
8
|
+
'every',
|
|
9
|
+
'reduce',
|
|
10
|
+
'flatMap',
|
|
11
|
+
'sort',
|
|
12
|
+
'findIndex',
|
|
13
|
+
'findLast',
|
|
14
|
+
'findLastIndex',
|
|
15
|
+
]);
|
|
16
|
+
const noDestructuring = ESLintUtils.RuleCreator(() => '#')({
|
|
17
|
+
name: 'no-destructuring',
|
|
18
|
+
meta: {
|
|
19
|
+
type: 'suggestion',
|
|
20
|
+
docs: {
|
|
21
|
+
description: 'Disallow destructuring patterns in various contexts.',
|
|
22
|
+
},
|
|
23
|
+
messages: {
|
|
24
|
+
noDestructuringCallback: 'Do not destructure callback parameters. Use a descriptive parameter name and access properties or indices in the function body.',
|
|
25
|
+
noDestructuringForOf: 'Do not destructure in `for...of` loops. Use a single variable name and access elements in the loop body. Destructuring is only allowed with `Object.entries()`.',
|
|
26
|
+
noDestructuringParam: 'Do not destructure function parameters. Access properties in the function body instead.',
|
|
27
|
+
noDestructuringVariable: 'Do not destructure in variable declarations. Assign the value and access properties separately.',
|
|
28
|
+
noDestructuringAssignment: 'Do not use destructuring assignment. Access properties separately instead.',
|
|
29
|
+
},
|
|
30
|
+
schema: [
|
|
31
|
+
{
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: {
|
|
34
|
+
functionParams: {
|
|
35
|
+
type: 'boolean',
|
|
36
|
+
},
|
|
37
|
+
callbackParams: {
|
|
38
|
+
type: 'boolean',
|
|
39
|
+
},
|
|
40
|
+
forOfLoops: {
|
|
41
|
+
type: 'boolean',
|
|
42
|
+
},
|
|
43
|
+
variableDeclarations: {
|
|
44
|
+
type: 'boolean',
|
|
45
|
+
},
|
|
46
|
+
assignmentExpressions: {
|
|
47
|
+
type: 'boolean',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
additionalProperties: false,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
defaultOptions: [{
|
|
55
|
+
functionParams: true,
|
|
56
|
+
callbackParams: true,
|
|
57
|
+
forOfLoops: true,
|
|
58
|
+
variableDeclarations: true,
|
|
59
|
+
assignmentExpressions: true,
|
|
60
|
+
}],
|
|
61
|
+
create(context, [options]) {
|
|
62
|
+
const checkFunctionParams = options.functionParams;
|
|
63
|
+
const checkCallbackParams = options.callbackParams;
|
|
64
|
+
const checkForOfLoops = options.forOfLoops;
|
|
65
|
+
const checkVariableDeclarations = options.variableDeclarations;
|
|
66
|
+
const checkAssignmentExpressions = options.assignmentExpressions;
|
|
67
|
+
const checkCallback = (node) => {
|
|
68
|
+
if (checkCallbackParams !== true) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const parent = node.parent;
|
|
72
|
+
if (parent == null || parent.type !== 'CallExpression') {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const callee = parent.callee;
|
|
76
|
+
if (callee.type !== 'MemberExpression' || callee.property.type !== 'Identifier') {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (CALLBACK_METHODS.has(callee.property.name) === false) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
for (const param of node.params) {
|
|
83
|
+
if (param.type === 'ObjectPattern' || param.type === 'ArrayPattern') {
|
|
84
|
+
context.report({
|
|
85
|
+
node: param,
|
|
86
|
+
messageId: 'noDestructuringCallback',
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const checkForOf = (node) => {
|
|
92
|
+
if (checkForOfLoops !== true) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const left = node.left;
|
|
96
|
+
if (left.type !== 'VariableDeclaration') {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const declarator = left.declarations[0];
|
|
100
|
+
if (declarator === undefined) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (declarator.id.type !== 'ArrayPattern' && declarator.id.type !== 'ObjectPattern') {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const right = node.right;
|
|
107
|
+
if (right.type === 'CallExpression'
|
|
108
|
+
&& right.callee.type === 'MemberExpression'
|
|
109
|
+
&& right.callee.object.type === 'Identifier'
|
|
110
|
+
&& right.callee.object.name === 'Object'
|
|
111
|
+
&& right.callee.property.type === 'Identifier'
|
|
112
|
+
&& right.callee.property.name === 'entries') {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
context.report({
|
|
116
|
+
node: declarator.id,
|
|
117
|
+
messageId: 'noDestructuringForOf',
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
const checkFunction = (node) => {
|
|
121
|
+
if (checkFunctionParams !== true) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const parent = node.parent;
|
|
125
|
+
if (parent != null && parent.type === 'CallExpression') {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
for (const param of node.params) {
|
|
129
|
+
if (param.type === 'ObjectPattern' || param.type === 'ArrayPattern') {
|
|
130
|
+
context.report({
|
|
131
|
+
node: param,
|
|
132
|
+
messageId: 'noDestructuringParam',
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const checkDeclarator = (node) => {
|
|
138
|
+
if (checkVariableDeclarations !== true) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (node.id.type !== 'ObjectPattern' && node.id.type !== 'ArrayPattern') {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const parent = node.parent;
|
|
145
|
+
if (parent != null && parent.parent != null && parent.parent.type === 'ForOfStatement') {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
context.report({
|
|
149
|
+
node: node.id,
|
|
150
|
+
messageId: 'noDestructuringVariable',
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
const checkAssignment = (node) => {
|
|
154
|
+
if (checkAssignmentExpressions !== true) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
if (node.left.type === 'ObjectPattern' || node.left.type === 'ArrayPattern') {
|
|
158
|
+
context.report({
|
|
159
|
+
node: node.left,
|
|
160
|
+
messageId: 'noDestructuringAssignment',
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
return {
|
|
165
|
+
'ArrowFunctionExpression': checkCallback,
|
|
166
|
+
'FunctionExpression': checkCallback,
|
|
167
|
+
'ForOfStatement': checkForOf,
|
|
168
|
+
'FunctionDeclaration': checkFunction,
|
|
169
|
+
'ArrowFunctionExpression:exit': checkFunction,
|
|
170
|
+
'FunctionExpression:exit': checkFunction,
|
|
171
|
+
'VariableDeclarator': checkDeclarator,
|
|
172
|
+
'AssignmentExpression': checkAssignment,
|
|
173
|
+
};
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
export default noDestructuring;
|
|
177
|
+
//# sourceMappingURL=no-destructuring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-destructuring.js","sourceRoot":"","sources":["../../../../../src/rules/eslint/patterns/no-destructuring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AA0BvD,MAAM,gBAAgB,GAAmC,IAAI,GAAG,CAAC;IAC/D,KAAK;IACL,QAAQ;IACR,MAAM;IACN,SAAS;IACT,MAAM;IACN,OAAO;IACP,QAAQ;IACR,SAAS;IACT,MAAM;IACN,WAAW;IACX,UAAU;IACV,eAAe;CAChB,CAAC,CAAC;AAOH,MAAM,eAAe,GAAG,WAAW,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACzD,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,sDAAsD;SACpE;QACD,QAAQ,EAAE;YACR,uBAAuB,EAAE,iIAAiI;YAC1J,oBAAoB,EAAE,iKAAiK;YACvL,oBAAoB,EAAE,yFAAyF;YAC/G,uBAAuB,EAAE,iGAAiG;YAC1H,yBAAyB,EAAE,4EAA4E;SACxG;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,cAAc,EAAE;wBACd,IAAI,EAAE,SAAS;qBAChB;oBACD,cAAc,EAAE;wBACd,IAAI,EAAE,SAAS;qBAChB;oBACD,UAAU,EAAE;wBACV,IAAI,EAAE,SAAS;qBAChB;oBACD,oBAAo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AAC,CAAC;QAWF,MAAM,eAAe,GAAG,CAAC,IAAwC,EAAyC,EAAE;YAC1G,IAAI,0BAA0B,KAAK,IAAI,EAAE,CAAC;gBACxC,OAAO;YACT,CAAC;YAED,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,eAAe,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;gBAC5E,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,SAAS,EAAE,2BAA2B;iBACvC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC;QAEF,OAAO;YACL,yBAAyB,EAAE,aAAa;YACxC,oBAAoB,EAAE,aAAa;YACnC,gBAAgB,EAAE,UAAU;YAC5B,qBAAqB,EAAE,aAAa;YACpC,8BAA8B,EAAE,aAAa;YAC7C,yBAAyB,EAAE,aAAa;YACxC,oBAAoB,EAAE,eAAe;YACrC,sBAAsB,EAAE,eAAe;SACxC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
declare const noImplicitBoolean: ESLintUtils.RuleModule<"requireExplicitCheck", [], unknown, ESLintUtils.RuleListener> & {
|
|
3
|
+
name: string;
|
|
4
|
+
};
|
|
5
|
+
export default noImplicitBoolean;
|
|
6
|
+
//# sourceMappingURL=no-implicit-boolean.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-implicit-boolean.d.ts","sourceRoot":"","sources":["../../../../../src/rules/eslint/patterns/no-implicit-boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAgBvD,QAAA,MAAM,iBAAiB;;CAsGrB,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
const noImplicitBoolean = ESLintUtils.RuleCreator(() => '#')({
|
|
3
|
+
name: 'no-implicit-boolean',
|
|
4
|
+
meta: {
|
|
5
|
+
type: 'suggestion',
|
|
6
|
+
docs: {
|
|
7
|
+
description: 'Require explicit boolean comparisons instead of relying on truthy/falsy coercion.',
|
|
8
|
+
},
|
|
9
|
+
messages: {
|
|
10
|
+
requireExplicitCheck: 'Use an explicit comparison instead of relying on truthy/falsy coercion (e.g., `=== undefined`, `=== true`, `> 0`).',
|
|
11
|
+
},
|
|
12
|
+
schema: [],
|
|
13
|
+
},
|
|
14
|
+
defaultOptions: [],
|
|
15
|
+
create(context) {
|
|
16
|
+
const isImplicitBoolean = (node) => {
|
|
17
|
+
if (node.type === 'Identifier') {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
if (node.type === 'MemberExpression') {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
if (node.type === 'CallExpression') {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
if (node.type === 'UnaryExpression' && node.operator === '!') {
|
|
27
|
+
const argument = node.argument;
|
|
28
|
+
return argument.type === 'Identifier' || argument.type === 'MemberExpression' || argument.type === 'CallExpression';
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
};
|
|
32
|
+
const reportImplicitNodes = (test) => {
|
|
33
|
+
if (test.type === 'LogicalExpression') {
|
|
34
|
+
reportImplicitNodes(test.left);
|
|
35
|
+
reportImplicitNodes(test.right);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (isImplicitBoolean(test) === true) {
|
|
39
|
+
context.report({
|
|
40
|
+
node: test,
|
|
41
|
+
messageId: 'requireExplicitCheck',
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const checkCondition = (node) => {
|
|
46
|
+
const test = node.type === 'ForStatement' ? node.test : node.test;
|
|
47
|
+
if (test == null) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
reportImplicitNodes(test);
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
IfStatement: checkCondition,
|
|
54
|
+
WhileStatement: checkCondition,
|
|
55
|
+
DoWhileStatement: checkCondition,
|
|
56
|
+
ForStatement: checkCondition,
|
|
57
|
+
ConditionalExpression: checkCondition,
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
export default noImplicitBoolean;
|
|
62
|
+
//# sourceMappingURL=no-implicit-boolean.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-implicit-boolean.js","sourceRoot":"","sources":["../../../../../src/rules/eslint/patterns/no-implicit-boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAgBvD,MAAM,iBAAiB,GAAG,WAAW,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAC3D,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,mFAAmF;SACjG;QACD,QAAQ,EAAE;YACR,oBAAoB,EAAE,oHAAoH;SAC3I;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QAUZ,MAAM,iBAAiB,GAAG,CAAC,IAA4C,EAA6C,EAAE;YAEpH,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;gBAC/B,OAAO,IAAI,CAAC;YACd,CAAC;YAGD,IAAI,IAAI,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;gBACrC,OAAO,IAAI,CAAC;YACd,CAAC;YAGD,IAAI,IAAI,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;gBACnC,OAAO,IAAI,CAAC;YACd,CAAC;YAGD,IAAI,IAAI,CAAC,IAAI,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AAiB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
declare const noTernaryInTemplateLiteral: ESLintUtils.RuleModule<"noTernaryInTemplate", [], unknown, ESLintUtils.RuleListener> & {
|
|
3
|
+
name: string;
|
|
4
|
+
};
|
|
5
|
+
export default noTernaryInTemplateLiteral;
|
|
6
|
+
//# sourceMappingURL=no-ternary-in-template-literal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-ternary-in-template-literal.d.ts","sourceRoot":"","sources":["../../../../../src/rules/eslint/patterns/no-ternary-in-template-literal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAYvD,QAAA,MAAM,0BAA0B;;CAsC9B,CAAC;AAEH,eAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
const noTernaryInTemplateLiteral = ESLintUtils.RuleCreator(() => '#')({
|
|
3
|
+
name: 'no-ternary-in-template-literal',
|
|
4
|
+
meta: {
|
|
5
|
+
type: 'suggestion',
|
|
6
|
+
docs: {
|
|
7
|
+
description: 'Disallow ternary expressions inside template literals.',
|
|
8
|
+
},
|
|
9
|
+
messages: {
|
|
10
|
+
noTernaryInTemplate: 'Do not use ternary expressions inside template literals. Extract the ternary into a variable first.',
|
|
11
|
+
},
|
|
12
|
+
schema: [],
|
|
13
|
+
},
|
|
14
|
+
defaultOptions: [],
|
|
15
|
+
create(context) {
|
|
16
|
+
const checkTemplateLiteral = (node) => {
|
|
17
|
+
for (const expression of node.expressions) {
|
|
18
|
+
if (expression.type === 'ConditionalExpression') {
|
|
19
|
+
context.report({
|
|
20
|
+
node: expression,
|
|
21
|
+
messageId: 'noTernaryInTemplate',
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
TemplateLiteral: checkTemplateLiteral,
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
export default noTernaryInTemplateLiteral;
|
|
32
|
+
//# sourceMappingURL=no-ternary-in-template-literal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-ternary-in-template-literal.js","sourceRoot":"","sources":["../../../../../src/rules/eslint/patterns/no-ternary-in-template-literal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAYvD,MAAM,0BAA0B,GAAG,WAAW,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACpE,IAAI,EAAE,gCAAgC;IACtC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,wDAAwD;SACtE;QACD,QAAQ,EAAE;YACR,mBAAmB,EAAE,qGAAqG;SAC3H;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QAUZ,MAAM,oBAAoB,GAAG,CAAC,IAAwD,EAAyD,EAAE;YAC/I,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;gBAC1C,IAAI,UAAU,CAAC,IAAI,KAAK,uBAAuB,EAAE,CAAC;oBAChD,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI,EAAE,UAAU;wBAChB,SAAS,EAAE,qBAAqB;qBACjC,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAEF,OAAO;YACL,eAAe,EAAE,oBAAoB;SACtC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch-case-blocks.d.ts","sourceRoot":"","sources":["../../../../../src/rules/eslint/patterns/switch-case-blocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AASvD,QAAA,MAAM,gBAAgB;;CAgDpB,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
|
|
@@ -14,11 +14,11 @@ const switchCaseBlocks = ESLintUtils.RuleCreator(() => '#')({
|
|
|
14
14
|
defaultOptions: [],
|
|
15
15
|
create(context) {
|
|
16
16
|
const checkCase = (node) => {
|
|
17
|
-
const
|
|
17
|
+
const consequent = node.consequent;
|
|
18
18
|
if (consequent.length === 0) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const firstConsequent = consequent[0];
|
|
22
22
|
if (consequent.length === 1 && firstConsequent !== undefined && firstConsequent.type === 'BlockStatement') {
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch-case-blocks.js","sourceRoot":"","sources":["../../../../../src/rules/eslint/patterns/switch-case-blocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AASvD,MAAM,gBAAgB,GAAG,WAAW,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAC1D,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE;YACJ,WAAW,EAAE,uFAAuF;SACrG;QACD,QAAQ,EAAE;YACR,YAAY,EAAE,wCAAwC;SACvD;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QAUZ,MAAM,SAAS,GAAG,CAAC,IAAmC,EAAoC,EAAE;YAC1F,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;YAGnC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC5B,OAAO;YACT,CAAC;YAGD,MAAM,eAAe,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;YAEtC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,eAAe,KAAK,SAAS,IAAI,eAAe,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;gBAC1G,OAAO;YACT,CAAC;YAED,OAAO,CAAC,MAAM,CAAC;gBACb,IAAI;gBACJ,SAAS,EAAE,cAAc;aAC1B,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,OAAO;YACL,UAAU,EAAE,SAAS;SACtB,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-regex-literal-flags.d.ts","sourceRoot":"","sources":["../../../../../src/rules/eslint/regex/no-regex-literal-flags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AASvD,QAAA,MAAM,mBAAmB;;CAoCvB,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-regex-literal-flags.js","sourceRoot":"","sources":["../../../../../src/rules/eslint/regex/no-regex-literal-flags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AASvD,MAAM,mBAAmB,GAAG,WAAW,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAC7D,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,sGAAsG;SACpH;QACD,QAAQ,EAAE;YACR,YAAY,EAAE,wGAAwG;SACvH;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QAUZ,MAAM,YAAY,GAAG,CAAC,IAAyC,EAA0C,EAAE;YACzG,IAAI,OAAO,IAAI,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC/E,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,SAAS,EAAE,cAAc;iBAC1B,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC;QAEF,OAAO;YACL,OAAO,EAAE,YAAY;SACtB,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
-
import type { NoRegexLiteralsDefaultOptionsAllowedFiles } from '
|
|
2
|
+
import type { NoRegexLiteralsDefaultOptionsAllowedFiles } from '../../../types/rules/eslint/regex/no-regex-literals.d.ts';
|
|
3
3
|
declare const noRegexLiterals: ESLintUtils.RuleModule<"noRegexLiteral", [{
|
|
4
4
|
allowedFiles: NoRegexLiteralsDefaultOptionsAllowedFiles;
|
|
5
5
|
}], unknown, ESLintUtils.RuleListener> & {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-regex-literals.d.ts","sourceRoot":"","sources":["../../../../../src/rules/eslint/regex/no-regex-literals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,KAAK,EAGV,yCAAyC,EAC1C,MAAM,mDAAmD,CAAC;AAO3D,QAAA,MAAM,eAAe;kBA0BG,yCAAyC;;;CAwC/D,CAAC;AAEH,eAAe,eAAe,CAAC"}
|
|
@@ -30,10 +30,10 @@ const noRegexLiterals = ESLintUtils.RuleCreator(() => '#')({
|
|
|
30
30
|
create(context, [options]) {
|
|
31
31
|
const allowedFiles = options.allowedFiles;
|
|
32
32
|
const normalizedFilename = context.filename.replaceAll('\\', '/');
|
|
33
|
-
const isAllowed = allowedFiles.some((
|
|
34
|
-
const
|
|
35
|
-
return normalizedFilename ===
|
|
36
|
-
|| normalizedFilename.endsWith(`/${
|
|
33
|
+
const isAllowed = allowedFiles.some((allowedFile) => {
|
|
34
|
+
const normalizedAllowedFile = allowedFile.replaceAll('\\', '/');
|
|
35
|
+
return normalizedFilename === normalizedAllowedFile
|
|
36
|
+
|| normalizedFilename.endsWith(`/${normalizedAllowedFile}`);
|
|
37
37
|
});
|
|
38
38
|
if (isAllowed === true) {
|
|
39
39
|
return {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-regex-literals.js","sourceRoot":"","sources":["../../../../../src/rules/eslint/regex/no-regex-literals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAavD,MAAM,eAAe,GAAG,WAAW,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACzD,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,4FAA4F;SAC1G;QACD,QAAQ,EAAE;YACR,cAAc,EAAE,wGAAwG;SACzH;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,YAAY,EAAE;wBACZ,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;yBACf;qBACF;iBACF;gBACD,oBAAoB,EAAE,KAAK;aAC5B;SACF;KACF;IACD,cAAc,EAAE,CAAC;YACf,YAAY,EAAE,EAA+C;SAC9D,CAAC;IACF,MAAM,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC;QACvB,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QAC1C,MAAM,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAGlE,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE;YAClD,MAAM,qBAAqB,GAAG,WAAW,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YAEhE,OAAO,kBAAkB,KAAK,qBAAqB;mBAC9C,kBAAkB,CAAC,QAAQ,CAAC,IAAI,qBAAqB,EAAE,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC;QAEH,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YACvB,OAAO,EAAE,CAAC;QACZ,CAAC;QAWD,MAAM,YAAY,GAAG,CAAC,IAAqC,EAAsC,EAAE;YACjG,IAAI,OAAO,IAAI,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;gBAChD,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,SAAS,EAAE,gBAAgB;iBAC5B,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC;QAEF,OAAO;YACL,OAAO,EAAE,YAAY;SACtB,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
declare const noCatchUnknownAnnotation: ESLintUtils.RuleModule<"removeCatchAnnotation", [], unknown, ESLintUtils.RuleListener> & {
|
|
3
|
+
name: string;
|
|
4
|
+
};
|
|
5
|
+
export default noCatchUnknownAnnotation;
|
|
6
|
+
//# sourceMappingURL=no-catch-unknown-annotation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-catch-unknown-annotation.d.ts","sourceRoot":"","sources":["../../../../../src/rules/eslint/typescript/no-catch-unknown-annotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAYvD,QAAA,MAAM,wBAAwB;;CAgD5B,CAAC;AAEH,eAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
const noCatchUnknownAnnotation = ESLintUtils.RuleCreator(() => '#')({
|
|
3
|
+
name: 'no-catch-unknown-annotation',
|
|
4
|
+
meta: {
|
|
5
|
+
type: 'suggestion',
|
|
6
|
+
docs: {
|
|
7
|
+
description: 'Disallow redundant `: unknown` annotation on catch clause variables.',
|
|
8
|
+
},
|
|
9
|
+
messages: {
|
|
10
|
+
removeCatchAnnotation: 'Remove the redundant `: unknown` annotation. TypeScript defaults catch variables to `unknown`.',
|
|
11
|
+
},
|
|
12
|
+
schema: [],
|
|
13
|
+
},
|
|
14
|
+
defaultOptions: [],
|
|
15
|
+
create(context) {
|
|
16
|
+
const checkCatchClause = (node) => {
|
|
17
|
+
const param = node.param;
|
|
18
|
+
if (param == null) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const typeAnnotation = param.typeAnnotation;
|
|
22
|
+
if (typeAnnotation === undefined) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (typeAnnotation.typeAnnotation.type === 'TSUnknownKeyword') {
|
|
26
|
+
context.report({
|
|
27
|
+
node: typeAnnotation,
|
|
28
|
+
messageId: 'removeCatchAnnotation',
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
return {
|
|
33
|
+
CatchClause: checkCatchClause,
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
export default noCatchUnknownAnnotation;
|
|
38
|
+
//# sourceMappingURL=no-catch-unknown-annotation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-catch-unknown-annotation.js","sourceRoot":"","sources":["../../../../../src/rules/eslint/typescript/no-catch-unknown-annotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAYvD,MAAM,wBAAwB,GAAG,WAAW,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAClE,IAAI,EAAE,6BAA6B;IACnC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,sEAAsE;SACpF;QACD,QAAQ,EAAE;YACR,qBAAqB,EAAE,gGAAgG;SACxH;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QAUZ,MAAM,gBAAgB,GAAG,CAAC,IAAkD,EAAmD,EAAE;YAC/H,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YAEzB,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;gBAClB,OAAO;YACT,CAAC;YAED,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;YAE5C,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;gBACjC,OAAO;YACT,CAAC;YAED,IAAI,cAAc,CAAC,cAAc,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;gBAC9D,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI,EAAE,cAAc;oBACpB,SAAS,EAAE,uBAAuB;iBACnC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC;QAEF,OAAO;YACL,WAAW,EAAE,gBAAgB;SAC9B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
declare const noInlineTypeAnnotation: ESLintUtils.RuleModule<"useNamedType", [], unknown, ESLintUtils.RuleListener> & {
|
|
3
|
+
name: string;
|
|
4
|
+
};
|
|
5
|
+
export default noInlineTypeAnnotation;
|
|
6
|
+
//# sourceMappingURL=no-inline-type-annotation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-inline-type-annotation.d.ts","sourceRoot":"","sources":["../../../../../src/rules/eslint/typescript/no-inline-type-annotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAYvD,QAAA,MAAM,sBAAsB;;CAgD1B,CAAC;AAEH,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
const noInlineTypeAnnotation = ESLintUtils.RuleCreator(() => '#')({
|
|
3
|
+
name: 'no-inline-type-annotation',
|
|
4
|
+
meta: {
|
|
5
|
+
type: 'suggestion',
|
|
6
|
+
docs: {
|
|
7
|
+
description: 'Disallow inline type annotations in code files. Extract the type to a named alias in a `.d.ts` file.',
|
|
8
|
+
},
|
|
9
|
+
messages: {
|
|
10
|
+
useNamedType: 'Do not use inline type annotations in code files. Extract the type to a named alias in a `.d.ts` file.',
|
|
11
|
+
},
|
|
12
|
+
schema: [],
|
|
13
|
+
},
|
|
14
|
+
defaultOptions: [],
|
|
15
|
+
create(context) {
|
|
16
|
+
const normalizedFilename = context.filename.replaceAll('\\', '/');
|
|
17
|
+
if (normalizedFilename.endsWith('.d.ts')) {
|
|
18
|
+
return {};
|
|
19
|
+
}
|
|
20
|
+
const checkTypeAnnotation = (node) => {
|
|
21
|
+
const typeNode = node.typeAnnotation;
|
|
22
|
+
if (typeNode.type === 'TSTypeReference' && typeNode.typeArguments === undefined) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
context.report({
|
|
26
|
+
node: typeNode,
|
|
27
|
+
messageId: 'useNamedType',
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
TSTypeAnnotation: checkTypeAnnotation,
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
export default noInlineTypeAnnotation;
|
|
36
|
+
//# sourceMappingURL=no-inline-type-annotation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-inline-type-annotation.js","sourceRoot":"","sources":["../../../../../src/rules/eslint/typescript/no-inline-type-annotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAYvD,MAAM,sBAAsB,GAAG,WAAW,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAChE,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,sGAAsG;SACpH;QACD,QAAQ,EAAE;YACR,YAAY,EAAE,wGAAwG;SACvH;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAGlE,IAAI,kBAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YACzC,OAAO,EAAE,CAAC;QACZ,CAAC;QAWD,MAAM,mBAAmB,GAAG,CAAC,IAAmD,EAAoD,EAAE;YACpI,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC;YAGrC,IAAI,QAAQ,CAAC,IAAI,KAAK,iBAAiB,IAAI,QAAQ,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;gBAChF,OAAO;YACT,CAAC;YAED,OAAO,CAAC,MAAM,CAAC;gBACb,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,cAAc;aAC1B,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,OAAO;YACL,gBAAgB,EAAE,mBAAmB;SACtC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
import type { NoSharedTypeImportDefaultOptionsSharedFiles } from '../../../types/rules/eslint/typescript/no-shared-type-import.d.ts';
|
|
3
|
+
declare const noSharedTypeImport: ESLintUtils.RuleModule<"noSharedTypeImport", [{
|
|
4
|
+
sharedFiles: NoSharedTypeImportDefaultOptionsSharedFiles;
|
|
5
|
+
}], unknown, ESLintUtils.RuleListener> & {
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
export default noSharedTypeImport;
|
|
9
|
+
//# sourceMappingURL=no-shared-type-import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-shared-type-import.d.ts","sourceRoot":"","sources":["../../../../../src/rules/eslint/typescript/no-shared-type-import.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,KAAK,EAGV,2CAA2C,EAC5C,MAAM,4DAA4D,CAAC;AAOpE,QAAA,MAAM,kBAAkB;iBA0BD,2CAA2C;;;CA2ChE,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
const noSharedTypeImport = ESLintUtils.RuleCreator(() => '#')({
|
|
3
|
+
name: 'no-shared-type-import',
|
|
4
|
+
meta: {
|
|
5
|
+
type: 'problem',
|
|
6
|
+
docs: {
|
|
7
|
+
description: 'Disallow importing shared type files in code files. Shared types should only be imported by `.d.ts` files.',
|
|
8
|
+
},
|
|
9
|
+
messages: {
|
|
10
|
+
noSharedTypeImport: 'Do not import from shared type files in code files. Import from the domain `.d.ts` file instead.',
|
|
11
|
+
},
|
|
12
|
+
schema: [
|
|
13
|
+
{
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
sharedFiles: {
|
|
17
|
+
type: 'array',
|
|
18
|
+
items: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
additionalProperties: false,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
defaultOptions: [{
|
|
28
|
+
sharedFiles: [],
|
|
29
|
+
}],
|
|
30
|
+
create(context, [options]) {
|
|
31
|
+
const sharedFiles = options.sharedFiles;
|
|
32
|
+
const normalizedFilename = context.filename.replaceAll('\\', '/');
|
|
33
|
+
if (normalizedFilename.endsWith('.d.ts')) {
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
const checkImport = (node) => {
|
|
37
|
+
const source = node.source.value;
|
|
38
|
+
const normalizedSource = source.replaceAll('\\', '/');
|
|
39
|
+
const isShared = sharedFiles.some((sharedFile) => {
|
|
40
|
+
const normalizedSharedFile = sharedFile.replaceAll('\\', '/');
|
|
41
|
+
return normalizedSource === normalizedSharedFile
|
|
42
|
+
|| normalizedSource.endsWith(`/${normalizedSharedFile}`);
|
|
43
|
+
});
|
|
44
|
+
if (isShared === true) {
|
|
45
|
+
context.report({
|
|
46
|
+
node,
|
|
47
|
+
messageId: 'noSharedTypeImport',
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
ImportDeclaration: checkImport,
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
export default noSharedTypeImport;
|
|
57
|
+
//# sourceMappingURL=no-shared-type-import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-shared-type-import.js","sourceRoot":"","sources":["../../../../../src/rules/eslint/typescript/no-shared-type-import.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAavD,MAAM,kBAAkB,GAAG,WAAW,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAC5D,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,4GAA4G;SAC1H;QACD,QAAQ,EAAE;YACR,kBAAkB,EAAE,kGAAkG;SACvH;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