eslint-transforms

Codemods for upgrading eslint rules

Usage no npm install needed!

<script type="module">
  import eslintTransforms from 'https://cdn.skypack.dev/eslint-transforms';
</script>

README

ESLint Transforms

A collection of jscodeshift transforms to help upgrade ESLint rules to new versions of ESLint. Supports Node.js version 4 or above.

Installation

You can install the ESLint transforms tool using npm:

$ npm install eslint-transforms --save-dev

Usage

$ eslint-transforms <transform-name> <path>

Where:

transform-name - Name of the transform you want to run (e.g. new-rule-format). See the transforms section below for a list of available transforms.

path - Files or directory to transform.

For more information on jscodeshift, check their official docs.

Transforms

new-rule-format

Please note: The transform will not work for rules that use ES6 modules syntax.

Transform that migrates an ESLint rule definition from the old format:

module.exports = function(context) { ... }

to the new format, introduced in ESLint 2.10.0:

module.exports = {
 meta: {
     docs: {},
     schema: []
 },
 create: function(context) { ... }
};