generated from ony3000/node-library-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from ony3000/special-tagged-template
Excludes tagged templates starting with `css` from line wrapping
- Loading branch information
Showing
101 changed files
with
4,068 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
tests/v2-test/angular/issue-73/__snapshots__/absolute.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`'(1) Tagged templates are not supported by default.' > expectation 1`] = ` | ||
"<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = tw\`lorem ipsum dolor sit amet consectetur adipiscing elit proin ex massa hendrerit eu posuere eu volutpat id neque pellentesque\`; | ||
</script> | ||
" | ||
`; | ||
|
||
exports[`'(2) Tagged templates are supported by adding tag function names to the \`customFunctions\` option.' > expectation 1`] = ` | ||
"<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = tw\`lorem ipsum dolor sit amet consectetur | ||
adipiscing elit proin ex massa hendrerit eu posuere eu | ||
volutpat id neque pellentesque\`; | ||
</script> | ||
" | ||
`; | ||
|
||
exports[`'(3) If a tagged template is written as an argument for a function that supports line wrapping, it will appear to be supported even if the \`customFunctions\` option does not include the tagged function name, but in fact it is supported as a template literal.' > expectation 1`] = ` | ||
"<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = classNames( | ||
tw\`lorem ipsum dolor sit amet consectetur adipiscing | ||
elit proin ex massa hendrerit eu posuere eu volutpat id | ||
neque pellentesque\`, | ||
); | ||
</script> | ||
" | ||
`; | ||
|
||
exports[`'(4) If the tag function name is \`css\`, the tagged template is considered special and is not supported even if it is written as an argument for a function that supports line wrapping.' > expectation 1`] = ` | ||
"<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = classNames( | ||
css\`lorem ipsum dolor sit amet consectetur adipiscing elit proin ex massa hendrerit eu posuere eu volutpat id neque pellentesque\`, | ||
); | ||
</script> | ||
" | ||
`; | ||
|
||
exports[`'(5) If the tag function name is \`css\`, the tagged template is considered special and is not supported even if you add the tag function name to the \`customFunctions\` option.' > expectation 1`] = ` | ||
"<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = classNames( | ||
css\`lorem ipsum dolor sit amet consectetur adipiscing elit proin ex massa hendrerit eu posuere eu volutpat id neque pellentesque\`, | ||
); | ||
</script> | ||
" | ||
`; |
51 changes: 51 additions & 0 deletions
51
tests/v2-test/angular/issue-73/__snapshots__/ideal.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`'(1) Tagged templates are not supported by default.' > expectation 1`] = ` | ||
"<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = tw\`lorem ipsum dolor sit amet consectetur adipiscing elit proin ex massa hendrerit eu posuere eu volutpat id neque pellentesque\`; | ||
</script> | ||
" | ||
`; | ||
|
||
exports[`'(2) Tagged templates are supported by adding tag function names to the \`customFunctions\` option.' > expectation 1`] = ` | ||
"<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = tw\`lorem ipsum dolor sit amet consectetur | ||
adipiscing elit proin ex massa hendrerit eu posuere eu | ||
volutpat id neque pellentesque\`; | ||
</script> | ||
" | ||
`; | ||
|
||
exports[`'(3) If a tagged template is written as an argument for a function that supports line wrapping, it will appear to be supported even if the \`customFunctions\` option does not include the tagged function name, but in fact it is supported as a template literal.' > expectation 1`] = ` | ||
"<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = classNames( | ||
tw\`lorem ipsum dolor sit amet consectetur adipiscing | ||
elit proin ex massa hendrerit eu posuere eu volutpat id | ||
neque pellentesque\`, | ||
); | ||
</script> | ||
" | ||
`; | ||
|
||
exports[`'(4) If the tag function name is \`css\`, the tagged template is considered special and is not supported even if it is written as an argument for a function that supports line wrapping.' > expectation 1`] = ` | ||
"<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = classNames( | ||
css\`lorem ipsum dolor sit amet consectetur adipiscing elit proin ex massa hendrerit eu posuere eu volutpat id neque pellentesque\`, | ||
); | ||
</script> | ||
" | ||
`; | ||
|
||
exports[`'(5) If the tag function name is \`css\`, the tagged template is considered special and is not supported even if you add the tag function name to the \`customFunctions\` option.' > expectation 1`] = ` | ||
"<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = classNames( | ||
css\`lorem ipsum dolor sit amet consectetur adipiscing elit proin ex massa hendrerit eu posuere eu volutpat id neque pellentesque\`, | ||
); | ||
</script> | ||
" | ||
`; |
51 changes: 51 additions & 0 deletions
51
tests/v2-test/angular/issue-73/__snapshots__/relative.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`'(1) Tagged templates are not supported by default.' > expectation 1`] = ` | ||
"<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = tw\`lorem ipsum dolor sit amet consectetur adipiscing elit proin ex massa hendrerit eu posuere eu volutpat id neque pellentesque\`; | ||
</script> | ||
" | ||
`; | ||
|
||
exports[`'(2) Tagged templates are supported by adding tag function names to the \`customFunctions\` option.' > expectation 1`] = ` | ||
"<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = tw\`lorem ipsum dolor sit amet consectetur adipiscing elit proin | ||
ex massa hendrerit eu posuere eu volutpat id neque | ||
pellentesque\`; | ||
</script> | ||
" | ||
`; | ||
|
||
exports[`'(3) If a tagged template is written as an argument for a function that supports line wrapping, it will appear to be supported even if the \`customFunctions\` option does not include the tagged function name, but in fact it is supported as a template literal.' > expectation 1`] = ` | ||
"<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = classNames( | ||
tw\`lorem ipsum dolor sit amet consectetur adipiscing elit proin | ||
ex massa hendrerit eu posuere eu volutpat id neque | ||
pellentesque\`, | ||
); | ||
</script> | ||
" | ||
`; | ||
|
||
exports[`'(4) If the tag function name is \`css\`, the tagged template is considered special and is not supported even if it is written as an argument for a function that supports line wrapping.' > expectation 1`] = ` | ||
"<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = classNames( | ||
css\`lorem ipsum dolor sit amet consectetur adipiscing elit proin ex massa hendrerit eu posuere eu volutpat id neque pellentesque\`, | ||
); | ||
</script> | ||
" | ||
`; | ||
|
||
exports[`'(5) If the tag function name is \`css\`, the tagged template is considered special and is not supported even if you add the tag function name to the \`customFunctions\` option.' > expectation 1`] = ` | ||
"<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = classNames( | ||
css\`lorem ipsum dolor sit amet consectetur adipiscing elit proin ex massa hendrerit eu posuere eu volutpat id neque pellentesque\`, | ||
); | ||
</script> | ||
" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { baseOptions } from 'test-settings'; | ||
|
||
import { thisPlugin, testSnapshotEach } from '../../adaptor'; | ||
import { fixtures } from './fixtures'; | ||
|
||
const options = { | ||
...baseOptions, | ||
plugins: [thisPlugin], | ||
parser: 'angular', | ||
printWidth: 60, | ||
endingPosition: 'absolute', | ||
}; | ||
|
||
testSnapshotEach(fixtures, options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import type { Fixture } from 'test-settings'; | ||
|
||
export const fixtures: Omit<Fixture, 'output'>[] = [ | ||
{ | ||
name: '(1) Tagged templates are not supported by default.', | ||
input: ` | ||
<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = tw\`lorem ipsum dolor sit amet consectetur adipiscing elit proin ex massa hendrerit eu posuere eu volutpat id neque pellentesque\`; | ||
</script> | ||
`, | ||
}, | ||
{ | ||
name: '(2) Tagged templates are supported by adding tag function names to the `customFunctions` option.', | ||
input: ` | ||
<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = tw\`lorem ipsum dolor sit amet consectetur adipiscing elit proin ex massa hendrerit eu posuere eu volutpat id neque pellentesque\`; | ||
</script> | ||
`, | ||
options: { | ||
customFunctions: ['tw'], | ||
}, | ||
}, | ||
{ | ||
name: '(3) If a tagged template is written as an argument for a function that supports line wrapping, it will appear to be supported even if the `customFunctions` option does not include the tagged function name, but in fact it is supported as a template literal.', | ||
input: ` | ||
<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = classNames(tw\`lorem ipsum dolor sit amet consectetur adipiscing elit proin ex massa hendrerit eu posuere eu volutpat id neque pellentesque\`); | ||
</script> | ||
`, | ||
}, | ||
{ | ||
name: '(4) If the tag function name is `css`, the tagged template is considered special and is not supported even if it is written as an argument for a function that supports line wrapping.', | ||
input: ` | ||
<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = classNames(css\`lorem ipsum dolor sit amet consectetur adipiscing elit proin ex massa hendrerit eu posuere eu volutpat id neque pellentesque\`); | ||
</script> | ||
`, | ||
}, | ||
{ | ||
name: '(5) If the tag function name is `css`, the tagged template is considered special and is not supported even if you add the tag function name to the `customFunctions` option.', | ||
input: ` | ||
<!-- ------------------------------------------------------| printWidth=60 --> | ||
<script setup lang="ts"> | ||
const classes = classNames(css\`lorem ipsum dolor sit amet consectetur adipiscing elit proin ex massa hendrerit eu posuere eu volutpat id neque pellentesque\`); | ||
</script> | ||
`, | ||
options: { | ||
customFunctions: ['css'], | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { baseOptions } from 'test-settings'; | ||
|
||
import { thisPlugin, testSnapshotEach } from '../../adaptor'; | ||
import { fixtures } from './fixtures'; | ||
|
||
const options = { | ||
...baseOptions, | ||
plugins: [thisPlugin], | ||
parser: 'angular', | ||
printWidth: 60, | ||
endingPosition: 'absolute-with-indent', | ||
}; | ||
|
||
testSnapshotEach(fixtures, options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { baseOptions } from 'test-settings'; | ||
|
||
import { thisPlugin, testSnapshotEach } from '../../adaptor'; | ||
import { fixtures } from './fixtures'; | ||
|
||
const options = { | ||
...baseOptions, | ||
plugins: [thisPlugin], | ||
parser: 'angular', | ||
printWidth: 60, | ||
endingPosition: 'relative', | ||
}; | ||
|
||
testSnapshotEach(fixtures, options); |
Oops, something went wrong.