| 1 | # @babel/eslint-plugin-development |
| 2 | |
| 3 | A set of eslint rules to enforce best practices in the development of Babel plugins. |
| 4 | |
| 5 | ## Installation |
| 6 | |
| 7 | You'll first need to install [ESLint](http://eslint.org): |
| 8 | |
| 9 | ``` |
| 10 | $ npm install --save-dev eslint |
| 11 | ``` |
| 12 | |
| 13 | Next, install `@babel/eslint-plugin-development`: |
| 14 | |
| 15 | ``` |
| 16 | $ npm install --save-dev @babel/eslint-plugin-development |
| 17 | ``` |
| 18 | |
| 19 | Then, load the plugin in your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix: |
| 20 | |
| 21 | ```json |
| 22 | { |
| 23 | "plugins": ["@babel/development"] |
| 24 | } |
| 25 | ``` |
| 26 | |
| 27 | ## Supported Rules |
| 28 | |
| 29 | > Note: Rules marked with :wrench: are autofixable. |
| 30 | |
| 31 | * `@babel/development/no-deprecated-clone` (:wrench:): Disallows using the deprecated |
| 32 | `t.clone(node)` and `t.cloneDeep(node)` methods from `@babel/types`. Those |
| 33 | calls are replaced with `t.cloneNode(node)` when using `eslint --fix`. |
| 34 | * `@babel/development/no-undefined-identifier`: Disallows using |
| 35 | `t.identifier("undefined")` to create a node which represents an `undefined` |
| 36 | value, since it might cause problem if `undefined` is redeclared. |
| 37 | * `@babel/development/plugin-name`: Requires plugins to have a `name` property, which |
| 38 | can be useful for debugging purposes. |