-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
versions:
"eslint-plugin-react": "7.1.0"
"babel-eslint": "7.2.2"
"eslint": "3.19.0"
When I try to run the following config I get two errors:
"react/jsx-sort-props": [2, { "reservedFirst": false, "noSortAlphabetically": false }]
Error:
Configuration for rule "react/jsx-sort-props" is invalid:
Value "data["0"].reservedFirst" has additional properties.
Value "data["0"].noSortAlphabetically" has additional properties.
at validateRuleOptions (C:\Dev\MyProject\build\node_modules\eslint\lib\config\config-validator.js:115:15)
at Object.keys.forEach.id (C:\Dev\MyProject\build\node_modules\eslint\lib\config\config-validator.js:162:13)
at Array.forEach (native)
at Object.validate (C:\Dev\MyProject\build\node_modules\eslint\lib\config\config-validator.js:161:35)
at Object.load (C:\Dev\MyProject\build\node_modules\eslint\lib\config\config-file.js:522:19)
at loadConfig (C:\Dev\MyProject\build\node_modules\eslint\lib\config.js:63:33)
at getLocalConfig (C:\Dev\MyProject\build\node_modules\eslint\lib\config.js:130:29)
at Config.getConfig (C:\Dev\MyProject\build\node_modules\eslint\lib\config.js:256:22)
at hashOfConfigFor (C:\Dev\MyProject\build\node_modules\eslint\lib\cli-engine.js:599:41)
at executeOnFile (C:\Dev\MyProject\build\node_modules\eslint\lib\cli-engine.js:648:32)I have tried many different configurations, like:
"react/jsx-sort-props": [2, { "reservedFirst": [0, []] }]
"react/jsx-sort-props": [2, { "reservedFirst": [0, false] }]
"react/jsx-sort-props": [2, { "reservedFirst": [2, []] }]The reason I am explicitly setting the rule is because it appears that reservedFirst breaks the default rules. We used to have our config set to
"react/jsx-sort-props": 2
for alphabetical sorting, but with this new option it appears that reserved props are always taken into account, and our linter is throwing errors because of it. The linter always looks for the following props
var RESERVED_PROPS_LIST = [
'children',
'dangerouslySetInnerHTML',
'key',
'ref'
];Let me know if you need more info.
wojtekmaj
Metadata
Metadata
Assignees
Labels
No labels