Skip to content

Commit

Permalink
Closes #15
Browse files Browse the repository at this point in the history
  • Loading branch information
aMarCruz committed Jan 18, 2019
1 parent e7e9ea9 commit 66d93be
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 38 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# rollup-plugin-cleanup changes

## \[3.1.1] - 2019-01-18

### Changed

- Update dependencies.

### Fixed

- #15 : Version 3.1.0 fails for certain template literals. Thanks to @stotter for repoting this issue.

## \[3.1.0] - 2018-12-27

Bye, acorn.
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ const cleanedCode = jsCleanup(code, null, { comments: ['eslint', /^\*-/] })

## What's New

Changes in v3.1.1

- Fixed #15: Version 3.1.0 fails for certain template literals. Thanks to @stotter for repoting this issue.

Changes in v3.1.0

Bye, acorn.
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rollup-plugin-cleanup",
"version": "3.1.0",
"version": "3.1.1",
"description": "Rollup plugin to trim trailing spaces, compact empty lines, and normalize line endings",
"main": "dist/rollup-plugin-cleanup.js",
"module": "dist/rollup-plugin-cleanup.es.js",
Expand Down Expand Up @@ -47,11 +47,11 @@
},
"homepage": "https://github.com/aMarCruz/rollup-plugin-cleanup",
"dependencies": {
"js-cleanup": "^1.0.0",
"rollup-pluginutils": "^2.3.0"
"js-cleanup": "^1.0.1",
"rollup-pluginutils": "^2.3.3"
},
"devDependencies": {
"eslint": "^5.11.0",
"eslint": "^5.12.0",
"expect": "1.20.2",
"mocha": "^5.2.0",
"nyc": "^13.1.0",
Expand Down
22 changes: 22 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,28 @@ describe('Issues', function () {
return testFile('issue_11')
})

it('#15 must handle "$" ending the string', function () {
const opts = {
sourceMap: false,
}
/* eslint-disable no-template-curly-in-string */
const result = [
'const s = `${v}$`',
'const s = `$${v}$`',
'const s = `${v}$$`',
'const s = `\\$`',
'const s = `$0`',
'const s = `$$`',
'const s = `$`',
].map(function (str) {
return cleanup(opts).transform(str, 'a.js').then((res) => {
expect(res.code).toBe(str)
})
})
/* eslint-enable no-template-curly-in-string */
return Promise.all(result)
})

})


Expand Down
63 changes: 29 additions & 34 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -274,17 +274,10 @@ caching-transform@^2.0.0:
package-hash "^2.0.0"
write-file-atomic "^2.0.0"

caller-path@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f"
integrity sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=
dependencies:
callsites "^0.2.0"

callsites@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca"
integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=
callsites@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.0.0.tgz#fb7eb569b72ad7a45812f93fd9430a3e410b3dd3"
integrity sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw==

camelcase@^4.1.0:
version "4.1.0"
Expand Down Expand Up @@ -558,10 +551,10 @@ eslint-visitor-keys@^1.0.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==

eslint@^5.11.0:
version "5.11.1"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.11.1.tgz#8deda83db9f354bf9d3f53f9677af7e0e13eadda"
integrity sha512-gOKhM8JwlFOc2acbOrkYR05NW8M6DCMSvfcJiBB5NDxRE1gv8kbvxKaC9u69e6ZGEMWXcswA/7eKR229cEIpvg==
eslint@^5.12.0:
version "5.12.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.12.0.tgz#fab3b908f60c52671fb14e996a450b96c743c859"
integrity sha512-LntwyPxtOHrsJdcSwyQKVtHofPHdv+4+mFwEe91r2V13vqpM8yLr7b1sW+Oo/yheOPkWYsYlYJCkzlFAt8KV7g==
dependencies:
"@babel/code-frame" "^7.0.0"
ajv "^6.5.3"
Expand All @@ -580,6 +573,7 @@ eslint@^5.11.0:
glob "^7.1.2"
globals "^11.7.0"
ignore "^4.0.6"
import-fresh "^3.0.0"
imurmurhash "^0.1.4"
inquirer "^6.1.0"
js-yaml "^3.12.0"
Expand All @@ -594,7 +588,6 @@ eslint@^5.11.0:
pluralize "^7.0.0"
progress "^2.0.0"
regexpp "^2.0.1"
require-uncached "^1.0.3"
semver "^5.5.1"
strip-ansi "^4.0.0"
strip-json-comments "^2.0.1"
Expand Down Expand Up @@ -959,6 +952,14 @@ ignore@^4.0.6:
resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc"
integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==

import-fresh@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390"
integrity sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==
dependencies:
parent-module "^1.0.0"
resolve-from "^4.0.0"

imurmurhash@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
Expand Down Expand Up @@ -1228,10 +1229,10 @@ istanbul-reports@^2.0.1:
dependencies:
handlebars "^4.0.11"

js-cleanup@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/js-cleanup/-/js-cleanup-1.0.0.tgz#a3aad18a23a1752e9fa005f9128e65d601d2d634"
integrity sha512-gT33849UQki2Ek5NJM9eCH1ZEMjzMfyE881kmfv51hxO4K+TgH+qBIt9RZjczrV02wFqNDSVCk8pE9p78I3cIw==
js-cleanup@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/js-cleanup/-/js-cleanup-1.0.1.tgz#1d38080c7ee92e1d2d2b94054d0a33c48951e0df"
integrity sha512-wyHeWKqbcQV78/tiMJ6pgJrkG7p2u3b2xX9IJFvvurpJL9/++89dHfkUebhWvSMS84LG0uQ7BnG5GGyAzY21Ag==
dependencies:
magic-string "^0.25.1"
perf-regexes "^1.0.1"
Expand Down Expand Up @@ -1938,6 +1939,13 @@ package-hash@^2.0.0:
md5-hex "^2.0.0"
release-zalgo "^1.0.0"

parent-module@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.0.tgz#df250bdc5391f4a085fb589dad761f5ad6b865b5"
integrity sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA==
dependencies:
callsites "^3.0.0"

parse-glob@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c"
Expand Down Expand Up @@ -2174,19 +2182,6 @@ require-main-filename@^1.0.1:
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1"
integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=

require-uncached@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3"
integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=
dependencies:
caller-path "^0.1.0"
resolve-from "^1.0.0"

resolve-from@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226"
integrity sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=

resolve-from@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
Expand Down Expand Up @@ -2232,7 +2227,7 @@ rollup-pluginutils@^1.3.1:
estree-walker "^0.2.1"
minimatch "^3.0.2"

rollup-pluginutils@^2.3.0, rollup-pluginutils@^2.3.3:
rollup-pluginutils@^2.3.3:
version "2.3.3"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz#3aad9b1eb3e7fe8262820818840bf091e5ae6794"
integrity sha512-2XZwja7b6P5q4RZ5FhyX1+f46xi1Z3qBKigLRZ6VTZjwbN0K1IFGMlwm06Uu0Emcre2Z63l77nq/pzn+KxIEoA==
Expand Down

0 comments on commit 66d93be

Please sign in to comment.