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
v7.8.0+ breaks in eslint v3: Bug with spacing before curly brace in jsx #1779
Comments
I think you're missing that a "closing bracket" is referring to Try |
Ok, sorry :-) |
Yes, the crashing part is a clear bug if you're on the latest eslint. What version do you have installed, and does |
I have npm ls returns
|
ok, so it looks like your node_modules is invalid. Try |
e4de360#diff-773de86741d8d58f3b917343e985eaf0R256 introduced Downgrading to It looks like this commit should have also modified the peerDependency. It now needs 4.0.0. |
@reergymerej thanks, that’s very helpful. We’ll have to figure out how to restore eslint v3 support, since changing the peer dep is semver-major. |
Thanks for the report @pavlovanton, and for the help to identify the issue @reergymerej. After fixing this issue I found a couple of other small issues with ESLint 3 (69b1317, 31e4f33, 677e1bd) and they should all be fixed in next release. I also updated our Travis configuration to run our tests on different ESLint versions ( |
Attempt check with lint following code:
<Component onChange={(e) => set('string', e.target.value)}/>
Causes the error:
89:94 error A space is required before closing bracket react/jsx-tag-spacing
When trying to check the code with lint:
<Component onChange={(e) => set('string', e.target.value) }/>
Lint return:
TypeError: sourceCode.getCommentsBefore is not a function at Object.fix (/home/anton.pavlov/projects/trendmd-admin-dashboard/node_modules/eslint-plugin-react/lib/rules/jsx-curly-spacing.js:256:46)
at RuleContext.report (/home/anton.pavlov/projects/trendmd-admin-dashboard/node_modules/eslint/lib/rule-context.js:127:34)
at reportNoEndingSpace (/home/anton.pavlov/projects/trendmd-admin-dashboard/node_modules/eslint-plugin-react/lib/rules/jsx-curly-spacing.js:250:15)
at EventEmitter.validateBraceSpacing (/home/anton.pavlov/projects/trendmd-admin-dashboard/node_modules/eslint-plugin-react/lib/rules/jsx-curly-spacing.js:368:11)
at emitOne (events.js:121:20)
at EventEmitter.emit (events.js:211:7)
at NodeEventGenerator.applySelector (/home/anton.pavlov/projects/trendmd-admin-dashboard/node_modules/eslint/lib/util/node-event-generator.js:265:26)
at NodeEventGenerator.applySelectors (/home/anton.pavlov/projects/trendmd-admin-dashboard/node_modules/eslint/lib/util/node-event-generator.js:294:22)
at NodeEventGenerator.enterNode (/home/anton.pavlov/projects/trendmd-admin-dashboard/node_modules/eslint/lib/util/node-event-generator.js:308:14)
at CodePathAnalyzer.enterNode (/home/anton.pavlov/projects/trendmd-admin-dashboard/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:602:23)
But lint works properly with the following code:
<Component
onChange={(e) => set('string', e.target.value)}
/>
Expected:
Lint works properly with both of variant of codes above
The text was updated successfully, but these errors were encountered: