This repository contains a codemod script for fixing ordering of ES6 class members defined when using the eslint-plugin-sort-class-members plugin.
-
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
jscodeshift -t node_modules/sort-class-members-codemod/index.js <path-of-file-to-fix>
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 |
- Fix ordering of
accessorPairs
- Moaar tests!