This package has been deprecated

Author message:

This package has been deprecated. Please consider using Lerna to manage multi packages or specifying `file` at `package.json`.

eslint-plugin-project

0.2.2 • Public • Published

eslint-plugin-project

This ESLint plugin allows you load project-scope ESLint rules.

Install

npm i -D eslint-plugin-project

or

yarn add --dev eslint-plugin-project

Usage

You must put your rules definition files somewhere. By default, this plugin will look up tools/eslint-rules directory.

For example, we put some rules in eslint/rules of your current working directory. Now we configure our ESLint config file like this:

{
  "settings": {
    "projectRulesDir": "eslint/rules"
  }
}

That is, we tell the plugin to search the rules in eslint/rules directory. The path can be absulote or relative (to current working directory). Note that the projectRulesDir can be an array if you want to specify multiple directories.

Next enable this plugin in ESLint config file:

{
  "plugins": ["project"],
  "settings": {
    "projectRulesDir": "eslint/rules"
  }
}

Now you can use your rules:

{
  "plugins": ["project"],
  "settings": {
    "projectRulesDir": "eslint/rules"
  },
  "rules": {
    "project/my-internal-rule": 2
  }
}

Comparsion

  • eslint-plugin-rulesdir

    This plugin is inspired from eslint-plugin-rulesdir. However, eslint-plugin-rulesdir isn't friendly for static ESLint config file. (You must use .eslintrc.js file and set a property in JavaScript runtime.) And eslint-plugin-rulesdir has issue with Visual Studio Code integration. If you don't mind the format of ESLint config file and doesn't care about the integration with VS Code, you still can use this plugin, and eslint-plugin-rulesdir is used in ESLint official repository.

  • eslint-plugin-local-rules

    eslint-plugin-local-rules doesn't allow you to customize your local rules path. And, you only can put all your rules in one file, which troubles project management.

License

MIT License (c) 2019-present Pig Fang

Readme

Keywords

none

Package Sidebar

Install

npm i eslint-plugin-project

Weekly Downloads

2

Version

0.2.2

License

MIT

Unpacked Size

5.11 kB

Total Files

4

Last publish

Collaborators

  • gplane