-
-
Notifications
You must be signed in to change notification settings - Fork 4
Migrate script-setup-uses-vars
#158
Migrate script-setup-uses-vars
#158
Conversation
I encountered a few issues which I'd like feedback on before I start to change code:
|
Let me try to explain: eslint-plugin-vue-pug-sfc/src/rules/valid-v-else-if.ts Lines 30 to 32 in e6f6616
Just one random rule, I took some variables and when I encounter it, I safe it. |
Oh and I head a look into my other open PRs if there is anything that is not directly related to a specific rule and can be used: found this: https://github.com/Shinigami92/eslint-plugin-vue-pug-sfc/pull/142/files#diff-bc03228a6e8ed14e4914c94dabefdcc8b119036acc8f6ada2f4d5fc59c751589 So if you need that, just copy it over 🙂 |
Pug has quite a few feature like nested tags or tag interpolation which make tracking parents and their attributes a bit more difficult. I can see having a stack of parents with variables working, but getting all logic involved in parsing pug tokens right seems a lot more difficult than relying on a library from the pug team. Since you've built the pug plugin for prettier, perhaps you already have a solution in mind for handling stuff like nested tags and tag interpolation? |
The plugin does exactly what I described above :) writing the code from left to write from top to bottom I know it's a bit more difficult, but I think it's archivable.
I must say that I'm very disappointed right now from the "pug-team", because there is no active development involved around pug core at all 🙁 So as an additional reason: the less dependencies relying on pug-ecosystem itself, the less audit issues can be involved in the future... But still: I'm not saying I would deny anything, just want to give my opinions around that. |
I believe you and I agree that we don't necessarily need an AST, I'm just asking if you already have code somewhere for tracking "open tags" or if I need to write that myself (including tracking
Ah, that sucks, I didn't know that.
I'll try it with just the lexer first. |
👍 , but no I don't have such code |
I am reading through vue-eslint-parser to see what is needed to parse js expressions and that's a lot of things we would need to adapt/rebuild (and a lot of testing surface). I would not say it's impossible, but if we can avoid this, we probably save ourselves a lot of pain. I started a PR at vue-eslint-parser to perhaps make custom template tokenizers configurable, so they don't need to add pug support directly inside vue-eslint-parser. We could then use that interface to add a pug tokenizer and get all that attribute and expression processing for "free". |
solved in #162 |
Reference #8
Continuing from #155
Mark as used:
ref
values