diff --git a/packages/eslint-config-vtex-react/CHANGELOG.md b/packages/eslint-config-vtex-react/CHANGELOG.md index 942f3b5..5cb9b25 100644 --- a/packages/eslint-config-vtex-react/CHANGELOG.md +++ b/packages/eslint-config-vtex-react/CHANGELOG.md @@ -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 diff --git a/packages/eslint-config-vtex-react/rules/react.js b/packages/eslint-config-vtex-react/rules/react.js index c74fd35..db2bcd2 100644 --- a/packages/eslint-config-vtex-react/rules/react.js +++ b/packages/eslint-config-vtex-react/rules/react.js @@ -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