We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Documentation says that code below consider to be incorrect
type Props = { enabled: boolean } const Hello = (props: Props) => <div />;
but you are required to use propTypes to get error from the linter
Hello.propTypes = { enabled: PropTypes.bool }
.eslintrc
{ "parser": "@typescript-eslint/parser", "parserOptions": { "project": "./tsconfig.json" }, "extends": ["eslint:recommended", "plugin:react/recommended"], "plugins": ["react"], "settings": { "react": { "version": "detect" } }, "rules": { "react/boolean-prop-naming": ["error", { "rule": "^(is|has)[A-Z]([A-Za-z0-9]?)+" }] } }
package.json
{ "name": "issue-eslint-plugin-react", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", "@types/jest": "^26.0.15", "@types/node": "^12.0.0", "@types/react": "^16.9.53", "@types/react-dom": "^16.9.8", "prop-types": "^15.7.2", "react": "^17.0.1", "react-dom": "^17.0.1", "react-scripts": "4.0.1", "typescript": "^4.0.3", "web-vitals": "^0.2.4" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] }, "devDependencies": { "eslint-plugin-react": "^7.21.5" } }
The text was updated successfully, but these errors were encountered:
[Tests] boolean-prop-naming: add passing test
boolean-prop-naming
4661f1c
Closes jsx-eslint#2892
Indeed, these tests fail in invalid. This should be fixed.
invalid
Sorry, something went wrong.
ae5ace5
Successfully merging a pull request may close this issue.
Documentation says that code below consider to be incorrect
but you are required to use propTypes to get error from the linter
Configuration
.eslintrc
package.json
The text was updated successfully, but these errors were encountered: