Skip to content

A codemod for automatically fixing issues reported by eslint-plugin-sort-class-members

License

Notifications You must be signed in to change notification settings

pastelsky/sort-class-members-codemod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.js <path-of-file-to-fix>

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

TODO

  • Fix ordering of accessorPairs
  • Moaar tests!

About

A codemod for automatically fixing issues reported by eslint-plugin-sort-class-members

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published