Detalhes do pacote

@annangela/eslint-plugin-prefer-reflect

AnnAngela174MIT3.1.0

Modern version of original "prefer-reflect" rules in eslint

eslint, eslintplugin, eslint-plugin

readme (leia-me)

eslint-plugin-prefer-reflect

Main propose:

  • Modern version of original prefer-reflect rules in eslint

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install @annangela/eslint-plugin-prefer-reflect:

npm install @annangela/eslint-plugin-prefer-reflect --save-dev

Usage

eslint.config.js - flat config

Use the plugin:

import preferReflectPlugin from "@annangela/eslint-plugin-prefer-reflect";

// ...

export default {
    // ...
    plugins: {
        // ...
        "@annangela/prefer-reflect": preferReflectPlugin,
        // ...
    },
    rules: {
        // ...

        // @annangela/prefer-reflect
        "@annangela/prefer-reflect/prefer-reflect": "error",

        // ...
    },
};

.eslintrc (Deprecated)

Add @annangela/eslint-plugin-prefer-reflect to the plugins section of your .eslintrc configuration file:

{
    "plugins": [
        "@annangela/prefer-reflect"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "@annangela/prefer-reflect/prefer-reflect": "error"
    }
}

I know this repeated words looks stupid, but the eslint requires this format.

Supported Rules