Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

Now using template strings #410

Merged
merged 6 commits into from
Oct 17, 2016
Merged

Now using template strings #410

merged 6 commits into from
Oct 17, 2016

Conversation

stevenjob
Copy link
Contributor

The problem with this PR is that using multiline template literals causes indentation to show in the new multiline string where it did not previously with the array join. (an extra 6 spaces is now before most lines)

I have used template literals in all places and the tests all still pass.

Moved backtick to fix test 'getter/setter babel#218' as indent matters
Fixed line numbers for some tests
Avoids error that shows when using template strings for tests:
	line 253 line comments
	line 260 block comments
	line 306 jsdoc

Error: At loc.start.column: are different (6 !== 0)
@hzoo
Copy link
Member

hzoo commented Oct 11, 2016

Awesome

@stevenjob
Copy link
Contributor Author

Ok will do this, thanks

@stevenjob
Copy link
Contributor Author

stevenjob commented Oct 11, 2016

Unpad could probably be its own module but i have just copied it to a utils folder for now.

I have used unpad in each test separately as it was simple to add with regex and i did not want to modify parseAndAssertSame or verifyAndAssertMessages. I assumed there could be use cases where you would want leading spaces in some test code.

@hzoo hzoo mentioned this pull request Oct 11, 2016
@hzoo
Copy link
Member

hzoo commented Oct 17, 2016

Yeah looks like there is a module for it that was from babili/babel originally https://www.npmjs.com/package/unpad but this is fine

Thanks! 🎉

@hzoo hzoo merged commit 88e39ad into babel:master Oct 17, 2016
@stevenjob stevenjob deleted the template-strings branch October 17, 2016 19:21
nicolo-ribaudo pushed a commit to babel/babel that referenced this pull request Nov 14, 2019
* Use template strings in non-regression tests

* Refactor non-regression tests to fix test failures

Moved backtick to fix test 'getter/setter babel/babel-eslint#218' as indent matters
Fixed line numbers for some tests

* Use template strings in babel-eslint tests

* Fix tests for babel-eslint

Avoids error that shows when using template strings for tests:
	line 253 line comments
	line 260 block comments
	line 306 jsdoc

Error: At loc.start.column: are different (6 !== 0)

* Other small template literal changes

* Add unpad to correctly indent template literals
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants