Skip to content
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

Disable rule require-default-props for the function react components; Change display-name rule to error #54

Merged
merged 11 commits into from
Feb 4, 2025
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.21.3
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change log

## 2.2.0

- Make required `defaultArguments` instead of `defaultProps` in `require-default-props` rule for function react components
- Change `display-name` rule to `error`

## 2.1.0

- Restrict `enum` usage for typescript
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-yola",
"version": "2.1.0",
"version": "2.2.0",
"main": "index.js",
"scripts": {
"lint": "eslint -c .eslintrc.js ./",
4 changes: 3 additions & 1 deletion src/eslint-config-yola/react/rules/react.js
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ module.exports = {

// Prevent missing displayName in a React component definition
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md
'react/display-name': ['off', { ignoreTranspilerName: false }],
'react/display-name': 'error',

// Forbid certain propTypes (any, array, object)
// https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/forbid-prop-types.md
@@ -402,6 +402,8 @@ module.exports = {
'react/require-default-props': [
'error',
{
classes: 'defaultProps',
functions: 'defaultArguments',
forbidDefaultForRequired: true,
},
],