Skip to content

Releases: arthurgeron/eslint-plugin-react-usememo

v2.5.0

11 Apr 14:09
beee70c

Choose a tag to compare

2.5.0 Beta

13 Mar 11:23
v2.5.0--beta1
c8ec4cb

Choose a tag to compare

2.5.0 Beta Pre-release
Pre-release

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

22 Oct 22:55
e47bb4d

Choose a tag to compare

What's Changed

  • fix: append async keyword when replace async func with useCallback by @fossamagna in #48

Full Changelog: v2.4.3...v2.4.4

v2.4.3

07 Oct 17:46

Choose a tag to compare

What's Changed

  • feat: add ignoredPropNames option to require-usememo rule by @fossamagna in #47

New Contributors

Full Changelog: v2.4.2...v2.4.3

v2.4.2

06 Oct 03:08

Choose a tag to compare

What's Changed

Full Changelog: v2.4.1...v2.4.2

v2.4.1

14 Aug 01:56

Choose a tag to compare

What's Changed

Full Changelog: v2.4.0...v2.4.1

v2.4.0

25 Apr 20:23

Choose a tag to compare

What's Changed

Release/2.4.0 by @arthurgeron in #44

  • Fixes #43 ;

  • Optimized isComplexComponent expression 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

09 Feb 15:58

Choose a tag to compare

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

20 Jan 16:37

Choose a tag to compare

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
  • Fixed issue where rules with a ignore option that uses minimatch'd not work properly if their value is set to false (affects require-usememo rule).

Full Changelog: v2.2.3...v2.3.0

v2.2.3

06 Jan 00:03

Choose a tag to compare

What's Changed

Full Changelog: v2.2.2...v2.2.3