Closed
Description
Environments
- | Version |
---|---|
Node.js | 14.17.3 |
ESLint | 7.32.0 |
eslint-plugin-react |
7.24.0 |
Error stack
TypeError: Cannot read property 'toLowerCase' of undefined
Occurred while linting $PROJECT_DIR/$COMPONENT_FILE:$LINE_NUMBER
at $PROJECT_DIR/node_modules/eslint-plugin-react/lib/rules/no-typos.js:181:50
at Array.forEach (<anonymous>)
at reportErrorIfLifecycleMethodCasingTypo ($PROJECT_DIR/node_modules/eslint-plugin-react/lib/rules/no-typos.js:180:25)
at Object.MethodDefinition ($PROJECT_DIR/node_modules/eslint-plugin-react/lib/rules/no-typos.js:256:9)
at updatedRuleInstructions.<computed> ($PROJECT_DIR/node_modules/eslint-plugin-react/lib/util/Components.js:1016:45)
at $PROJECT_DIR/node_modules/eslint/lib/linter/safe-emitter.js:45:58
at Array.forEach (<anonymous>)
at Object.emit ($PROJECT_DIR/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
at NodeEventGenerator.applySelector ($PROJECT_DIR/node_modules/eslint/lib/linter/node-event-generator.js:293:26)
at NodeEventGenerator.applySelectors ($PROJECT_DIR/node_modules/eslint/lib/linter/node-event-generator.js:322:22)
Reproducible code
import React from 'react';
export default class Editor extends React.Component {
#somethingPrivate() {
// ...
}
render() {
const { value = '' } = this.props;
return (
<textarea>
{value}
</textarea>
);
}
}
Situation description
The whole ESLint watching process has crashed by only just make the method private; write #
symbol.
Activity
ljharb commentedon Aug 16, 2021
What's your eslint config that allows that to parse?
morrighan commentedon Aug 16, 2021
I just using Airbnb's configuration.
[Fix] `no-typos`: fix crash on private methods
morrighan commentedon Aug 20, 2021
🙌🏻 @ljharb 🎉
fix(deps): update dependency eslint-plugin-react to v7.35.0
fix(deps): update dependency eslint-plugin-react to v7.35.0
fix(deps): update dependency eslint-plugin-react to v7.35.0
fix(deps): update dependency eslint-plugin-react to v7.35.0
fix(deps): update dependency eslint-plugin-react to v7.35.0
fix(deps): update dependency eslint-plugin-react to v7.35.0
fix(deps): update dependency eslint-plugin-react to v7.35.0
fix(deps): update dependency eslint-plugin-react to v7.35.0
fix(deps): update dependency eslint-plugin-react to v7.37.3