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
Changed parser mode to 'codemod' #850
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
I am concerned that this is effectively a breaking change for rules like no-bare-strings
(because the whitelist/blacklist there are specifically relying on the fact that the tokens have been swapped). I still think we should do this change, just need to think through how it may be considered a breaking bugfix.
@@ -123,6 +123,7 @@ class Linter { | |||
|
|||
try { | |||
precompile(stripBom(options.source), { | |||
mode: 'codemod', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍I absolutely had this package in mind when adding this feature upstream.
Yes, If people had a "&" in their white list and "&" in their template, then it would break for them after this change. But any rule change or fix, may break someones flow. |
Right, I think the main thing we need to ensure is that the items in the current default whitelist that could have been converted from an HTML entity have a corresponding whitelist entry for the entity as well. |
@initram - Would you mind rebasing? There have been changes to |
This allows the linter to lint indentation correctly even if the line starts with
…e strings I only added the named versions of the HTML entities, and not the numbered ones as they are rarely used.
I went ahead and rebased for you, looks like no additional failures crop up so this is good to land! |
Thank you again @initram! |
This allows the linter to lint indentation correctly even if the line starts with
Fixes #120
Though some changes were needed to rules that work on TextNodes as they now behave slightly different. The changes I made to the block indentation rule also made it a bit more consistent in my opinion.
Additional test may be needed to cover what ever corners cases there may be, but all current tests should pass.