Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eslint/eslint-transforms
Codemods for the ESLint ecosystem
https://github.com/eslint/eslint-transforms
Last synced: 11 days ago
JSON representation
Codemods for the ESLint ecosystem
- Host: GitHub
- URL: https://github.com/eslint/eslint-transforms
- Owner: eslint
- License: other
- Created: 2016-05-18T17:21:42.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2023-10-23T12:18:34.000Z (8 months ago)
- Last Synced: 2024-04-14T07:42:15.555Z (2 months ago)
- Language: JavaScript
- Size: 29.3 KB
- Stars: 18
- Watchers: 11
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Lists
- awesome-codemods - eslint-transforms - Codemods for the ESLint ecosystem. (JavaScript)
README
# ESLint Transforms
A collection of jscodeshift transforms to help upgrade ESLint rules to new versions of [ESLint](https://github.com/eslint/eslint).
Supports [Node.js](https://nodejs.org) version 4 or above.## Installation
You can install the ESLint transforms tool using [npm](https://npmjs.com):
```
$ npm install eslint-transforms --save-dev
```## Usage
```
$ eslint-transforms
```Where:
`transform-name` - Name of the transform you want to run (e.g. `new-rule-format`). See the [transforms](#transforms) section below for a list of available transforms.
`path` - Files or directory to transform.
For more information on jscodeshift, check their official [docs](https://github.com/facebook/jscodeshift).
## 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:
```javascript
module.exports = function(context) { ... }
```to the new format, introduced in ESLint 2.10.0:
```javascript
module.exports = {
meta: {
docs: {},
schema: []
},
create: function(context) { ... }
};
```