Skip to content

Commit

Permalink
Improve detection of string concatenation (#288)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
thecrypticace and RobinMalfait committed Jun 11, 2024
1 parent 6ded534 commit b047e02
Show file tree
Hide file tree
Showing 5 changed files with 219 additions and 144 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

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

## [0.6.1] - 2024-05-31

Expand Down
4 changes: 2 additions & 2 deletions build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ function patchCjsInterop() {

// Prepend `createRequire`
let code = [
`import {createRequire} from 'module'`,
`import {createRequire as __global__createRequire__} from 'module'`,
`import {dirname as __global__dirname__} from 'path'`,
`import {fileURLToPath} from 'url'`,

// CJS interop fixes
`const require=createRequire(import.meta.url)`,
`const require=__global__createRequire__(import.meta.url)`,
`const __filename=fileURLToPath(import.meta.url)`,
`const __dirname=__global__dirname__(__filename)`,
]
Expand Down
Loading

0 comments on commit b047e02

Please sign in to comment.