Eslint-plugin-vue: Providing rule options for Vue CLI's UI

Created on 21 May 2018  路  3Comments  路  Source: vuejs/eslint-plugin-vue

Talking with @Akryum, we thought it would be nice for the UI to represent configuration options for each rule could be automatically generated. Experimenting this weekend, I couldn't find a way to automatically generate the correct UI with the current code, but I believe I found a potential way.

Currently, in the "Options" section of some rule docs, we keep each option in an h3, with the exact code wrapped with <code></code>, followed by a description of the option. Then below the h3, we have examples of correct and incorrect code. If we standardized this, I think it shouldn't be too hard to build a little utility that transforms this into an object usable by 3rd parties like Vue CLI.

@michalsnik @mysticatea What do you think? Could this be a good way to solve the problem?

Ongoing discussion

Most helpful comment

It seems doable. I'll try to setup vue-cli locally and see how much work would be required to accomplish it.

All 3 comments

Thank you for the issue.

Standardize document format is a good idea. It's useful for users.

For tools, maybe tools can use schema of each rule.

const { rules } = require("eslint-plugin-vue")

for (const [ruleId, rule] of Object.entries(rules)) {
    console.log(ruleId, rule.meta.schema)
}

It represents option's shapes as JSONSchema.

It seems doable. I'll try to setup vue-cli locally and see how much work would be required to accomplish it.

Awesome! 馃樆

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Hyzual picture Hyzual  路  3Comments

soullivaneuh picture soullivaneuh  路  3Comments

Mouvedia picture Mouvedia  路  3Comments

gluons picture gluons  路  4Comments

KristofMorva picture KristofMorva  路  4Comments