Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pastelsky/sort-class-members-codemod
A codemod for automatically fixing issues reported by eslint-plugin-sort-class-members
https://github.com/pastelsky/sort-class-members-codemod
codemod eslint eslint-plugin jscodeshift
Last synced: 5 days ago
JSON representation
A codemod for automatically fixing issues reported by eslint-plugin-sort-class-members
- Host: GitHub
- URL: https://github.com/pastelsky/sort-class-members-codemod
- Owner: pastelsky
- License: mit
- Created: 2017-03-14T13:33:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-08T12:17:51.000Z (over 4 years ago)
- Last Synced: 2024-10-12T21:12:18.398Z (26 days ago)
- Topics: codemod, eslint, eslint-plugin, jscodeshift
- Language: JavaScript
- Homepage:
- Size: 127 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-codemods - sort-class-members-codemod - A codemod for automatically fixing issues reported by eslint-plugin-sort-class-members. (JavaScript)
README
# sort-class-members-codemod
[![Build Status](https://travis-ci.org/pastelsky/sort-class-members-codemod.svg)](https://travis-ci.org/pastelsky/sort-class-members-codemod) [![npm (scoped)](https://img.shields.io/npm/v/sort-class-members-codemod.svg)](https://www.npmjs.com/package/sort-class-members-codemod)
[![npm](https://img.shields.io/npm/l/sort-class-members-codemod.svg)](https://www.npmjs.com/package/sort-class-members-codemod)This repository contains a codemod script for fixing ordering of ES6 class members defined when using the [eslint-plugin-sort-class-members](https://github.com/bryanrsmith/eslint-plugin-sort-class-members) plugin.
## Setup
* Install [`jscodeshift`](https://github.com/facebook/jscodeshift) globally (or as a local dependency if you like)
```bash
npm install -g jscodeshift
```
* Install the codemod
```bash
yarn add --dev sort-class-members-codemod
```## Running
```bash
jscodeshift -t node_modules/sort-class-members-codemod/index.js
```### Additional flags:
| Flag | What it does |
|---|---
| ` -d` | Dry run codemods. Don't make any changes |
| `-p` | Print the output to stdout |
| `--reactOnly` | Only fix sorting errors in React Component `classes` |
## Prior Art
- [react-codemod](https://github.com/reactjs/react-codemod/blob/master/transforms/sort-comp.js)## TODO
- [ ] Fix ordering of `accessorPairs`
- [ ] Moaar tests!