Skip to content

eslint/eslint-transforms

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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) { ... }
};