From 56df6e926586ec257655cf823a59bd71823c2510 Mon Sep 17 00:00:00 2001 From: Bert De Block Date: Thu, 28 Nov 2024 11:15:30 +0100 Subject: [PATCH] Remove nested ternary operators in documents --- documents/component.md | 8 ++++---- documents/config.ts | 6 +++++- documents/helper.md | 8 ++++---- documents/modifier.md | 8 ++++---- vitest.config.ts | 3 +++ 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/documents/component.md b/documents/component.md index 89aff7c..554a317 100644 --- a/documents/component.md +++ b/documents/component.md @@ -4,14 +4,14 @@ root: "." output: "**/*" --- -# {{inputs.typescript ? "!" : (inputs.classBased ? "!" : "")}}{{inputs.name.path}}.gjs +# {{!inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.gjs ```gjs ``` -# {{inputs.typescript ? "!" : (inputs.classBased ? "" : "!")}}{{inputs.name.path}}.gjs +# {{!inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.gjs ```gjs import Component from "@glimmer/component"; @@ -22,7 +22,7 @@ export default class {{inputs.name.pascal}} extends Component { ``` -# {{inputs.typescript ? (inputs.classBased ? "!" : "") : "!"}}{{inputs.name.path}}.gts +# {{inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.gts ```gts import type { TOC } from '@ember/component/template-only'; @@ -41,7 +41,7 @@ export default {{inputs.name.pascal}}; ``` -# {{inputs.typescript ? (inputs.classBased ? "" : "!") : "!"}}{{inputs.name.path}}.gts +# {{inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.gts ```gts import Component from "@glimmer/component"; diff --git a/documents/config.ts b/documents/config.ts index dab84e5..df6aff3 100644 --- a/documents/config.ts +++ b/documents/config.ts @@ -1,3 +1,7 @@ -export default { +import type { Config } from "scaffdog"; + +const config: Config = { files: ["*.md"], }; + +export default config; diff --git a/documents/helper.md b/documents/helper.md index 541e9c4..2ce484e 100644 --- a/documents/helper.md +++ b/documents/helper.md @@ -4,7 +4,7 @@ root: "." output: "**/*" --- -# {{inputs.typescript ? "!" : (inputs.classBased ? "!" : "")}}{{inputs.name.path}}.js +# {{!inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.js ```js import { helper } from "@ember/component/helper"; @@ -15,7 +15,7 @@ export default helper(function {{inputs.name.camel}}(positional, named) { ``` -# {{inputs.typescript ? "!" : (inputs.classBased ? "" : "!")}}{{inputs.name.path}}.js +# {{!inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.js ```js import Helper from "@ember/component/helper"; @@ -28,7 +28,7 @@ export default class {{inputs.name.pascal}} extends Helper { ``` -# {{inputs.typescript ? (inputs.classBased ? "!" : "") : "!"}}{{inputs.name.path}}.ts +# {{inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.ts ```ts import { helper } from "@ember/component/helper"; @@ -51,7 +51,7 @@ export default helper<{{inputs.signature}}>(function {{inputs.name.camel}}(posit ``` -# {{inputs.typescript ? (inputs.classBased ? "" : "!") : "!"}}{{inputs.name.path}}.ts +# {{inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.ts ```ts import Helper from "@ember/component/helper"; diff --git a/documents/modifier.md b/documents/modifier.md index b6cb554..09ef196 100644 --- a/documents/modifier.md +++ b/documents/modifier.md @@ -4,7 +4,7 @@ root: "." output: "**/*" --- -# {{inputs.typescript ? "!" : (inputs.classBased ? "!" : "")}}{{inputs.name.path}}.js +# {{!inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.js ```js import { modifier } from "ember-modifier"; @@ -13,7 +13,7 @@ export default modifier(function {{inputs.name.camel}}(element, positional, name ``` -# {{inputs.typescript ? "!" : (inputs.classBased ? "" : "!")}}{{inputs.name.path}}.js +# {{!inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.js ```js import Modifier from "ember-modifier"; @@ -24,7 +24,7 @@ export default class {{inputs.name.pascal}} extends Modifier { ``` -# {{inputs.typescript ? (inputs.classBased ? "!" : "") : "!"}}{{inputs.name.path}}.ts +# {{inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.ts ```ts import { modifier } from "ember-modifier"; @@ -41,7 +41,7 @@ export default modifier<{{inputs.signature}}>(function {{inputs.name.camel}}(ele ``` -# {{inputs.typescript ? (inputs.classBased ? "" : "!") : "!"}}{{inputs.name.path}}.ts +# {{inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.ts ```ts import Modifier from "ember-modifier"; diff --git a/vitest.config.ts b/vitest.config.ts index 16efaf7..85bc592 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -6,4 +6,7 @@ export default defineConfig({ ignored: ["**/test/output/**"], }, }, + test: { + forceRerunTriggers: ["**/documents/**"], + }, });