-
-
Notifications
You must be signed in to change notification settings - Fork 24
Proposal: parse <style>
contents using PostCSS
#317
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
Comments
<style>
contents using PostCSS <style>
contents using PostCSS
I think it difficult to convert a I don't think we need an ESLint compatible AST to implement the rule in sveltejs/eslint-plugin-svelte#402. |
Hi, I totally could do all of this in sveltejs/eslint-plugin-svelte#402, however, I have the feeling this won't be the last rule that needs to inspect the So what I am proposing is to essentially move the parsing part into svelte-eslint-parser - yes, the result would be a PostCSS AST kind of "hanging" from an ESLint AST node, which is not the best, but I think it is better than duplicating the parsing in every rule that needs to read/manipulate |
Hmm. If it doesn't produce an ESLint-compatible AST, I think that producing such an AST with this parser will only confuse plugin authors. |
Yeah, I get that, that's not good... Do you think naming the property something like
I agree that it's currently not a problem, I'd like to prevent it from becoming one :D I think in general, styles are an integral part of svelte code and rules aimed at svelte will want to look at them, sooner or later (I already have another rule proposal in mind that'd need this :D). I think it would be better to have one common way of dealing with them, rather then each plugin/rule designing their own... If you disagree with this basic assumption behind my wanting to include this as part of the AST, then I think we won't agree - and of course, you have the final word as the maintainer, I just hope to persuade you with my arguments :) Looking at the ESLint AST, is that really that complicated? Looking at the docs, do I understand it correctly that this would boil down to the Thanks for the link, seems very interesting, but also far away :D |
Oh, sorry, looking at the ESTree docs, it would mean |
Actually, I already managed to convert the PostCSS AST to be ESLint AST as well :D |
Closed by #340 |
Description
Hi,
as suggested in sveltejs/eslint-plugin-svelte#402, I'd like to add support for rules around styles to eslint-plugin-svelte. However, since I am going to be implementing style parsing to do that, I thought maybe it would be better to provide it as part of
svelte-eslint-parser
?I am not sure if there's any way of making this compatible with ESTree, but I'm not sure that is actually necessary or even a good idea. I just think that having an AST for styles may make it easier to create
eslint-plugin-svelte
rules that work with styles.The text was updated successfully, but these errors were encountered: