Город МОСКОВСКИЙ
00:03:51

How to install SublimeLinter and JSHint in Sublime Text

Аватар
Погружение в мир React
Просмотры:
35
Дата загрузки:
28.11.2023 10:14
Длительность:
00:03:51
Категория:
Лайфхаки

Описание

In this short video you will learn how to add SublimeLinter and JSHint to the extremely popular Sublime Text editor.

BLOG POST:
http://joellongie.com/add-sublimelinter-jshint-sublime-text/

Subscribe and Get More Great Tips!
http://www.youtube.com/subscription_center?add_user=joellongie

Check me out around the web:
----------------------------------------­--------------------

Blog: http://joellongie.com
Twitter: https://twitter.com/joellongie
Google+: https://plus.google.com/+joellongie

----------------------------------------­--------------------


Description
----------------------------------------­--------------------

One of the tools essential for enforcing good JavaScript code habits is JSHint. JSHint is a forked version of JSLint originally created by Douglas Crockford. As Crockford once said at a Google Tech Talk that JSLint “will hurt your feelings”. Where JSHint varies from JSLint is that it is both community supported and allows for customizations and disabling features. It can be configured to be slightly less picky when evaluating your code.

Setting up JSHint in Sublime Text is simple but does require a few steps.

1. Installing Sublime Text Package Manager

Chances are if you have been using Sublime Text for any amount of time you are already familiar with the Package Manager. If not head on over to packagecontrol.io and follow the simple instructions for installing it in your particular version of Sublime Text.

2. Installing SublimeLinter 3

SublimeLinter is a plugin for Sublime Text that provides linters for various programming languages including Python, JavaScript, CSS, and Ruby. A linter is basically a plugin within your code editor that notifies you of stylistic or programming errors. If you read the documentation it states that “SublimeLinter itself is only a framework for linters. The linters are distributed as independent Sublime Text 3 plugins.”

To install this package in Sublime Text use the shortcut "Command+Shift+P" to open the “Command Palette” and type in "Package Control:Install Package". Next type in "SublimeLinter" and click to install.

3. Installing SublimeLinter-Jshint

Now that the framework is installed you will need to install the specific linter you are interested in. In this example we will be using JSHint. Again open the Command Palette and install the package "SublimeLinter-jshint".

4. Installing Node.Js And SublimeLinter-Jshint

SublimeLinter-jshint requires Node.js. Installing Node is extremely easy, just head over to nodejs.org/download/ and download the pre-built installer for your OS.

Once that is done your last step is to fire up your trusty terminal and enter:


npm install -g jshint
// sudo npm install -g jshint (if you have permission issues)

That’s it! You are now free to be harassed by your linter of choice.

Рекомендуемые видео