babel/eslint/babel-eslint-plugin-development
Nicolò Ribaudo b615efba87 Export rules
2018-11-20 21:20:58 +01:00
..
2018-11-20 21:20:58 +01:00
2018-11-20 20:30:08 +01:00
2018-11-18 23:57:36 +01:00
2018-11-18 23:57:36 +01:00
2018-11-18 23:57:36 +01:00
2018-11-19 00:53:17 +01:00
2018-11-20 21:11:47 +01:00
2018-11-18 23:57:36 +01:00

eslint-plugin-babel-plugin

A set of eslint rules to enforce best practices in the development of Babel plugins.

Installation

You'll first need to install ESLint:

$ npm install --save-dev eslint

Next, install eslint-plugin-babel-plugin:

$ npm install --save-dev eslint-plugin-babel-plugin

Then, load the plugin in your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["babel-plugin"]
}

Supported Rules

Note: Rules marked with 🔧 are autofixable.

  • babel-plugin/no-deprecated-clone (🔧): Disallows using the deprecated t.clone(node) and t.cloneDeep(node) methods from @babel/types. Those calls are replaced with t.cloneNode(node) when using eslint --fix.
  • babel-plugin/no-undefined-identifier: Disallows using t.identifier("undefined") to create a node which represents an undefined value, since it might cause problem if undefined is redeclared.
  • babel-plugin/plugin-name: Requires plugins to have a name property, which can be useful for debugging purposes.