Skip to content

Commit 13479d9

Browse files
committed
feat(tsl-dx): Add configuration options to no-multiline-template-expression-without-auto-dedent
- Add `dedentTagNames` option to configure which tag names trigger the rule - Add `dedentTagImportCallback` for custom import generation - Improve documentation and test coverage
1 parent b293d4c commit 13479d9

18 files changed

+340
-120
lines changed

.pkgs/configs/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"dependencies": {
1717
"@tsconfig/node24": "^24.0.4",
1818
"@tsconfig/strictest": "^2.0.8",
19-
"tsl": "^1.0.28"
19+
"tsl": "^1.0.28",
20+
"tsl-dx": "workspace:*"
2021
}
2122
}

.pkgs/configs/tsl.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ export default defineConfig({
2626
nullish(),
2727
noDuplicateImports(),
2828
noDuplicateExports(),
29-
noMultilineTemplateExpressionWithoutAutoDedent(),
29+
noMultilineTemplateExpressionWithoutAutoDedent({
30+
dedentTagNames: ["ts", "tsx", "dedent"],
31+
dedentTagImportCallback: (name) => `import ${name} from "dedent";\n`,
32+
}),
3033
],
3134
});

.pkgs/eff/docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
| Type Alias | Description |
66
| ---------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
77
| [NarrowedTo](type-aliases/NarrowedTo.md) | An extension of Extract for type predicates which falls back to the base in order to narrow the `unknown` case. |
8-
| [Pretty](type-aliases/Pretty.md) | - |
8+
| [Pretty](type-aliases/Pretty.md) | Converts a type to a pretty-printed version that is easier to read in IDE tooltips. |
99
| [unit](type-aliases/unit.md) | alias for `undefined`. |
1010

1111
## Variables

.pkgs/eff/docs/functions/flow.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ See also [`pipe`](#pipe).
8282
| Parameter | Type | Description |
8383
| --------- | -------------------- | ---------------------------- |
8484
| `ab` | (...`a`: `A`) => `B` | The first function to apply. |
85-
| `bc` | (`b`: `B`) => `C` | |
85+
| `bc` | (`b`: `B`) => `C` | - |
8686

8787
### Returns
8888

@@ -146,8 +146,8 @@ See also [`pipe`](#pipe).
146146
| Parameter | Type | Description |
147147
| --------- | -------------------- | ---------------------------- |
148148
| `ab` | (...`a`: `A`) => `B` | The first function to apply. |
149-
| `bc` | (`b`: `B`) => `C` | |
150-
| `cd` | (`c`: `C`) => `D` | |
149+
| `bc` | (`b`: `B`) => `C` | - |
150+
| `cd` | (`c`: `C`) => `D` | - |
151151

152152
### Returns
153153

@@ -213,9 +213,9 @@ See also [`pipe`](#pipe).
213213
| Parameter | Type | Description |
214214
| --------- | -------------------- | ---------------------------- |
215215
| `ab` | (...`a`: `A`) => `B` | The first function to apply. |
216-
| `bc` | (`b`: `B`) => `C` | |
217-
| `cd` | (`c`: `C`) => `D` | |
218-
| `de` | (`d`: `D`) => `E` | |
216+
| `bc` | (`b`: `B`) => `C` | - |
217+
| `cd` | (`c`: `C`) => `D` | - |
218+
| `de` | (`d`: `D`) => `E` | - |
219219

220220
### Returns
221221

@@ -283,10 +283,10 @@ See also [`pipe`](#pipe).
283283
| Parameter | Type | Description |
284284
| --------- | -------------------- | ---------------------------- |
285285
| `ab` | (...`a`: `A`) => `B` | The first function to apply. |
286-
| `bc` | (`b`: `B`) => `C` | |
287-
| `cd` | (`c`: `C`) => `D` | |
288-
| `de` | (`d`: `D`) => `E` | |
289-
| `ef` | (`e`: `E`) => `F` | |
286+
| `bc` | (`b`: `B`) => `C` | - |
287+
| `cd` | (`c`: `C`) => `D` | - |
288+
| `de` | (`d`: `D`) => `E` | - |
289+
| `ef` | (`e`: `E`) => `F` | - |
290290

291291
### Returns
292292

@@ -356,11 +356,11 @@ See also [`pipe`](#pipe).
356356
| Parameter | Type | Description |
357357
| --------- | -------------------- | ---------------------------- |
358358
| `ab` | (...`a`: `A`) => `B` | The first function to apply. |
359-
| `bc` | (`b`: `B`) => `C` | |
360-
| `cd` | (`c`: `C`) => `D` | |
361-
| `de` | (`d`: `D`) => `E` | |
362-
| `ef` | (`e`: `E`) => `F` | |
363-
| `fg` | (`f`: `F`) => `G` | |
359+
| `bc` | (`b`: `B`) => `C` | - |
360+
| `cd` | (`c`: `C`) => `D` | - |
361+
| `de` | (`d`: `D`) => `E` | - |
362+
| `ef` | (`e`: `E`) => `F` | - |
363+
| `fg` | (`f`: `F`) => `G` | - |
364364

365365
### Returns
366366

@@ -432,12 +432,12 @@ See also [`pipe`](#pipe).
432432
| Parameter | Type | Description |
433433
| --------- | -------------------- | ---------------------------- |
434434
| `ab` | (...`a`: `A`) => `B` | The first function to apply. |
435-
| `bc` | (`b`: `B`) => `C` | |
436-
| `cd` | (`c`: `C`) => `D` | |
437-
| `de` | (`d`: `D`) => `E` | |
438-
| `ef` | (`e`: `E`) => `F` | |
439-
| `fg` | (`f`: `F`) => `G` | |
440-
| `gh` | (`g`: `G`) => `H` | |
435+
| `bc` | (`b`: `B`) => `C` | - |
436+
| `cd` | (`c`: `C`) => `D` | - |
437+
| `de` | (`d`: `D`) => `E` | - |
438+
| `ef` | (`e`: `E`) => `F` | - |
439+
| `fg` | (`f`: `F`) => `G` | - |
440+
| `gh` | (`g`: `G`) => `H` | - |
441441

442442
### Returns
443443

@@ -511,13 +511,13 @@ See also [`pipe`](#pipe).
511511
| Parameter | Type | Description |
512512
| --------- | -------------------- | ---------------------------- |
513513
| `ab` | (...`a`: `A`) => `B` | The first function to apply. |
514-
| `bc` | (`b`: `B`) => `C` | |
515-
| `cd` | (`c`: `C`) => `D` | |
516-
| `de` | (`d`: `D`) => `E` | |
517-
| `ef` | (`e`: `E`) => `F` | |
518-
| `fg` | (`f`: `F`) => `G` | |
519-
| `gh` | (`g`: `G`) => `H` | |
520-
| `hi` | (`h`: `H`) => `I` | |
514+
| `bc` | (`b`: `B`) => `C` | - |
515+
| `cd` | (`c`: `C`) => `D` | - |
516+
| `de` | (`d`: `D`) => `E` | - |
517+
| `ef` | (`e`: `E`) => `F` | - |
518+
| `fg` | (`f`: `F`) => `G` | - |
519+
| `gh` | (`g`: `G`) => `H` | - |
520+
| `hi` | (`h`: `H`) => `I` | - |
521521

522522
### Returns
523523

@@ -593,14 +593,14 @@ See also [`pipe`](#pipe).
593593
| Parameter | Type | Description |
594594
| --------- | -------------------- | ---------------------------- |
595595
| `ab` | (...`a`: `A`) => `B` | The first function to apply. |
596-
| `bc` | (`b`: `B`) => `C` | |
597-
| `cd` | (`c`: `C`) => `D` | |
598-
| `de` | (`d`: `D`) => `E` | |
599-
| `ef` | (`e`: `E`) => `F` | |
600-
| `fg` | (`f`: `F`) => `G` | |
601-
| `gh` | (`g`: `G`) => `H` | |
602-
| `hi` | (`h`: `H`) => `I` | |
603-
| `ij` | (`i`: `I`) => `J` | |
596+
| `bc` | (`b`: `B`) => `C` | - |
597+
| `cd` | (`c`: `C`) => `D` | - |
598+
| `de` | (`d`: `D`) => `E` | - |
599+
| `ef` | (`e`: `E`) => `F` | - |
600+
| `fg` | (`f`: `F`) => `G` | - |
601+
| `gh` | (`g`: `G`) => `H` | - |
602+
| `hi` | (`h`: `H`) => `I` | - |
603+
| `ij` | (`i`: `I`) => `J` | - |
604604

605605
### Returns
606606

.pkgs/eff/docs/functions/isArray.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,8 @@ A function that checks if the passed parameter is an Array and narrows its type
2424

2525
`data is NarrowedTo<T, readonly unknown[]>`
2626

27-
True if the passed input is an Array, false otherwise. s
27+
True if the passed input is an Array, false otherwise.
28+
29+
## Since
30+
31+
1.0.0

.pkgs/eff/docs/functions/isObject.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ Checks if the given parameter is of type `"object"` via `typeof`, excluding `nul
2525
`data is NarrowedTo<T, object>`
2626

2727
The input type, narrowed to only objects.
28+
29+
## Since
30+
31+
1.0.0

.pkgs/eff/docs/functions/isTruthy.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ A function that checks if the passed parameter is truthy and narrows its type ac
2525
data is Exclude\<T, false \| "" \| 0 \| null \| undefined\>
2626

2727
True if the passed input is truthy, false otherwise.
28+
29+
## Since
30+
31+
1.0.0

.pkgs/eff/docs/type-aliases/NarrowedTo.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ in order to narrow the `unknown` case.
2121
```ts
2222
function isMyType<T>(data: T | MyType): data is NarrowedTo<T, MyType> { ... }
2323
```
24+
25+
## Since
26+
27+
1.0.0

.pkgs/eff/docs/type-aliases/Pretty.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@
66
type Pretty<T> = { [P in keyof T]: T[P] } & {};
77
```
88

9+
Converts a type to a pretty-printed version that is easier to read in IDE tooltips.
10+
911
## Type Parameters
1012

1113
| Type Parameter |
1214
| -------------- |
1315
| `T` |
16+
17+
## Since
18+
19+
1.0.0

0 commit comments

Comments
 (0)