Linter
Lint your code with ease in Atom.
The idea is to stop the linter plugins war, by providing a top level API for linters to parse and display errors in the Atom editor.
Available linters
for JavaScript
- linter-jshint, for JavaScript and JSON, using
jshint
- linter-jscs, for JavaScript, using
jscs
- linter-jsxhint, for JSX (React.js), using
jsxhint
- linter-eslint, for JavaScript, using
eslint
- linter-gjslint, for JavaScript, using
gjslint
- linter-flow, for JavaScript, using
flow
for CoffeeScript
- linter-coffeelint, for CoffeeScript, using
coffeelint
for Typescript
- linter-tslint, for Typescript, using
tslint
for Dart
- linter-dartanalyzer, for Dart using
dartanalyzer
for LiveScript
- linter-lsc, for LiveScript, using
lsc -a
for Ruby and Ruby on Rails
- linter-rubocop, for Ruby and Ruby on Rails, using
rubocop
- linter-ruby, for Ruby, using
ruby -wc
- linter-erb, for .erb files, using
erb -x
- linter-haml, for .haml files, using
haml-lint
for PHP
- linter-php, for PHP using
php -l
- linter-phpcs, for PHP, using
phpc
- linter-phpmd, for PHP, using
phpmd
for Python
- linter-pylint, for Python, using
pylint
- linter-pyflakes, for Python, using
pyflakes
- linter-pep8, for Python, using
pep8
. - linter-pep257, for Python, using
pep257
- linter-flake8, for Python, using
flake8
- linter-pylama, for Python, using
pylama
for Java
- linter-javac, for Java, using
javac
for CSS / SASS / SCSS / LESS
- linter-scss-lint, for SASS/SCSS, using
scss-lint
- linter-less, for LESS, using
less
- linter-csslint, for CSS, using
csslint
for XML
- linter-xmllint, for XML, using
xmllint
for Bash
- linter-shellcheck, for Bash, using
shellcheck
for Scala
- linter-scalac, for Scala, using
scalac
for C / C++
- linter-clang, for C / C++, using
clang
- linter-cpplint, for C++, using
cpplint
for Lua
- linter-lua, for Lua, using
luac -p
- linter-luacheck for Lua, using
luacheck
for Clojure
- linter-clojure, for Clojure, using
clojure
for Puppet
- linter-puppet-lint, for Puppet, using
puppet-lint
for Yaml
- linter-js-yaml, for Yaml, using
js-yaml
for Haskell
- linter-hlint, for Haskell files, using
hlint
for HTML / Bootstrap
- linter-bootlint, for Bootstrap HTML, using
bootlint
- linter-tidy, for HTML, using
tidy
- linter-htmlhint, for html, using
htmlhint
for Squirrel
- linter-squirrel, for squirrel, using
squirrel-compiler
for CoDScript
- linter-codscriptizer, for CoDScript, using
codscriptizer -l
for harbour
- linter-harbour, for Harbour, using
harbour
for Rust
- linter-rust, for Rust, using
rustc
for Elixir
- linter-elixirc, for Elixir, using
elixirc
for Erlang
- linter-erlc, for Erlang, using
erlc
for ActionScript/Flash/Flex/AIR
- linter-flexpmd,for ActionScript/Flash/Flex/AIR, using flexpmd
Features
- Lint on edit – Instant error reporting for you! (And it's fast!)
- Modular – You install only the linters you need.
- Active – New linters are out every week.
Installation
$ apm install linter
– Install the main package.$ apm install linter-jshint
– Install the linter you need, herejshint
.
Configuration
- Lint on save [On / Off] - Lint the file when you save it
- Lint on change [On / Off] - Lint the file as you type
- Show highlighting [On / Off] - Highlight the range of wrong code
- Show gutters: [On / Off] - Show dot in the gutter on line error
- Show messages around cursor [On / Off] - Show error description in the status bar
- Show status bar when cursor is in error range [On / Off] - Either show status bar when the cursor is on the error line, or show it when the cursor is focus the range of wrong code
- Show error inline [On / Off] - Shows the error or warning message next to the code as opposed to in the status bar.
- Lint on change interval [in ms] - Interval between two lints while you are writing code
Common errors
npm ERR! code ENOGIT
- You need to install git before installing linter. See #114.env: node: No such file or directory
– There's a problem with your node path – check this.spawn ENOENT
orspawn ENOTDIR
- A linter can't find a path to the executable. Try starting Atom from a shell viaatom
to make sure it gets yourPATH
. See also #102, #150.
Documentation
http://atomlinter.github.io/Linter/
Coming soon
- linter-pep257, for python, using
pep257
. - linter-rst, for reStructuredText, using
docutils
. - linter-phplint, for PHP, using
phplint
. - linter-jsl, for JavaScript, using
jsl
. - linter-oclitnt, for C / C++ / Objective-C, using
OCLint
.
Contributing
If you're going to submit a pull request, please try to follow the official contribution guidelines of Atom.
You need nodejs
and grunt-cli
installed before contributing.
Run bower install node
then npm install -g grunt-cli
.
Also, run $ grunt dev
before any submission and while developing, it will achieves severals tasks:
- Compile and lint the CoffeeScript files
- Lint the stylesheets
- Lint any trailing spaces and ensure new line at end of file
You can generate the doc with $ grunt doc
, it will open in your default browser.
Donation
Donate Bitcoins<script src="https://www.coinbase.com/assets/button.js" type="text/javascript"></script>