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

feat(react): defines no-unstable-nested-components rule #98

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/eslint-config-vtex-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Defines react/no-unstable-nested-components as error to prevent performance issues on react apps

## [8.0.0] - 2021-03-25
### Changed
Expand Down
4 changes: 4 additions & 0 deletions packages/eslint-config-vtex-react/rules/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ module.exports = {
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-this-in-sfc.md
'react/no-this-in-sfc': 'error',

// Prevent creating unstable components inside components
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md,
'react/no-unstable-nested-components': 'error',

// Enforce the style attribute to be an object
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md
// TODO maybe enable? it's annoying for the style prop of react-intl components
Expand Down