-
-
Notifications
You must be signed in to change notification settings - Fork 681
no-duplicate-attributes should have css exceptions #112
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
@nchutchind nice catch This is ok:
This is not ok:
I think we should add setting to allow this. |
My proposal for schema is: [
{
type: 'object',
properties: {
allowCoexistClass: {
type: 'boolean' // default: true
},
allowCoexistStyle: {
type: 'boolean' // default: true
}
},
additionalProperties: false
}
] https://vuejs.org/v2/guide/class-and-style.html#Object-Syntax |
I'm sorry for being a few days late here, but the only complaint I would have about your proposal is that coexist is one word, so the properties should be allowCoexistClass and allowCoexistStyle. Otherwise, it looks great! (apologies for pedantry) |
@nchutchind thanks, PR updated 🗡️ |
I wonder if we actually need those extra settings.. In my opinion allowing coexistance of bindings and attributes for |
Thank you for the report! I had not noticed that |
@mysticatea by default i will allow |
* master: Add rule `vue/require-valid-default-prop`. (vuejs#119) 3.10.0 Update readme to 3.10.0 Chore: remove package-lock.json (vuejs#128) Fix: parserService must exist always (fixes vuejs#125) (vuejs#127) Add rule `require-render-return`. (vuejs#114) 3.9.0 Update package-lock Update: options for `no-duplicate-attributes` (fixes vuejs#112)(vuejs#113) New: add rule `attribute-hyphenation`. (fixes vuejs#92)(vuejs#95) Add namespace check of svg & mathML instead of tag names (vuejs#120)⚠️ Add support for deprecated state in update-rules⚠️ (vuejs#121) Add rules: `no-dupe-keys` and `no-reserved-keys`. (vuejs#88) Chore: Improve tests for name-property-casing & improve documentation (vuejs#115) New: add `require-prop-types` rule (fixes vuejs#19)(vuejs#85) Update: upgrade vue-eslint-parser (fixes vuejs#36, fixes vuejs#56, fixes vuejs#96) (vuejs#116)
It's working, Thanks. :) |
Duplicate attribute 'class'. (vue/no-duplicate-attributes)
Duplicate attribute 'style'. (vue/no-duplicate-attributes)
Class and Style, specifically, should be allowed to be duplicated since they tend to have a mix of static and dynamic content. You often have structural styling that gets set in stone at development time, but want reactive styles or classes applied at runtime.
Perhaps no-duplicate-attributes should take an option for ignoring css attributes (class and style).
The text was updated successfully, but these errors were encountered: