Skip to content

Commit 3151fb5

Browse files
authored
Merge pull request #43 from bertdeblock/remove-nested-ternary-operators-in-documents
Remove nested ternary operators in generator documents
2 parents 617b2d8 + 56df6e9 commit 3151fb5

File tree

5 files changed

+20
-13
lines changed

5 files changed

+20
-13
lines changed

documents/component.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ root: "."
44
output: "**/*"
55
---
66

7-
# {{inputs.typescript ? "!" : (inputs.classBased ? "!" : "")}}{{inputs.name.path}}.gjs
7+
# {{!inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.gjs
88

99
```gjs
1010
<template>{{"{{"}}yield{{"}}"}}</template>
1111
1212
```
1313

14-
# {{inputs.typescript ? "!" : (inputs.classBased ? "" : "!")}}{{inputs.name.path}}.gjs
14+
# {{!inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.gjs
1515

1616
```gjs
1717
import Component from "@glimmer/component";
@@ -22,7 +22,7 @@ export default class {{inputs.name.pascal}} extends Component {
2222
2323
```
2424

25-
# {{inputs.typescript ? (inputs.classBased ? "!" : "") : "!"}}{{inputs.name.path}}.gts
25+
# {{inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.gts
2626

2727
```gts
2828
import type { TOC } from '@ember/component/template-only';
@@ -41,7 +41,7 @@ export default {{inputs.name.pascal}};
4141
4242
```
4343

44-
# {{inputs.typescript ? (inputs.classBased ? "" : "!") : "!"}}{{inputs.name.path}}.gts
44+
# {{inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.gts
4545

4646
```gts
4747
import Component from "@glimmer/component";

documents/config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
export default {
1+
import type { Config } from "scaffdog";
2+
3+
const config: Config = {
24
files: ["*.md"],
35
};
6+
7+
export default config;

documents/helper.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ root: "."
44
output: "**/*"
55
---
66

7-
# {{inputs.typescript ? "!" : (inputs.classBased ? "!" : "")}}{{inputs.name.path}}.js
7+
# {{!inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.js
88

99
```js
1010
import { helper } from "@ember/component/helper";
@@ -15,7 +15,7 @@ export default helper(function {{inputs.name.camel}}(positional, named) {
1515

1616
```
1717

18-
# {{inputs.typescript ? "!" : (inputs.classBased ? "" : "!")}}{{inputs.name.path}}.js
18+
# {{!inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.js
1919

2020
```js
2121
import Helper from "@ember/component/helper";
@@ -28,7 +28,7 @@ export default class {{inputs.name.pascal}} extends Helper {
2828

2929
```
3030

31-
# {{inputs.typescript ? (inputs.classBased ? "!" : "") : "!"}}{{inputs.name.path}}.ts
31+
# {{inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.ts
3232

3333
```ts
3434
import { helper } from "@ember/component/helper";
@@ -51,7 +51,7 @@ export default helper<{{inputs.signature}}>(function {{inputs.name.camel}}(posit
5151

5252
```
5353

54-
# {{inputs.typescript ? (inputs.classBased ? "" : "!") : "!"}}{{inputs.name.path}}.ts
54+
# {{inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.ts
5555

5656
```ts
5757
import Helper from "@ember/component/helper";

documents/modifier.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ root: "."
44
output: "**/*"
55
---
66

7-
# {{inputs.typescript ? "!" : (inputs.classBased ? "!" : "")}}{{inputs.name.path}}.js
7+
# {{!inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.js
88

99
```js
1010
import { modifier } from "ember-modifier";
@@ -13,7 +13,7 @@ export default modifier(function {{inputs.name.camel}}(element, positional, name
1313

1414
```
1515

16-
# {{inputs.typescript ? "!" : (inputs.classBased ? "" : "!")}}{{inputs.name.path}}.js
16+
# {{!inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.js
1717

1818
```js
1919
import Modifier from "ember-modifier";
@@ -24,7 +24,7 @@ export default class {{inputs.name.pascal}} extends Modifier {
2424

2525
```
2626

27-
# {{inputs.typescript ? (inputs.classBased ? "!" : "") : "!"}}{{inputs.name.path}}.ts
27+
# {{inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.ts
2828

2929
```ts
3030
import { modifier } from "ember-modifier";
@@ -41,7 +41,7 @@ export default modifier<{{inputs.signature}}>(function {{inputs.name.camel}}(ele
4141

4242
```
4343

44-
# {{inputs.typescript ? (inputs.classBased ? "" : "!") : "!"}}{{inputs.name.path}}.ts
44+
# {{inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.ts
4545

4646
```ts
4747
import Modifier from "ember-modifier";

vitest.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ export default defineConfig({
66
ignored: ["**/test/output/**"],
77
},
88
},
9+
test: {
10+
forceRerunTriggers: ["**/documents/**"],
11+
},
912
});

0 commit comments

Comments
 (0)