eslint-fixit

0.0.7 • Public • Published

Eslint-Fixit

Eslint-Fixit is an easy way to fix eslint violations. It allows you to open up each of the eslint violations in your editor so you can fix them quickly.

eslint-fixit

Installation

Yarn:

yarn global add npx eslint-fixit

Npm:

npm install -g npx eslint-fixit

Usage

You must already have eslint setup for your project. In the directory containing your project run:

eslint-fixit .

Editor Setup

By default eslint-fixit is setup to use nano. But most likely, you don't use nano as your editor, so you can setup your own editor by adding an export for your editor in your ~/.bash_profile (or equivilant if you use something other than bash).

# Vim
export ESLINT_FIXIT_EDITOR="vim \"+call cursor(%line, %column)\" %file"

# Sublime Text
export ESLINT_FIXIT_EDITOR="subl -w %file:%line:%column"

# Emacs
export ESLINT_FIXIT_EDITOR="emacs +%line:%column %file"

# Atom
export ESLINT_FIXIT_EDITOR="atom -w %file:%line:%column"

# Visual Studio Code
export ESLINT_FIXIT_EDITOR="code -w -g %file:%line:%column" 
# disclaimer: waits for app to close, not tab

I know I've missed some editors, pull requests are welcome for any other editors.

/eslint-fixit/

    Package Sidebar

    Install

    npm i eslint-fixit

    Weekly Downloads

    0

    Version

    0.0.7

    License

    MIT

    Last publish

    Collaborators

    • jimmyhmiller