ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

ESLint Fix

by kufii ST2/ST3

Sublime Text plugin to run eslint --fix on the current file

Details

  • 1.1.3
  • github.​com
  • github.​com
  • 2 months ago
  • 29 minutes ago
  • 4 months ago

Installs

  • Total 1K
  • Win 482
  • OS X 652
  • Linux 243
Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7
Windows 2 1 5 5 4 2 4 1 3 0 0 4 0 3 5 4 1 1 5 5 5 0 0 0 4 6 2 2 3 0 3 3 3 3 2 3 1 1 8 5 5 4 3 0 7 4
OS X 0 2 2 8 5 6 10 5 2 0 1 7 6 5 7 2 2 5 3 7 2 2 1 3 3 3 3 0 1 3 1 7 8 4 5 5 1 2 7 16 9 5 4 2 4 6
Linux 0 1 0 6 2 3 1 1 0 0 0 2 4 7 1 2 2 3 1 3 1 2 1 2 1 1 1 0 2 0 1 2 3 6 0 0 3 1 3 0 3 1 3 1 2 1

Readme

Source
raw.​githubusercontent.​com

Sublime ESLint Fix

A Sublime Text 3 plugin to run eslint –fix on the current file

Installation

Dependencies

This plugin requires ESLint in order to function. For information on installing ESLint, check out the Getting Started guide.

Plugin Installation

This plugins is installable via Package Control.

To install via Package Control, do the following:

  1. Within Sublime Text, bring up the Command Palette and type install. Among the commands you should see Package Control: Install Package. If that command is not highlighted, use the keyboard or mouse to select it. There will be a pause of a few seconds while Package Control fetches the list of available plugins.

  2. When the plugin list appears, type eslint fix. Among the entries you should see ESLint Fix. Select this entry to install it.

Commands

Command Palette

  • ESLint Fix: Fix this file

Default hotkeys:

  • Linux/Windows: [Ctrl + KE]
  • Mac: [Cmd + KE]

Settings

By default, the following settings are used:

{
    // The paths to look for executables
    "paths": {
        "linux": [],
        "osx": [],
        "windows": []
    },

    // The location to search for a locally installed eslint package.
    // These are all relative paths to a project's directory.
    // If this is not found, it will try to fallback to a global package
    // (see 'eslint_path' below)
    "local_eslint_path": {
        "windows": "node_modules/eslint/bin/eslint.js",
        "linux": "node_modules/.bin/eslint",
        "osx": "node_modules/.bin/eslint"
    },

    // Specify this path to an eslint config file to override the default behavior.
    // Passed to eslint as --config. Read more here:
    // http://eslint.org/docs/user-guide/command-line-interface#c---config
    // If an absolute path is provided, it will use as is.
    // Else, it will look for the file in the root of the project directory.
    // Failing either, it will skip the config file
    "config_path": {
        "windows": "",
        "linux": "",
        "osx": ""
    },
}

You can modify any settings by going to Preferences > Package Settings > ESLint Fix > Settings.

Project-Specific Settings Override

To override global plugin configuration for a specific project, add a settings object with an eslint-fix key in your .sublime-project. This file is accessible via Project -> Edit Project.

For example:

{
    "folders": [
        {
            "path": "."
        }
    ],
    "settings": {
        "config_path": {
            "windows": "..."
        }
    }
}

Acknowledgments

While the code is unique, some of it is inspired by this plugin. My plugin differs by running on the current buffer instead of the last saved state of the file.