All Projects → SublimeLinter → Sublimelinter Eslint

SublimeLinter / Sublimelinter Eslint

Licence: mit
This linter plugin for SublimeLinter provides an interface to ESLint

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Sublimelinter Eslint

elint
A easy way to lint your code
Stars: ✭ 38 (-95.47%)
Mutual labels:  eslint, linter
Awesome Standard
Documenting the explosion of packages in the standard ecosystem!
Stars: ✭ 300 (-64.24%)
Mutual labels:  eslint, linter
gandalf-lint
Bad Code Shall Not Pass
Stars: ✭ 29 (-96.54%)
Mutual labels:  eslint, linter
codeclimate-eslint
Code Climate Engine for ESLint
Stars: ✭ 86 (-89.75%)
Mutual labels:  eslint, linter
Eslint Plugin Sonarjs
SonarJS rules for ESLint
Stars: ✭ 458 (-45.41%)
Mutual labels:  eslint, linter
eslint-config
An ESLint shareable config that I used in my projects
Stars: ✭ 15 (-98.21%)
Mutual labels:  eslint, linter
Lint Review
An automated code linting bot that integrates various code lint tools with github pull requests.
Stars: ✭ 279 (-66.75%)
Mutual labels:  eslint, linter
Grunt Eslint
Validate files with ESLint
Stars: ✭ 189 (-77.47%)
Mutual labels:  eslint, linter
Eslint Config Standard React
ESLint Shareable Config for React/JSX support in JavaScript Standard Style
Stars: ✭ 416 (-50.42%)
Mutual labels:  eslint, linter
Lynt
✨ A zero config JavaScript linter with support for Typescript, Flow, and React.
Stars: ✭ 390 (-53.52%)
Mutual labels:  eslint, linter
eslint-config-kingstinct-react-native
Eslint configuration for React-native based on Airbnb with some great tweaks
Stars: ✭ 23 (-97.26%)
Mutual labels:  eslint, linter
Xo
❤️ JavaScript/TypeScript linter (ESLint wrapper) with great defaults
Stars: ✭ 6,277 (+648.15%)
Mutual labels:  eslint, linter
arcanist-linters
A collection of custom Arcanist linters
Stars: ✭ 64 (-92.37%)
Mutual labels:  eslint, linter
standard-packages
List of packages that use `standard`
Stars: ✭ 32 (-96.19%)
Mutual labels:  eslint, linter
Eslint Plugin Markdown
Lint JavaScript code blocks in Markdown documents
Stars: ✭ 242 (-71.16%)
Mutual labels:  eslint, linter
awesome-react-app
Always the latest version of "create-react-app" with awesome configurations (lint, commit lint, husk, editor config, etc)
Stars: ✭ 44 (-94.76%)
Mutual labels:  eslint, linter
Poetic
Automatically install and maintain ESLint, Prettier, EditorConfig and Airbnb rules for JavaScript, TypeScript and React.
Stars: ✭ 165 (-80.33%)
Mutual labels:  eslint, linter
Eslint Config Standard
ESLint Config for JavaScript Standard Style
Stars: ✭ 2,229 (+165.67%)
Mutual labels:  eslint, linter
Eslint
Find and fix problems in your JavaScript code.
Stars: ✭ 19,665 (+2243.86%)
Mutual labels:  eslint, linter
Esprint
Fast eslint runner
Stars: ✭ 556 (-33.73%)
Mutual labels:  eslint, linter

SublimeLinter-eslint

This linter plugin for SublimeLinter provides an interface to ESLint. It will be used with "JavaScript" files, but since eslint is pluggable, it can actually lint a variety of other files as well.

Installation

SublimeLinter 3 must be installed in order to use this plugin.

Please install via Package Control.

Before using this plugin, ensure that eslint is installed on your system. To install eslint, do the following:

  • Install Node.js (and npm on Linux).

  • Install eslint globally by typing the following in a terminal:

npm install -g eslint
  • Or install eslint locally in your project folder (you must have a package.json file there):
npm install -D eslint

Using eslint with plugins (e.g. vue)

SublimeLinter will detect some installed local plugins, and thus it should work automatically for e.g. .vue or .ts files. If it works on the command line, there is a chance it works in Sublime without further ado.

  • Make sure the plugins are installed locally colocated to eslint itself. T.i., technically, both eslint and its plugins are described in the very same package.json.
  • Configuration of the plugins is out-of-scope of this README. Be sure to read their README's as well. (If you just installed a plugin, without proper configuration, eslint will probably show error messages or wrong lint results, and SublimeLinter will just pass them to you.)

Out-of-the-box SublimeLinter detects typescript, vue, svelte, html, and json. Please open a PR for important other plugins. Note, however, that when you configure the exectuable manually, you also opt-out of the automatic plugin detection and fallback to linting "Javscript" only.

In any case, if you want to control which files SublimeLinter sends to eslint, you can always manually change the "selector" setting to just include the scopes you explicitly want. The default value for "JavaScript" is source.js - meta.attribute-with-value, make sure to include that in the configuration.

Examples

For Typescript .ts files it would be:

"linters": {
    "eslint": {
        "selector": "source.ts, source.js - meta.attribute-with-value"
    }
}

For Vue.js .vue files it would be:

"linters": {
    "eslint": {
        "selector": "text.html.vue, source.js - meta.attribute-with-value"
    }
}

For Svelte .svelte files, using eslint-plugin-svelte3 and the Naomi syntax highlighter set to HTML 5, it would be:

"linters": {
    "eslint": {
        "selector": "text.html, source.js - meta.attribute-with-value"
    }
}

To find the selector value for a particular file type, place the cursor at the start of the file and use the command Tools ➡️ Developer ➡️ Show Scope Name.

Settings

You can configure eslint options in the way you would from the command line, with .eslintrc files. For more information, see the eslint docs.

FAQ and Troubleshooting

eslint doesn't lint my HTML files anymore.

Starting with v4.2 of this plugin, eslint will only lint '*.js' files for standard, vanilla configurations without further plugins. You can restore the old behavior by setting selector to its old value:

"linters": {
    "eslint": {
        "selector": "source.js - meta.attribute-with-value"
    }
}

I've got 'SublimeLinter: ERROR: eslint cannot locate 'eslint' in ST console when I try to use locally installed eslint.

You must have a package.json file if you've installed eslint locally. Also, restart the project or Sublime Text itself after to make sure SublimeLinter uses the correct eslint instance.

npm init -f
npm install eslint

I've got 'SublimeLinter: eslint ERROR: ESLint couldn't find a configuration file' when I'm editing a JavaScript file.

If you're using SublimeLinter 4, the linter is trying to always lint the current view, even if there's no ESLint setup for the project or file. You can easily fix this error by creating an empty .eslintrc file in your home directory. This file will be picked up by the linter when there is no locally-defined ESLint configuration.

Use your editor of choice and create this config file, or do this on a terminal:

cd $HOME # or cd %HOMEPATH% on Windows
touch .eslintrc
echo '{ "rules": {} }' > .eslintrc
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].