Unlimited Plugins, WordPress themes, videos & courses! Unlimited asset downloads! From $16.50/m
by
FREELessons:34Length:2.5 hours

Next lesson playing in 5 seconds

Cancel
  • Overview
  • Transcript

4.7 Sublime Linter

Within our sample directory, I have created a new script.js file. And what would be nice is, if I create this syntax error, right now, by default in Sublime, it's not gonna let me know. So if I say var name equals jeff, var age equals 27. Notice I have forgotten the semicolons, but I don't get any feedback. So, we're going to install the Sublime Lint plugin that will let me know when I screw up like that. Shift+Cmd+P, install. And I'm gonna look for Lint. There we go. SublimeLinter's the one we want. So we run that. That's now been installed. And you can see it has built in support for copy script, Java, JavaScript, PHP, lots of stuff. So, let's try it out. Now, I'm going to save the file, and notice that this time it is active, and it's letting you know, hey, you made some mistakes here. So, we add the semicolon. That fixes that line. Here's var age. There's another line. So you can imagine how helpful this. Let's do a function. But we're gonna forget the closing curly brace, and we'll paste these two lines in like so. Now, we continue on, console.log name, and notice that it becomes active when I hit Save. And Cmd+S, and now it's letting you know there's an error. If I click on the line, and I look at the bottom of the screen, you'll see, hey, there's an Unmatched opening curly brace. So, we close it, hit Save again. And now, it's still happening. So, we click on it again, and it's saying hey, you forgot the function name. So, function person, and now it's working. And then, of course, if this was an instance of person, I would hit Cmd+D to select the vars, and change that to this.name and this.age. And new Person, but I digress. So, this will, of course, work for your JavaScript. It's gonna work for your PHP. It'll work for a lot of things. And if you want to disable Lint at some point, you can do that from the command pallet. So if I look for Lint, you can see that there is the option to Disable Linting, if you don't want it for a particular project.

Back to the top