Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-plugin-self

not-an-aardvark447MIT1.2.1

Allows ESLint plugins to be run on themselves

eslint-plugin, eslintplugin

readme

eslint-plugin-self

When writing an ESLint plugin, it's often useful to use the plugin's rules to lint the plugin's own codebase. You can use eslint-plugin-self to do that.

Usage

npm install eslint-plugin-self --save-dev

Note: eslint-plugin-self must be installed locally (it will not work if installed globally), and the project that installs it must be a functioning ESLint plugin.

Add the following to your config file:

{
  "plugins": [
    "self"
  ]
}

Then you can use your plugin's rules, with the self/ prefix:

{
  "rules": {
    "self/my-custom-rule": "error"
  }
}

You can also use your plugin's configs, or anything else exported by your plugin:

{
  "extends": [
    "plugin:self/some-config"
  ]
}

changelog

Changelog

v1.2.1 (2020-05-27)

  • Support overrides having no rules :see_no_evil: (#5) (e266543)

v1.2.0 (2019-03-04)

  • Support redefining plugins, overrides and rules with a "/" in them (#2) (428664e)

v1.1.0 (2018-07-06)

  • Chore: add release script (983a7d0)
  • Update: Add support for @scoped packages (#1) (c57a01b)

v1.0.1 (2017-07-02)

  • Fix: transform references to own rules in configs to use self prefix (2dce85e)