Code Monkey home page Code Monkey logo

linter-jshint's Introduction

linter-jshint

This plugin for linter provides an interface to JSHint. It will lint JavaScript in files with the .js extension and optionally inside <script> blocks in HTML or PHP files.

Installation

The Linter package must be installed in order to use this plugin. If it isn't installed, please follow the instructions here.

Plugin installation

$ apm install linter-jshint

Settings

You can configure linter-jshint by editing ~/.atom/config.cson (choose Open Your Config in Atom menu):

'linter-jshint':
  # Path of the `jshint` executable
  executablePath: '/path/to/bundled/jshint'

  # Lint JavaScript inside `<script>` blocks in HTML or PHP files
  lintInlineJavaScript: false

  # Disable linter when no `.jshintrc` is found in project
  disableWhenNoJshintrcFileInPath: false

Contributing

If you would like to contribute enhancements or fixes, please do the following:

  1. Fork the plugin repository
  2. Hack on a separate topic branch created from the latest master
  3. Commit and push the topic branch
  4. Make a pull request
  5. Welcome to the club ๐Ÿ˜Ž

Please note that modifications should follow these coding guidelines:

  • Indent of 2 spaces
  • Code should pass CoffeeLint with the provided coffeelint.json
  • Vertical whitespace helps readability, don't be afraid to use it

Thank you for helping out!

linter-jshint's People

Contributors

arcanemagus avatar asaayers avatar camlafit avatar caseywebb avatar chrishiestand avatar defeated avatar dmnd avatar erikdonohoo avatar fank avatar floatdrop avatar greenkeeper[bot] avatar greenkeeperio-bot avatar hd-deman avatar hswolff avatar iam4x avatar jacobmllr95 avatar jhalickman avatar keplersj avatar kevinsawicki avatar kitch avatar mattsherman avatar maxcnunes avatar pborreli avatar postcasio avatar renovate-bot avatar rmzelle avatar rugk avatar semantic-release-bot avatar steelbrain avatar stephanebachelier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linter-jshint's Issues

Package.getActivationCommands is deprecated.

Use activationCommands instead of activationEvents in your package.json
Commands should be grouped by selector as follows:

  "activationCommands": {
    "atom-workspace": ["foo:bar", "foo:baz"],
    "atom-text-editor": ["foo:quux"]
  }
Package.getActivationCommands (C:\Users\tarantinom\AppData\Local\atom\app-0.196.0\resources\app.asar\src\package.js:790:9)
Package.hasActivationCommands (C:\Users\tarantinom\AppData\Local\atom\app-0.196.0\resources\app.asar\src\package.js:715:20)
<unknown> (C:\Users\tarantinom\AppData\Local\atom\app-0.196.0\resources\app.asar\src\package.js:169:24)
Package.measure (C:\Users\tarantinom\AppData\Local\atom\app-0.196.0\resources\app.asar\src\package.js:147:15)

Bad Options

I am getting the following two "errors" on the first line of every javascript file. My friend who is also running Atom is not having this issue. We are using the exact same .jshintrc file.

  • [jshint] Bad option: 'nocomma'. (E001)
  • [jshint] Bad option: 'singleGroups'. (E001)

File: .jshintrc

{
  "globals": {
    "angular": false,
    "Bugsnag": false,
    "google": false,
    "moment": false,
    "JSEncrypt": false,
    "_": false,
    "utilities": false,
    "tv4": false,

    "document": false,
    "window": false,

    "inject": false,
    "module": false,
    "xdescribe": false,
    "xit": false,

    "protractor": false,
    "element": false,
    "browser" : false,
    "by": false,
    "webdriver": false
  },

  "bitwise": true,
  "camelcase": true,
  "curly": true,
  "enforceall": false,
  "eqeqeq": true,
  "es3": false,
  "forin": true,
  "freeze": true,
  "funcscope": false,
  "globalstrict": false,
  "immed": true,
  "indent": 2,
  "iterator": false,
  "latedef": true,
  "maxcomplexity": 100,
  "maxdepth": 10,
  "maxerr": 50,
  "maxlen": 120,
  "maxparams": 20,
  "maxstatements": 100,
  "newcap": true,
  "noarg": true,
  "nocomma": false,
  "noempty": false,
  "nonbsp": true,
  "nonew": true,
  "notypeof": false,
  "quotmark": false,
  "shadow": false,
  "singleGroups": true,
  "undef": true,
  "unused": true,

  "asi": false,
  "boss": false,
  "debug": false,
  "eqnull": false,
  "esnext": false,
  "evil": false,
  "expr": false,
  "lastsemic": false,
  "laxbreak": false,
  "laxcomma": false,
  "loopfunc": false,
  "moz": false,
  "multistr": false,
  "noyield": false,
  "phantom": true,
  "plusplus": false,
  "proto": false,
  "scripturl": false,
  "strict": true,
  "sub": false,
  "supernew": false,
  "validthis": false,
  "withstmt": false,

  "devel" : true,
  "jasmine" : true
}

'Disable when no .jshintrc file found in path' is broken

Since some projects use JSHint and other ESLint, I end up needing to turn them on and off all the time so they won't bother me.

Having an option that will only run linter-jshint when the .jshintrc file is found would fix this.

Linter-jshint not working in windows

after official windows version atom is released,

i tried the linter-jshint in windows. it doesn't work.
i did a little debug , i find that linter-jshint treat jshint as nodeexecutble yes , but
the BufferedNodeProcess is not working in windows.

my work around is that set the jshint executable path including jshint.cmd , change the linter-jshint nodexecutable to no.

TypeError: undefined is not a function at new LinterJshint (/home/mrtemp/.atom/packages/linter-jshint/lib/linter-jshint.coffee:28:5)

linter not working and getting this error in console.

/usr/share/atom/resources/app/src/package.js:230 Failed to activate package named 'linter' TypeError: undefined is not a function
  at LinterJshint.Linter (/home/mrtemp/.atom/packages/linter/lib/linter.coffee:54:33)
  at new LinterJshint (/home/mrtemp/.atom/packages/linter-jshint/lib/linter-jshint.coffee:28:5)
  at LinterView.initLinters (/home/mrtemp/.atom/packages/linter/lib/linter-view.coffee:51:27)
  at new LinterView (/home/mrtemp/.atom/packages/linter/lib/linter-view.coffee:33:6)
  at /home/mrtemp/.atom/packages/linter/lib/init.coffee:83:24
  at Workspace.module.exports.Workspace.observeTextEditors (/usr/share/atom/resources/app/src/workspace.js:268:9)
  at LinterInitializer.activate (/home/mrtemp/.atom/packages/linter/lib/init.coffee:80:39)
  at Package.module.exports.Package.activateNow (/usr/share/atom/resources/app/src/package.js:225:27)
  at /usr/share/atom/resources/app/src/package.js:211:28
  at Package.module.exports.Package.measure (/usr/share/atom/resources/app/src/package.js:157:15)
  at Package.module.exports.Package.activate (/usr/share/atom/resources/app/src/package.js:205:14)
  at PackageManager.module.exports.PackageManager.activatePackage (/usr/share/atom/resources/app/src/package-manager.js:410:21)
  at /usr/share/atom/resources/app/src/package-manager.js:397:33
  at Config.module.exports.Config.transact (/usr/share/atom/resources/app/src/config.js:342:16)
  at PackageManager.module.exports.PackageManager.activatePackages (/usr/share/atom/resources/app/src/package-manager.js:391:19)
  at PackageManager.module.exports.PackageManager.activate (/usr/share/atom/resources/app/src/package-manager.js:380:19)
  at Atom.module.exports.Atom.startEditorWindow (/usr/share/atom/resources/app/src/atom.js:605:21)
  at Object.<anonymous> (/usr/share/atom/resources/app/src/window-bootstrap.js:12:8)
  at Object.<anonymous> (/usr/share/atom/resources/app/src/window-bootstrap.js:23:4)
  at Module._compile (module.js:468:26)
  at Object.Module._extensions..js (module.js:486:10)
  at Module.load (/usr/share/atom/resources/app/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:318:12)
  at Module.require (module.js:373:17)
  at require (module.js:392:17)
  at window.onload (file:///usr/share/atom/resources/app/static/index.js:59:25)

Escape JSHint Messages in Editor

If HTML is present in the error message displayed on the bottom bar, it is parsed and rendered. The strings from the user's editor should be escaped.

For example, paste the following into a Javascript file:

("test".test('')"<img src='http://i.imgur.com/DKxfHXy.gif'></img>");

Unescaped HTML

Running on *.jsx pages

When I open my *.jsx files (react), atom linter-jshint is being run on the page. At first I thought this was a problem with my .jshintrc setup but when I run jshint directly it ignores those files. Hence, I'm guessing its a problem with linter-jshint - maybe its looking for a contains *.js pattern rather than ends with. Any thoughts?

Changelog

It would be great to have a changelog.md which tells users what updates contain API changes, bug fixes, performance changes, etc.

JSHint Not Installed

Looks like JSHint is not installing:

/Users/xxxx/.atom/packages/linter-jshint/node_modules/.bin/jshint --verbose --extract=auto /var/folders/0j/vh9ytqp92fl4jgpwqv7q3x6w000101/T/11446-66674-181kcpnsource.js linter.coffee:41
env: node: No such file or directory

When I entered /Users/xxxx/.atom/packages/linter-jshint/node_modules/.bin/jshint into my terminal, it came back with the same error.

Uncaught TypeError: undefined is not a function

[Enter steps to reproduce below:]

  1. It just started to appear after update to version 0.194. It appears it triggers when switching to other tabs but it doesn't happens every time.

Atom Version: 0.194.0 โš ๏ธ in 1.0 API Preview Mode โš ๏ธ
System: Mac OS X 10.9.5
Thrown From: linter-jshint package, v0.1.2

Stack Trace

Uncaught TypeError: undefined is not a function

At /Users/rmontoya/.atom/packages/linter-jshint/lib/linter-jshint.coffee:52

TypeError: undefined is not a function
  at LinterJshint.destroy (/Users/rmontoya/.atom/packages/linter-jshint/lib/linter-jshint.coffee:52:17)
  at LinterView.remove (/Users/rmontoya/.atom/packages/linter/lib/linter-view.coffee:252:7)
  at /Users/rmontoya/.atom/packages/linter/lib/linter-view.coffee:124:8
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at TextEditor.module.exports.TextEditor.destroyed (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:279:27)
  at TextEditor.module.exports.Model.destroy (/Applications/Atom.app/Contents/Resources/app.asar/src/model.js:45:58)
  at Pane.module.exports.Pane.destroyItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:444:18)
  at HTMLDivElement.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/tabs/lib/tab-bar-view.js:179:22)
  at space-pen-ul.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4430:9)
  at space-pen-ul.elemData.handle (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4116:28)

Commands

     -8:02.4.0 editor:newline (atom-text-editor.editor)
     -8:01.9.0 emmet:insert-formatted-line-break-only (atom-text-editor.editor)
     -8:01.9.0 editor:newline (atom-text-editor.editor)
  8x -7:55.5.0 core:backspace (atom-text-editor.editor)
     -7:50.1.0 emmet:insert-formatted-line-break-only (atom-text-editor.editor)
     -7:50.1.0 editor:newline (atom-text-editor.editor)
     -7:49.8.0 emmet:insert-formatted-line-break-only (atom-text-editor.editor)
     -7:49.8.0 editor:newline (atom-text-editor.editor)
     -7:44.4.0 core:move-up (atom-text-editor.editor)
  2x -7:27.5.0 core:move-right (atom-text-editor.editor)
  2x -7:19.8.0 core:move-down (atom-text-editor.editor)
     -7:18.8.0 snippets:next-tab-stop (atom-text-editor.editor)
     -7:18.8.0 snippets:expand (atom-text-editor.editor)
     -7:18.7.0 editor:indent (atom-text-editor.editor)
  2x -7:07.9.0 core:move-right (atom-text-editor.editor)
     -6:59.6.0 core:save (atom-text-editor.editor)

Config

{
  "core": {
    "ignoredNames": [
      ".git",
      ".DS_Store",
      "app",
      "cache",
      "img"
    ],
    "disabledPackages": [
      "atom-jshint",
      "jshint",
      "js-refactor",
      "refactor"
    ],
    "themes": [
      "seti-ui",
      "seti-syntax"
    ]
  },
  "linter-jshint": {
    "jshintExecutablePath": "/usr/local/bin/jshint"
  }
}

Installed Packages

# User
atom-beautify, v0.24.1
block-comment, v0.4.1
emmet, v2.3.8
git-tab-status, v1.7.0
jsdoc, v0.9.0
linter, v0.12.1
linter-jshint, v0.1.2
project-manager, v1.15.5
save-session, v0.14.0
seti-syntax, v0.3.3
seti-ui, v0.6.3
turbo-javascript, v0.0.8

# Dev
No dev packages

Add code in message to help developer

jshint is powerful enough to disable some validation when it finds a special comment.

As I am kind of lazy, or in other words I don't like losing my time to find the custom jshint code to add the correct comments, I want the code W098 for example to be added to the message which is really helpful. I don't say that you should always use the special comments, the .jshintrc file is the way to go. But sometimes it's needed because you may not have full control, or you need to respect some API. bla bla bla

FYI, the jshint codes are available here:
https://github.com/jshint/jshint/blob/master/src/messages.js

Because I really want this, here what I've done:

  • on #26 to render the info message not as an error
  • forked AtomLinter/Linter to add a @formatMessage
  • create a new branch on my fork of AtomLinter/linter-jshint to implement the new @formatMessage

Hope you will accept these contributions :)

Package.activateConfig is deprecated.

Hi, please help me to fix this issue.
Thanks.

Use a config schema instead. See the configuration section
of https://atom.io/docs/latest/hacking-atom-package-word-count and
https://atom.io/docs/api/latest/Config for more details

Package.activateConfig (/usr/share/atom/resources/app.asar/src/package.js:267:11)
Package.activateNow (/usr/share/atom/resources/app.asar/src/package.js:238:14)
<unknown> (/usr/share/atom/resources/app.asar/src/package.js:223:30)
Package.measure (/usr/share/atom/resources/app.asar/src/package.js:167:15)

Config.unobserve is deprecated.

Config::unobserve no longer does anything. Call .dispose() on the object returned by Config::observe instead.

Config.unobserve (C:\Users\producao\AppData\Local\atom\app-0.190.0\resources\app\src\config.js:1047:19)
LinterJshint.destroy (C:\Users\producao\.atom\packages\linter-jshint\lib\linter-jshint.coffee:52:16)

Add option for syntax types

I'm running into an issue with this package where my Handlebars templates are being linted via JSHint which causes an error on the {{...}} Handlebars syntax.

This appears to be related to the fact that both this package and the Atom Handlebars package use the same text.html.basic scope. Or that JSHint isn't scoping its search to checking inside of <script> elements of a certain type.

In any way, could an option to give control over the set of syntax types this package operates on?

Package.getActivationCommands is deprecated.

Use activationCommands instead of activationEvents in your package.json
Commands should be grouped by selector as follows:

  "activationCommands": {
    "atom-workspace": ["foo:bar", "foo:baz"],
    "atom-text-editor": ["foo:quux"]
  }
Package.getActivationCommands (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:790:9)
Package.hasActivationCommands (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:715:20)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:169:24)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:147:15)

Add Support for Extended .jshintrc Files

I have two .jshintrc files. One in the root of the project, the other in a test directory which simply adds mocha globals. When using jshint from the command line, the test folder passing jshint with no errors. But in Atom, linter-jshint does not respect the values in the extended file and displays errors.

/.jshintrc
{
"esnext": true,
"camelcase": true,
"curly": true,
"globalstrict": true,
"strict": true,
"node": true
}

/src/test/.jshintrc
{
"extends": "../../.jshintrc",
"mocha": true
}

Look for config in package.json

JSHint supports a jshintConfig key in package.json but linter-jshint doesn't. I tried to figure out how to get this to work but because the linted file seems to be in a tmp directory without the package.json file JSHint won't automatically pick it up. Unfortunately you can't pass that file in the form of a flag.

Does anyone have suggestions on how to add this functionality?

Problem with Chocolatey

I installed Atom on Windows via Chocolatey.
The following file could not be found.

file:///C:/ProgramData/chocolatey/lib/Atom.0.113.0/tools/Atom/resources/app/static/c:/Users//.atom/packages/linter-jsonlint/lib/init.coffee

Expose jshint options

It would be nice to expose some jshint options. For example, it would be nice for linter-jshint to not warn on multiline strings.

JSHint breaks Emmet in HTML files

I admit I don't understand why JSHint looks at lines of HTML, but it does. And with JSHint enabled, some Emmet expansions don't run, e.g. "html:5" followed by tap on tab in a fresh HTML file does nothing (obvious).

Facts:

  • OS X
  • Atom .17
  • Current linter package
  • Current linter-jshint package
  • default path to jshint
  • no other config of jshint

Thank you.

Interference with linter-pep257

I was never able to use linter-jshint till I found linter-pep257 interferes with it. I know (at least I believe) that linter-pep257 is just so far a template and I installed it to be aware of the future updates. I had to disable it to make linter-jshint displaying something.

I opened an issue here because I can imagine that other linter-pkg might interfere the same way. If it is more suitable, I can reopen this issue in the linter bugtracker.

Config.unobserve is deprecated.

Config::unobserve no longer does anything. Call .dispose() on the object returned by Config::observe instead.

Config.unobserve (/usr/local/share/atom/resources/app/src/config.js:374:19)
LinterJshint.destroy (/home/stramel/.atom/packages/linter-jshint/lib/linter-jshint.coffee:52:16)

Atom: 0.189.0-edd46e4

Linter doesn't seem to respect jshintrc file

I installed the Linter plugin and tried 2 different jshint plugins. I'm confused because in both cases the error are listed as "jslint", but the bigger issue is that it flags a lot of errors that are not really errors.

For example, I have a Grunt-based project. I am using jshint as a Grunt tasks as well. When I first started using it, I got all sorts of "errors" about white space or "use the function form of use strict" etc. I looked up those errors and created a jshintrc file in the project root. Now the Grunt task does not flag any of these errors, but the Atom Linter does.

Package.activateConfig is deprecated.

Use a config schema instead. See the configuration section
of https://atom.io/docs/latest/hacking-atom-package-word-count and
https://atom.io/docs/api/latest/Config for more details

Package.activateConfig (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:247:11)
Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:218:14)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:203:30)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:147:15)

New release?

Can you get a release out with the new JSHint?

Uncaught TypeError: Arguments to path.join must be strings

I use Linter with Linter JSHint. Every time I start atom.io I get this error. Tried to reinstall atom, Linter and Linter JSHint โ€” no luck.

Atom Version: 0.163.0
System: Mac OS X 10.10.1
Thrown From: linter package, v0.9.0

Stack Trace

Uncaught TypeError: Arguments to path.join must be strings

At path.js:384

TypeError: Arguments to path.join must be strings
  at Object.exports.join (path.js:384:15)
  at LinterJshint.Linter.getNodeExecutablePath (/Users/seleckis/.atom/packages/linter/lib/linter.coffee:104:10)
  at LinterJshint.Linter.getCmdAndArgs (/Users/seleckis/.atom/packages/linter/lib/linter.coffee:80:25)
  at LinterJshint.Linter.lintFile (/Users/seleckis/.atom/packages/linter/lib/linter.coffee:112:24)
  at /Users/seleckis/.atom/packages/linter/lib/linter-view.coffee:138:18
  at Array.forEach (native)
  at /Users/seleckis/.atom/packages/linter/lib/linter-view.coffee:137:18
  at Object.oncomplete (fs.js:93:15)

Commands

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "deep-syntax"
    ],
    "disabledPackages": [
      "archive-view",
      "atom-jshint",
      "atom-lint",
      "autocomplete-plus",
      "autocomplete",
      "autocomplete-paths",
      "autocomplete-snippets",
      "autosave",
      "autoflow",
      "background-tips",
      "bookmarks",
      "color-picker",
      "deprecation-cop",
      "encoding-selector",
      "go-to-line",
      "language-c",
      "language-go",
      "language-java",
      "language-objective-c",
      "language-perl",
      "language-python",
      "language-ruby",
      "language-ruby-on-rails",
      "language-shellscript",
      "language-toml",
      "markdown-preview",
      "package-generator",
      "release-notes",
      "spell-check",
      "status-bar",
      "styleguide",
      "timecop",
      "welcome",
      "wrap-guide",
      "linter-jscs"
    ]
  },
  "linter": {
    "lintOnChange": false
  }
}

Installed Packages

# User
Atom-Syntax-highlighting-for-Sass, v0.5.0
Stylus, v0.4.0
build, v0.21.0
deep-syntax, v0.1.0
language-jade, v0.3.0
linter, v0.9.0
linter-jshint, v0.1.0
save-session, v0.11.1

# Dev

/cc @atom/core

Config.unobserve is deprecated.

Config::unobserve no longer does anything. Call .dispose() on the object returned by Config::observe instead.

Config.unobserve (/Applications/Atom.app/Contents/Resources/app/src/config.js:381:19)
LinterJshint.destroy (/Users/shadowsyntax/.atom/packages/linter-jshint/lib/linter-jshint.coffee:52:16)

Config.unobserve is deprecated.

Config::unobserve no longer does anything. Call .dispose() on the object returned by Config::observe instead.

Config.unobserve (C:\Users\pkatariy\AppData\Local\atom\app-0.189.0\resources\app\src\config.js:374:19)
LinterJshint.destroy (C:\Users\pkatariy\.atom\packages\linter-jshint\lib\linter-jshint.coffee:52:16)

Config.unobserve is deprecated.

Config::unobserve no longer does anything. Call .dispose() on the object returned by Config::observe instead.

Config.unobserve (/Applications/Atom.app/Contents/Resources/app/src/config.js:374:19)
LinterJshint.destroy (/Users/ashrayjain/.atom/packages/linter-jshint/lib/linter-jshint.coffee:52:16)

Respect JSHint Configrautions

According to JSHint docs, there are three ways to configure JSHint:

  1. Specify with --config option
  2. .jshintrc file under project hierarchy
  3. package.json file under project root

And, of course, JS file inline configuration. Something like this:

/* jshint undef: true, unused: true */
/* global MY_GLOBAL */

Regarding .jshintrc configuration file, notice this sentence:

In case of .jshintrc, JSHint will start looking for this file in the same directory as the file that's being linted. If not found, it will move one level up the directory tree all the way up to the filesystem root.

But, because AtomLinter save the atom content buffer to a temporary file, it will NOT respect the above rule. Besides, AtomLinter does not expose the --config option to the end-user.

Currently, the only way to configure JSHint is to add inline directives. Once the project contains many files, this is a nightmare.

Please consider to add support to respect the JSHint rules.

JSHint error is incorrect

if (xyz) {
    var config = {};
  } else {
    var config = {};
  }

Config isn't defined twice. It's either defined in the if, or the else, but it will never be defined twice...

screen shot 2014-07-24 at 11 12 51 am

Package.getActivationCommands is deprecated.

This deprecation message appears since Atom 0.189.0:

Use activationCommands instead of activationEvents in your package.json
Commands should be grouped by selector as follows:

  "activationCommands": {
    "atom-workspace": ["foo:bar", "foo:baz"],
    "atom-text-editor": ["foo:quux"]
  }
Package.getActivationCommands (D:\Programme\Dokumente\Atom\resources\app\src\package.js:764:9)
Package.hasActivationCommands (D:\Programme\Dokumente\Atom\resources\app\src\package.js:689:20)

Add file references to identify global variables and functions

I found that there are a lot of questions on this topic so I was surprised not to find the question here:

If I code in multiple files, I would need to add all global variables and function used between the files in the config file. This adds an extra mode of failure, since the names need to be maintained in two places.

Visual studio uses file reference/// . Something similar would make it more useful.

This isn't a bug... it's a thank you.

For some reason I didn't think this plugin allowed linting inline JavaScript in html files. I've been separating out all my JavaScript for my Polymer custom elements into their own js files. Today I was forced to put the javascript back into their respective html files because of a limitation in Polymer's documentation generation engine and wooohoo all the lights came on. You should have seen the expression on my face lol. A most marvelous asset and huge thank you. Most excellent!

Package.getActivationCommands is deprecated.

Use activationCommands instead of activationEvents in your package.json
Commands should be grouped by selector as follows:

  "activationCommands": {
    "atom-workspace": ["foo:bar", "foo:baz"],
    "atom-text-editor": ["foo:quux"]
  }
Package.getActivationCommands (/usr/local/share/atom/resources/app.asar/src/package.js:790:9)
Package.hasActivationCommands (/usr/local/share/atom/resources/app.asar/src/package.js:715:20)
<unknown> (/usr/local/share/atom/resources/app.asar/src/package.js:169:24)
Package.measure (/usr/local/share/atom/resources/app.asar/src/package.js:147:15)

.jshintrc config file ignored

I have a project with a .jshintrc config file in the root folder but Linter ignores it and apply the default rules.

I did some tests and put a console log before the lintFile from Linter and the @cwd has the right folder:

 exec @getCmd(filePath), {cwd: @cwd}, (error, stdout, stderr) =>

It looks like jshint simply doesn't get it as the cwd actually.

Auto-Install JSHINT Dependency

As this requires the Node.js JSHINT package, this should be able to be auto-installed as a dependency in Atom (from what I have been reading). Any way to do this?

Error on jekyll-powered HTML files

The linter start to go nuts on the front-matter of html files from jekyll site:

---
layout: main

---
<div class="wrapper">
...
</div>

HTML gets parsed by linter-jshint / add option to only lint .js files

Issue
For some reason, my HTML documents also get parsed by linter-jshint, and I don't see any option to give some file type inclusions/exclusions to jshint. See also the screenshot below.

My HTML uses grunt-include-replace, the syntax of which linter-jshint seems to incorrectly flag as "wrong JavaScript".

What would solve this for me
Don't let HTML be parsed by linter-jshit, or give a settings possibility to include/exclude file types.

Screenshot
image

Technical details
Atom version 179
Windows 7

Same error 2x

screenshot 2014-05-31 19 31 19

I think the same error is presented twice. This is JavaScript that is being linted.

Config.unobserve is deprecated.

Config::unobserve no longer does anything. Call .dispose() on the object returned by Config::observe instead.

Config.unobserve (/opt/atom/resources/app.asar/src/config.js:1060:19)
LinterJshint.destroy (/home/vramana/.atom/packages/linter-jshint/lib/linter-jshint.coffee:52:16)
LinterView.remove (/home/vramana/.atom/packages/linter/lib/linter-view.coffee:252:6)
<unknown> (/home/vramana/.atom/packages/linter/lib/linter-view.coffee:124:7)

Getting started

I feel like this is a stupid question, but how do I get this to start working? I have a JS file open, both linter-jshint and linter installed (with my path to JSHint working), and I can't figure out how to get it to do anything. Where do I start? Thanks!

Package.activateConfig is deprecated.

atom -v 0.196.0
Use a config schema instead. See the configuration section
of https://atom.io/docs/latest/hacking-atom-package-word-count and
https://atom.io/docs/api/latest/Config for more details

Package.activateConfig (D:\GreenSoft\Atom\resources\app.asar\src\package.js:247:11)
Package.activateNow (D:\GreenSoft\Atom\resources\app.asar\src\package.js:218:14)
<unknown> (D:\GreenSoft\Atom\resources\app.asar\src\package.js:203:30)
Package.measure (D:\GreenSoft\Atom\resources\app.asar\src\package.js:147:15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.