Allow ES6 template literals for new code? #10066
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a little experiment related to #9718. I just enabled template literals in the
eslint
config so we can use them inModelExperimental
.In this
ModelExperimental
/3D Tiles Next effort, we generate a lot of shader code. Template literals make this a lot more concise and readable compared to concatenating strings with+
This also allows us to replace the idiom for custom shader shader lines:
With the simpler multi-line template literal:
(technically speaking, this may add more whitespace on each line, but for user-defined GLSL shaders that doesn't matter much)
The point here is it's very easy to relax the eslint rules for new changes without having to convert all the old code at once.