0.5.1 • Published 7 years ago

sort-class-members-codemod v0.5.1

Weekly downloads
57
License
MIT
Repository
github
Last release
7 years ago

sort-class-members-codemod

Build Status npm (scoped) npm

This repository contains a codemod script for fixing ordering of ES6 class members defined when using the eslint-plugin-sort-class-members plugin.

Setup

  • Install jscodeshift globally (or as a local dependency if you like)

     npm install -g jscodeshift
  • Install the codemod

    yarn add --dev sort-class-members-codemod

Running

jscodeshift -t node_modules/sort-class-members-codemod/index <path-of-file-to-fix>

Additional flags:

FlagWhat it does
-dDry run codemods. Don't make any changes
-pPrint the output to stdout
--reactOnlyOnly fix sorting errors in React Component classes

Prior Art

TODO

  • Fix ordering of accessorPairs
  • Moaar tests!