Skip to content

Commit b047e02

Browse files
Improve detection of string concatenation (#288)
* Improve `visit()` types * Check for ancestor concat expressions * Rename global usage of `createRequire` * Update changelog * Update src/index.ts Co-authored-by: Robin Malfait <[email protected]> * Update src/index.ts Co-authored-by: Robin Malfait <[email protected]> * Update src/index.ts Co-authored-by: Robin Malfait <[email protected]> --------- Co-authored-by: Robin Malfait <[email protected]>
1 parent 6ded534 commit b047e02

File tree

5 files changed

+219
-144
lines changed

5 files changed

+219
-144
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
- Only remove duplicate Tailwind classes ([#277](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/pull/277))
1717
- Make sure escapes in classes are preserved in string literals ([#286](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/pull/286))
18+
- Improve detection of string concatenation ([#288](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/pull/288))
1819

1920
## [0.6.1] - 2024-05-31
2021

build.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ function patchCjsInterop() {
4444

4545
// Prepend `createRequire`
4646
let code = [
47-
`import {createRequire} from 'module'`,
47+
`import {createRequire as __global__createRequire__} from 'module'`,
4848
`import {dirname as __global__dirname__} from 'path'`,
4949
`import {fileURLToPath} from 'url'`,
5050

5151
// CJS interop fixes
52-
`const require=createRequire(import.meta.url)`,
52+
`const require=__global__createRequire__(import.meta.url)`,
5353
`const __filename=fileURLToPath(import.meta.url)`,
5454
`const __dirname=__global__dirname__(__filename)`,
5555
]

0 commit comments

Comments
 (0)