iWarrior
iWarrior

Reputation: 195

Atom JSHint for JavaScript inside HTML

I just started using Atom. I installed linter-jshint and jshint

After setting the jshint executable path. I had jshint working on JavaScript files. However, after several hours I still cannot get it to work with JavaScript in HTML files. I looked in package.json and the docs but did not find something that works.

I saw that there is a flag --extract=[auto|always|never]. But I am not sure how to use it in Atom.

Upvotes: 1

Views: 797

Answers (3)

Soheel
Soheel

Reputation: 1

You can get inline linting to work by adding the following to the scopes (in the settings window inside Atom for Linter Jshint): source.js.embedded.html.

You also need to have the option "Lint Inline Java Script" switched on.

Upvotes: 0

David Douglas
David Douglas

Reputation: 10503

As suggested add the lintInlineJavaScript jshint setting to Atom config.cson

"linter-jshint": executablePath: "~/.atom/packages/atom-jshint" lintInlineJavaScript: true disableWhenNoJshintrcFileInPath: false

(^ so it now should now lint <script> inside *.html file but something is wrong as I can only get it to work with *.js files)

Upvotes: 0

Steel Brain
Steel Brain

Reputation: 4461

linter-jshint package has a lintInlineJavaScript configuration that you can enable to make it lint html files.

You can find more about its configuration in its GitHub README.

Upvotes: 2

Related Questions