-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add --fix-type support #3165
base: master
Are you sure you want to change the base?
Add --fix-type support #3165
Changes from 6 commits
7e23376
c4cd854
8e8389d
3de1c8d
381ba11
3e7ebd5
29cd55e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,13 +36,14 @@ const messages = { | |
|
||
module.exports = { | ||
meta: { | ||
type: 'layout', | ||
docs: { | ||
description: 'Enforce or disallow spaces inside of curly braces in JSX attributes', | ||
category: 'Stylistic Issues', | ||
recommended: false, | ||
url: docsUrl('jsx-curly-spacing'), | ||
}, | ||
fixable: 'code', | ||
fixable: 'whitespace', | ||
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. same here? |
||
|
||
messages, | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,13 +21,14 @@ const messages = { | |
|
||
module.exports = { | ||
meta: { | ||
type: 'layout', | ||
docs: { | ||
description: 'Disallow or enforce spaces around equal signs in JSX attributes', | ||
category: 'Stylistic Issues', | ||
recommended: false, | ||
url: docsUrl('jsx-equals-spacing'), | ||
}, | ||
fixable: 'code', | ||
fixable: 'whitespace', | ||
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. and here? |
||
|
||
messages, | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,13 +19,14 @@ const messages = { | |
|
||
module.exports = { | ||
meta: { | ||
type: 'layout', | ||
docs: { | ||
description: 'Ensure proper position of the first property in JSX', | ||
category: 'Stylistic Issues', | ||
recommended: false, | ||
url: docsUrl('jsx-first-prop-new-line'), | ||
}, | ||
fixable: 'code', | ||
fixable: 'whitespace', | ||
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. and here |
||
|
||
messages, | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,13 +44,14 @@ const messages = { | |
|
||
module.exports = { | ||
meta: { | ||
type: 'layout', | ||
docs: { | ||
description: 'Validate props indentation in JSX', | ||
category: 'Stylistic Issues', | ||
recommended: false, | ||
url: docsUrl('jsx-indent-props'), | ||
}, | ||
fixable: 'code', | ||
fixable: 'whitespace', | ||
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. and here |
||
|
||
messages, | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,13 +25,14 @@ const messages = { | |
|
||
module.exports = { | ||
meta: { | ||
type: 'layout', | ||
docs: { | ||
description: 'Limit maximum of props on a single line in JSX', | ||
category: 'Stylistic Issues', | ||
recommended: false, | ||
url: docsUrl('jsx-max-props-per-line'), | ||
}, | ||
fixable: 'code', | ||
fixable: 'whitespace', | ||
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. and here |
||
|
||
messages, | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,13 +19,14 @@ const messages = { | |
|
||
module.exports = { | ||
meta: { | ||
type: 'layout', | ||
docs: { | ||
description: 'Disallow multiple spaces between inline JSX props', | ||
category: 'Stylistic Issues', | ||
recommended: false, | ||
url: docsUrl('jsx-props-no-multi-spaces'), | ||
}, | ||
fixable: 'code', | ||
fixable: 'whitespace', | ||
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. and here |
||
|
||
messages, | ||
|
||
|
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.
why is this change correct?
(if it is correct, i'd like to land it separately, before this PR)
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.
it was part of the original PR
I'm not 100% sure what this property means because the documentation doesn't mention what is the difference between
code
andwhitespace
; possiblywhitepsace
means that a fix will only change whitespace charactersThere 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.
@ljharb I've reverted the changes to
fixable
andcategory
in made by the previous PR author as they are not related to--fix-type
(purpose of this PR); please have a look, thanks!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.
looks like this change was correct, because the fix changes only spacing before the bracket (indents + newline), see eslint/eslint#15489 (comment)
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.
@sryze can we make a separate PR that changes all the "code"s to "whitespace"s?