Skip to content

Separate max-len eslint rule for Vue template tag #2367

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

Closed
guirreri opened this issue Aug 27, 2018 · 4 comments
Closed

Separate max-len eslint rule for Vue template tag #2367

guirreri opened this issue Aug 27, 2018 · 4 comments

Comments

@guirreri
Copy link

What problem does this feature solve?

When using ESLint's max-len rule, it is applied to all of a vue single-file component. It would be better to provide separate max-len for an SFCs template tag vs the script.

It is very common to use the default max-len of 80 characters in a javascript file, but markup typically will have much longer lines.

At the moment, the default Vue CLI template fails max-len on HelloWorld.vue. This would fix that if the default for the vue rule was set to something higher.

What does the proposed API look like?

Add a rule called vue/max-len-template reusing the same settings for ESLint's normal max-len:
https://eslint.org/docs/rules/max-len

In .eslintrc.config:

module.exports = {
  'rules': {
    '@vue/max-len-template': ["error", { "code": 200 }],
    'max-len': 80
  }
}
@nino-vrijman
Copy link

nino-vrijman commented Mar 29, 2019

A proposal for a 'vue/max-len' rule has been accepted in eslint-plugin-vue

@syntag
Copy link

syntag commented Apr 13, 2019

@nino-vrijman That's great news! Any estimate on how long the process might take to fully integrate the new rule? Thanks!

@nino-vrijman
Copy link

@nino-vrijman That's great news! Any estimate on how long the process might take to fully integrate the new rule? Thanks!

I'm not sure since I don't contribute to eslint-plugin-vue, I would subscribe to the issue I linked to in my previous message so you will be notified as soon as more is known.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants