You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.
sourceCode.getCommentsBefore is not a function
TypeError: sourceCode.getCommentsBefore is not a function
at Object.fix (.../node_modules/eslint-plugin-react/lib/rules/jsx-curly-spacing.js:258:46)
at RuleContext.report (.../node_modules/eslint/lib/rule-context.js:127:34)
at reportNoEndingSpace (.../node_modules/eslint-plugin-react/lib/rules/jsx-curly-spacing.js:252:15)
at EventEmitter.validateBraceSpacing (.../node_modules/eslint-plugin-react/lib/rules/jsx-curly-spacing.js:370:11)
at emitOne (events.js:101:20)
at EventEmitter.emit (events.js:188:7)
at NodeEventGenerator.applySelector (.../node_modules/eslint/lib/util/node-event-generator.js:265:26)
at NodeEventGenerator.applySelectors (.../node_modules/eslint/lib/util/node-event-generator.js:294:22)
at NodeEventGenerator.enterNode (.../node_modules/eslint/lib/util/node-event-generator.js:308:14)
at CodePathAnalyzer.enterNode (.../node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:602:23)
at CommentEventGenerator.enterNode (.../node_modules/eslint/lib/util/comment-event-generator.js:98:23)
at Traverser.enter (.../node_modules/eslint/lib/eslint.js:929:36)
After much trial and error I found that the error goes away if you remove the space after the function:
node version:
6.11.2
babel-eslint version:
8.2.2
yarn version:
0.27.5
.eslintrc:
I discovered an issue in JSX where having an extra space after a function in an
onClick
breaks the linter, and it's not clear to the user why:This is the error I get:
After much trial and error I found that the error goes away if you remove the space after the function:
The text was updated successfully, but these errors were encountered: