Releases: arthurgeron/eslint-plugin-react-usememo
v2.5.0
Full Changelog: v2.4.4...v2.5.0
2.5.0 Beta
ESLint v9 Configuration (eslint.config.js)
ESLint v9 uses the flat config format. You can use this plugin in multiple ways:
Option 1: Importing the default config
import { flatConfig } from '@arthurgeron/eslint-plugin-react-usememo';
export default [
{
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: {
'@arthurgeron/react-usememo': flatConfig,
},
rules: {
'@arthurgeron/react-usememo/require-usememo': 'error',
'@arthurgeron/react-usememo/require-memo': 'error',
'@arthurgeron/react-usememo/require-usememo-children': 'error',
},
},
];Option 2: Using the recommended config
import { flatConfig } from '@arthurgeron/eslint-plugin-react-usememo';
export default [
// Other configs...
flatConfig.configs.recommended,
];Option 3: Using CommonJS syntax
const { flatConfig } = require('@arthurgeron/eslint-plugin-react-usememo');
module.exports = [
// Other configs...
{
plugins: {
'@arthurgeron/react-usememo': flatConfig,
},
rules: {
'@arthurgeron/react-usememo/require-usememo': 'error',
'@arthurgeron/react-usememo/require-memo': 'error',
'@arthurgeron/react-usememo/require-usememo-children': 'error',
},
},
];ESLint 8 is still supported, but will be removed in the future.
v2.4.4
What's Changed
- fix: append
asynckeyword when replace async func with useCallback by @fossamagna in #48
Full Changelog: v2.4.3...v2.4.4
v2.4.3
What's Changed
- feat: add ignoredPropNames option to require-usememo rule by @fossamagna in #47
New Contributors
- @fossamagna made their first contribution in #47
Full Changelog: v2.4.2...v2.4.3
v2.4.2
What's Changed
- feat: check for semver changes by @arthurgeron in #49
Full Changelog: v2.4.1...v2.4.2
v2.4.1
What's Changed
- fix: require usememo rule checking global jsx by @arthurgeron in #46
Full Changelog: v2.4.0...v2.4.1
v2.4.0
What's Changed
Release/2.4.0 by @arthurgeron in #44
-
Fixes #43 ;
-
Optimized
isComplexComponentexpression by replacing regular expression with a simple character comparison. -
When the usememo rule rejects a JSX Attribute content in an invalid context (e.g. wrapping expressions) it won't try fixing it, instead, it'll report the issue with a new error message.
Full Changelog: v2.3.1...v2.4.0
v2.3.1
What's Changed
- fix: import multiple hooks when react is imported by @andrepolischuk in #41
New Contributors
- @andrepolischuk made their first contribution in #41
Full Changelog: v2.3.0...v2.3.1
v2.3.0
What's Changed
- Fix #33 by @arthurgeron in #36
- Require-memo:
- Now supports ignoring components by name through the
ignoredComponentsoption, supports minimatch/glob syntax - Now also works for components declared separately from export statements
- Only checks exported components
- Now supports ignoring components by name through the
- Fixed issue where rules with a
ignoreoption that uses minimatch'd not work properly if their value is set tofalse(affectsrequire-usememorule).
Full Changelog: v2.2.3...v2.3.0
v2.2.3
What's Changed
- Added support for React Canary by @arthurgeron in #40
Full Changelog: v2.2.2...v2.2.3