Hey, I see that currently there are two repositories:
Not everyone knows, but you can actually keep everything in one repository which makes maintaining far easier and releasing new versions less troubleprone (Example configs in eslint-plugin-ember repo).
I also recommend creating two configs:
This way we can keep all necessary settings in base config, and recommended settings for eslint-plugin-vue in the second file, which will basically extend base config with recommended settings for each new rule.
This will make the configuration even easier:
module.exports = {
extends: [
'eslint:recommended',
'plugin:vue/recommended'
],
rules: {
// override rules' settings here
}
}
I'm willing to work on this one if you agree with me.
I'm not opposed to combining these, though the rules currently in eslint-config-vue are actually focused on maintaining consistency across official Vue projects and so many of them extend beyond Vue-specific code. The ones that are not specific to Vue applications should probably only be in a plugin:vue/official or similar group.
I'm starting to think we should separate the use cases a bit more explicitly - it seems many users are thinking they should use eslint-plugin/config-vue in their applications, whereas they were actually created for Vue's own library code.
Here's I think what we should do:
Create a separate plugin eslint-plugin-vue-libs, used by official Vue libraries, replacing the current eslint-config-vue + eslint-plugin-vue combination.
Rework eslint-plugin-vue to be the new user-facing plugin that should be used in Vue applications. The plugin would only contain Vue-specific rules, and can be layered about a base JS config of choice (e.g. eslint/recommended, standard, or airbnb).
Also,there's a ton of work being done in https://github.com/mysticatea/eslint-plugin-vue-trial e.g. infrastructure code for traversing and checking the template AST - I'd really like @mysticatea to collaborate with us on the official plugin :)
Ah, I wasn't aware of that @yyx990803. This sounds like a decent plan to me.
That being said I think you should rename this repository to eslint-plugin-vue-internal or -libs like you mentioned already, publish under new name and then if @mysticatea is up to this we could move his plugin under eslint-plugin-vue name, iterate few times to provide product of even better quality (no trial anymore) and republish as [email protected]. Looks like he's plugin is indeed better starting point for the future work. What do you think guys about this approach?
Hello.
Thank you. I'd like to collaborate with Vue.js team on the official plugin, too.
[eslint-plugin-vue-trial] was experimentation to check whether [vue-eslint-parser] works as intended or not. As a result, most parts worked good, but I found some problems. [parse5], the HTML parser that [vue-eslint-parser] is using, discards helpful information (e.g. duplicate attributes, invalid tokens, illegal end tags, ...) on the tokenization phase. I'm working now to solve those problems.
My plan was that I send [vue-eslint-parser] and rules to the official plugin after I fixed those problems. But I realized that it needs more time, so I'm leaning towards sending the current version for starting point.
Sounds great @mysticatea and I believe that with the help of vue community we can make it work as intended together. For the time being we could merge new changes to separate branch e.g. dev and then merge it all at once to master when ready. What do you think @chrisvfritz @yyx990803 ? That should give you enough time to move current plugin to new repository.
Ok, so I have:
Created eslint-plugin-vue-libs and moved all internal projects to use that instead.
Invited @mysticatea as a collaborator on this repo so that he can start moving his work under a dev branch here.
Deprecated eslint-config-vue since configs will be part of this plugin. Further work should also be done in this repo.
Also @michalsnik if you are interested, I can add you as a collaborator too :)
Great news!
Sure @yyx990803, I'm more than willing to help :)
I just came across those issues you mentioned about parse5 @mysticatea. Seems like a real problem, are you thinking about forking this parser, using different one or maybe something else?
Is there an official vuejs slack team where we could have a quick chat or only gitter? @yyx990803
I think I can close this issue as my proposition is done in new repository. Thanks for the quick action @yyx990803
Hi, guys, how to config with 'standard' style ?
Hi @WalterZou, the same as with recommended but you need to set all rules' by yourself, eg:
module.exports = {
extends: [
'eslint:recommended',
'plugin:vue/base'
],
rules: {
'vue/some-rule-name: 'error,
// and so on
}
}
You can find all rules in Readme.
Most helpful comment
I'm starting to think we should separate the use cases a bit more explicitly - it seems many users are thinking they should use
eslint-plugin/config-vuein their applications, whereas they were actually created for Vue's own library code.Here's I think what we should do:
Create a separate plugin
eslint-plugin-vue-libs, used by official Vue libraries, replacing the currenteslint-config-vue+eslint-plugin-vuecombination.Rework
eslint-plugin-vueto be the new user-facing plugin that should be used in Vue applications. The plugin would only contain Vue-specific rules, and can be layered about a base JS config of choice (e.g. eslint/recommended, standard, or airbnb).Also,there's a ton of work being done in https://github.com/mysticatea/eslint-plugin-vue-trial e.g. infrastructure code for traversing and checking the template AST - I'd really like @mysticatea to collaborate with us on the official plugin :)