Package Exports
- eslint-plugin-react-perf
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-react-perf) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
eslint-plugin-react-perf
Performance-minded React linting rules for ESLint (motivated by esamatti's post "React.js pure render performance anti-pattern").
Installation
$ npm i eslint-plugin-react-perfConfiguration
Add plugins section and specify eslint-plugin-react-perf as a plugin.
{
"plugins": [
"react-perf"
]
}List of supported rules
- react-perf/jsx-no-new-object-as-prop: Prevent
{...}as JSX prop value - react-perf/jsx-no-new-array-as-prop: Prevent
[...]as JSX prop value - react-perf/jsx-no-new-function-as-prop: Prevent
functionas JSX prop value - react-perf/jsx-no-jsx-as-prop: Prevent JSX as JSX prop value
Recommended
This plugin exports a recommended configuration that enforce React good practices.
To enable this configuration use the extends property in your .eslintrc config file:
{
"extends": ["plugin:react-perf/recommended"]
}See ESLint documentation for more information about extending configuration files.
The rules enabled in this configuration are:
- react-perf/jsx-no-new-object-as-prop
- react-perf/jsx-no-new-array-as-prop
- react-perf/jsx-no-new-function-as-prop
- react-perf/jsx-no-jsx-as-prop
All
This plugin also exports an all configuration that includes every available rule.
{
"plugins": [
"react-perf"
],
"extends": ["plugin:react-perf/all"]
}Test anti-patterns in runtime
Try out cvazac/test-ref-pattern.
License
eslint-plugin-react-perf is licensed under the MIT License.