Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add template block comment eslint directives #1971

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

patricklx
Copy link
Contributor

No description provided.

@patricklx patricklx changed the title add block comment eslint directives add fcct block comment eslint directives Nov 2, 2023
@patricklx patricklx changed the title add fcct block comment eslint directives add template block comment eslint directives Nov 2, 2023
const idx = parentBody.indexOf(comment);
parentBody.splice(idx, 1);
// comment type can be a block comment or a line comment
// block comments start with <!--- or {{!--, line comments with <!-- or {{!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{{!}} Are also block comments

Copy link
Contributor Author

@patricklx patricklx Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how so? {{! only comments out 1 line. edit: ah it can also do multine, right. anyway, just need 2 different syntaxes
i just need to distinguish it because eslint handles those differently.
html comments has issues... glimmerjs/glimmer-vm#1487

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

html comments has issues

Yeah, i saw that. Mourd be good to fix.
I'm almost done with getting the upgrade in ember figured out

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw,

<!--- 
    multi line
  --->

did not make it into the output

parentBody.splice(idx, 1);
// comment type can be a block comment or a line comment
// block comments start with <!--- or {{!--, line comments with <!-- or {{!
comment.type = /^({{!--|<!---)/.test(code.slice(...comment.range)) ? 'Block' : 'Line';
Copy link
Contributor

@NullVoxPopuli NullVoxPopuli Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
comment.type = /^({{!--|<!---)/.test(code.slice(...comment.range)) ? 'Block' : 'Line';
comment.type = /^({{!|<!--)/.test(code.slice(...comment.range)) ? 'Block' : 'Line';

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i found out that block comment works for eslint in all cases

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay!

@NullVoxPopuli NullVoxPopuli merged commit 8543535 into ember-cli:master Nov 2, 2023
8 checks passed
@patricklx patricklx deleted the add-block-comment branch November 2, 2023 15:16
@bmish bmish changed the title add template block comment eslint directives Add template block comment eslint directives Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants