rnx-kit/packages/eslint-plugin
renovate[bot] f4b22e111c
chore(deps): update dependency eslint-plugin-react to v7.37.2 (#3414)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
2024-11-11 15:05:01 +00:00
..
src chore(deps): update dependency eslint-plugin-react to v7.37.2 (#3414) 2024-11-11 15:05:01 +00:00
test fix(deps): update eslint (major) (#3394) 2024-10-17 14:41:52 +00:00
CHANGELOG.md RELEASING: Releasing 2 package(s) (#3398) 2024-10-18 11:02:38 +00:00
README.md feat(eslint-preset)!: migrate to flat config (#2813) 2023-11-24 11:52:09 +01:00
eslint.config.js chore: migrate to ESLint flat config (#2782) 2023-11-03 14:02:18 +01:00
package.json RELEASING: Releasing 2 package(s) (#3398) 2024-10-18 11:02:38 +00:00
tsconfig.json feat(tsconfig): base TypeScript configs for working with Node (#2886) 2023-12-18 12:05:07 +01:00

README.md

@rnx-kit/eslint-plugin

Build npm version

@rnx-kit/eslint-plugin is a set of configurations and rules that can be used as is, or extended in your own ESLint config.

Note that this plugin requires the new ESLint configuration format. If you still rely on the previous format, use version 0.5.x instead.

Install

yarn add @rnx-kit/eslint-plugin --dev

or if you're using npm:

npm add --save-dev @rnx-kit/eslint-plugin

Usage

This ESLint plugin exports multiple configurations. For instance, to use the recommended configuration, you can re-export it in your flat config like below:

module.exports = require("@rnx-kit/eslint-plugin/recommended");

Alternatively, if you want to add customizations:

const rnx = require("@rnx-kit/eslint-plugin");
module.exports = [
  ...rnx.configs.recommended,
  {
    rules: {
      "@rnx-kit/no-const-enum": "error",
      "@rnx-kit/no-export-all": "error",
    },
  },
];

If you're just interested in the rules, you can use it as a plugin and enable the rules you're interested in:

module.exports = [
  {
    plugins: {
      "@rnx-kit": require("@rnx-kit/eslint-plugin"),
    },
    rules: {
      "@rnx-kit/no-const-enum": "error",
      "@rnx-kit/no-export-all": "error",
    },
  },
];

Supported Rules

  • ✓: Enabled with @rnx-kit/eslint-plugin/recommended
  • 🔧: Fixable with --fix
🔧 Rule Description
@rnx-kit/no-const-enum disallow const enum (why is it bad?)
🔧 @rnx-kit/no-export-all disallow export * (why is it bad?)