-
-
Notifications
You must be signed in to change notification settings - Fork 681
Add rule max-attributes-per-line
(resolves #47)
#60
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a7d9313
Inits new rule.
7ef1ca5
Improves rule definition
6a62bdd
Update docs to match review
1d34713
Adds rule to check for number of attributes per line
c78b20d
Updates per code review:
56f5f70
Updates single line max attributes error as per code review
ca31f09
Changes schema to allow a different config
ed73ad8
Moves function into utils
df1207b
Merge branch 'master' into 47-props-per-line
filipalacerda 39d0743
Fix eslint error
796611e
Improves code coverage
982d9f2
Update docs as per code review
2f0492d
Merge branch 'master' into 47-props-per-line
5539686
Merge branch 'master' into 47-props-per-line
armano2 dcb3ee3
reports the violated attributes instead of elements
armano2 dc64c62
Merge pull request #1 from armano2/47-props-per-line
filipalacerda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,7 @@ ruleTester.run('max-attributes-per-line', rule, { | |
invalid: [ | ||
{ | ||
code: `<template><component name="John Doe" age="30" job="Vet" petname="Snoopy"></component></template>`, | ||
errors: ['It has more than 3 attributes per line.'] | ||
errors: ['There are 4 in this line, but the maximum is 3.'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤦♀️ |
||
}, | ||
{ | ||
code: `<template><component job="Vet" | ||
|
@@ -84,7 +84,7 @@ ruleTester.run('max-attributes-per-line', rule, { | |
{ | ||
code: `<template><component name="John Doe" age="30" job="Vet"></component></template>`, | ||
options: [{ singleline: 1, multiline: { max: 1, allowFirstLine: false }}], | ||
errors: ['It has more than 1 attributes per line.'] | ||
errors: ['There are 3 in this line, but the maximum is 1.'] | ||
}, | ||
{ | ||
code: `<template><component name="John Doe" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think better if this rule reports the violated attributes instead of elements which have the violated attributes.
This is consistent with the core rules which have similar functionally.