-
-
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
react/no-arrow-function-lifecycle
creating invalid code
#3337
Labels
Comments
input: export default class Root extends Component {
getInitialState = () => ({
errorImporting: null,
errorParsing: null,
errorUploading: null,
file: null,
fromExtension: false,
importSuccess: false,
isImporting: false,
isParsing: false,
isUploading: false,
parsedResults: null,
showLongRunningMessage: false,
});
} invalid output: export default class Root extends Component {
getInitialState() { return {
errorImporting: null,
errorParsing: null,
errorUploading: null,
file: null,
fromExtension: false,
importSuccess: false,
isImporting: false,
isParsing: false,
isUploading: false,
parsedResults: null,
showLongRunningMessage: false,
}; }); // Extra trailing paren
} |
THANK YOU @ljharb this was driving me bonkers, I was convinced it was a bug related to prettier/eslint integration, but it seems isolated to eslint. |
cc @ngtan |
ljharb
added a commit
to ljharb/eslint-plugin-react
that referenced
this issue
Sep 29, 2022
…emove the semi and wrapping parens Fixes jsx-eslint#3337
The solution I came up with is a bit quick and dirty, so it probably won't work reliably for atypical forms of semicolon usage, but this should be a start, and will fix the reported issue at least :-) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please see this comment: prettier/eslint-plugin-prettier#65 (comment)
The text was updated successfully, but these errors were encountered: