Giter Site home page Giter Site logo

ricardofbarros / linter-js-standard Goto Github PK

View Code? Open in Web Editor NEW
99.0 99.0 56.0 998 KB

Atom linter plugin for JavaScript, using JavaScript Standard Style

Home Page: https://atom.io/packages/linter-js-standard

License: MIT License

JavaScript 100.00%
atom linter semistandard standard

linter-js-standard's People

Contributors

abraxxa avatar alecrust avatar arcanemagus avatar chee avatar chibicode avatar danielbayerlein avatar despairblue avatar developit avatar fannarsh avatar idan avatar internalfx avatar j-f1 avatar jgantunes avatar jiasm avatar jonaswindey avatar kayleepop avatar matthieu-beteille avatar nikmartin avatar nopnop avatar olizilla avatar ricardofbarros avatar rostislav-simonik avatar saschagehlich avatar seniorquico avatar sonicdoe avatar steelbrain avatar thore3 avatar thtliife avatar timdp 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

linter-js-standard's Issues

Something went wrong internally.

This linter also lints markdown files containing fenced code block with javascript.

This call returns nothing for markdown files.

This thus leads to a lot of warnings πŸ˜ƒ

Something went wrong internally.
No sweat, just re-open this file and this annoying warning shouldn't appear anymore

`"$" is undefined ` errors when using JQuery

Hey all - noob questions that I couldn't find an answer for.

  1. I'm getting multiple "$" is undefined errors from the linter when entering standard JQuery code. Do I have to add $ to the "ignored list", or is there better integration with JQuery that I'm missing to avoid these errors?

  2. I found out how to stop the errors in each file with /* global $ */. But how do I find the file package.json to ignore $ permanently? And is permanently ignoring $ a wise move?

Thanks,
Chris
screen shot 2015-10-21 at 17 20 53

LinterJsStandard.Linter is deprecated.

AtomLinter v0.X.Y API has been deprecated. Please refer to the Linter docs to update and the latest API: https://github.com/atom-community/linter/wiki/Migrating-to-the-new-API

LinterJsStandard.Linter (/Users/yuetsu/.atom/packages/linter/lib/linter.coffee:60:4)
new LinterJsStandard (/Users/yuetsu/.atom/packages/linter-js-standard/lib/linter-js-standard.coffee:32:4)
Object.lint (/Users/yuetsu/.atom/packages/linter/lib/legacy.coffee:61:21)
<unknown> (/Users/yuetsu/.atom/packages/linter/lib/editor-linter.coffee:69:25)
currentLinter (/Users/yuetsu/.atom/packages/linter/lib/editor-linter.coffee:68:19)
<unknown> (/Users/yuetsu/.atom/packages/linter/lib/editor-linter.coffee:82:22)

note, this is in addition to the other deprecation issue reported with Atom Editor v.1.0.2 and this third-party package.

best,

β€” faddah
portland, oregon, u.s.a.

Could you bump standard to the latest version (5.3.1) please?

Thanks!

Makes a difference:

// Standard 5.2.1 says this is all clean
// Standard 5.3.1 reports correctly 'Unexpected whitespace before semicolon'
for (var _y = moment().format('YYYY'); _y >= 1924 ; --_y) {
  su.yearOptions.push({year: _y, abbrev: _y})
}

"Uncaught TypeError: Cannot read property 'replace' of undefined" when attempting to close tab

Repro:

  1. Unknown (this happens once in a while, not systematically)
  2. Try closing a tab
  3. Observe the tab doesn't close and an error notification appears

Fix by triggering Window:reload and trying again

Atom Version: 1.0.19
System: Mac OS X 10.10.5
Thrown From: linter-js-standard package, v3.2.1

Stack Trace

Uncaught TypeError: Cannot read property 'replace' of undefined

At /Users/shawn/.atom/packages/linter-js-standard/lib/utils/style-settings.js:20

TypeError: Cannot read property 'replace' of undefined
  at Object.checkStyleSettings (/Users/shawn/.atom/packages/linter-js-standard/lib/utils/style-settings.js:20:34)
  at Object.module.exports.__cacheTextEditor (/Users/shawn/.atom/packages/linter-js-standard/lib/init.js:100:21)
  at storeSettings (/Users/shawn/.atom/packages/linter-js-standard/lib/init.js:63:14)
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/pane-container.js:320:34
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at Pane.module.exports.Pane.setActiveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:250:22)
  at Pane.module.exports.Pane.activateItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:314:21)
  at Pane.module.exports.Pane.activateItemAtIndex (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:308:19)
  at Pane.module.exports.Pane.activatePreviousItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:279:21)
  at Pane.module.exports.Pane.removeItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:396:16)
  at Pane.module.exports.Pane.destroyItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:466:16)
  at Pane.module.exports.Pane.destroyActiveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:443:12)
  at Workspace.module.exports.Workspace.destroyActivePaneItem (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:617:35)
  at Workspace.module.exports.Workspace.destroyActivePaneItemOrEmptyPane (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:656:21)
  at atom-workspace.atom.commands.add.core:close (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace-element.js:290:30)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:245:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:524:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:347:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:184:20)

Commands

  2x -3:17.2.0 core:backspace (atom-text-editor.editor.is-focused)
     -3:12.1.0 fuzzy-finder:toggle-file-finder (atom-text-editor.editor.is-focused)
     -3:10.5.0 command-palette:toggle (atom-text-editor.editor.mini.is-focused)
     -3:07.4.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
     -3:07.4.0 core:cancel (atom-text-editor.editor.mini.is-focused)
  2x -3:06.6.0 script:run (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-atom-light-syntax.theme-atom-light-ui)
     -2:56.1.0 grammar-selector:show (atom-text-editor.editor.is-focused)
     -2:54.3.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -2:52.9.0 script:run (atom-text-editor.editor.is-focused)
     -2:34.9.0 settings-view:open (atom-text-editor.editor.is-focused)
     -2:23.5.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:05.2.0 core:close (atom-text-editor.editor.mini.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-light-ui",
      "atom-light-syntax"
    ],
    "disabledPackages": [
      "welcome",
      "timecop",
      "symbols-view",
      "styleguide",
      "release-notes",
      "metrics",
      "bookmarks"
    ]
  },
  "linter-js-standard": {
    "honorStyleSettings": true
  }
}

Installed Packages

# User
atom-pair, v2.0.10
coffee-compile, v0.19.2
docs-snippets, v0.8.0
editorconfig, v1.2.0
emmet, v2.3.13
highlight-selected, v0.10.1
language-swift, v0.4.0
linter, v1.8.1
linter-htmlhint, v0.1.1
linter-js-standard, v3.2.1
linter-package-json-validator, v0.2.2
pretty-json, v0.4.1
script, v3.0.1
standard-formatter, v1.1.3
tree-view-git-status, v0.2.2

# Dev
No dev packages

does not lint

Answering the questions from #1

  1. no error in the console while linting (tried saving the file and also starting it from the command palette, all other linters work)
  2. which node: /usr/local/bin/node
  3. process.env.PATH: /home/despairblue/.rvm/bin:/home/despairblue/bin:/home/despairblue/.cabal/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/android-ndk64:/opt/android-sdk/platform-tools:/opt/android-sdk/tools:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/despairblue/.linuxbrew/bin:/home/despairblue/node_modules/.bin:/opt/java6/bin:/home/despairblue/.gem/ruby/2.1.0/bin:/home/despairblue/go/bin

Also I have linter-js-standard installed for a while now, couple of weeks at least, it actually never worked, not even with linter 0.11.0. I just haven't had the time to report it before now.

Command History

     -0:08.6 selection:changed (atom-text-editor.editor.block-cursor-i-beam.is-focused)
     -0:06.0 fuzzy-finder:toggle-file-finder (atom-text-editor.editor.block-cursor-i-beam.is-focused)
     -0:03.4 editor:delete-to-beginning-of-word (atom-text-editor.editor.mini)
     -0:03.1 editor:consolidate-selections (atom-text-editor.editor.mini)
     -0:03.1 core:cancel (atom-text-editor.editor.mini)
     -0:02.7 fuzzy-finder:toggle-file-finder (atom-text-editor.editor.block-cursor-i-beam.is-focused)
     -0:02.1 editor:consolidate-selections (atom-text-editor.editor.mini)
     -0:02.1 core:cancel (atom-text-editor.editor.mini)
     -0:01.7 command-palette:toggle (atom-text-editor.editor.block-cursor-i-beam.is-focused)
     -0:00.0 core:confirm (atom-text-editor.editor.mini)
     -0:00.0 bug-report:open (atom-text-editor.editor.block-cursor-i-beam.is-focused)

Versions

  • Atom: 0.190.0
  • Atom-Shell: 0.22.3
  • OS: linux 3.14.26-1-lts
  • Misc
    • apm 0.157.0
    • npm 2.5.1
    • node 0.10.35
    • python 2.7.9
    • git 2.3.5

This report was created in and posted from the Atom editor using the package bug-report v0.6.3.

Uncaught TypeError: Cannot read property 'scopeName' of undefined

[Enter steps to reproduce below:]

  1. install using the package handler
  2. ???

Atom Version: 1.0.19
System: Microsoft Windows 10 Home
Thrown From: linter-js-standard package, v3.2.1

Stack Trace

Uncaught TypeError: Cannot read property 'scopeName' of undefined

At C:\Users\Jurrian\.atom\packages\linter-js-standard\lib\init.js:58

TypeError: Cannot read property 'scopeName' of undefined
  at storeSettings (C:\Users\Jurrian\.atom\packages\linter-js-standard\lib\init.js:58:39)
  at Emitter.module.exports.Emitter.emit (C:\Users\Jurrian\AppData\Local\atom\app-1.0.19\resources\app.asar\node_modules\event-kit\lib\emitter.js:82:11)
  at C:\Users\Jurrian\AppData\Local\atom\app-1.0.19\resources\app.asar\src\pane-container.js:320:34
  at Emitter.module.exports.Emitter.emit (C:\Users\Jurrian\AppData\Local\atom\app-1.0.19\resources\app.asar\node_modules\event-kit\lib\emitter.js:82:11)
  at Pane.module.exports.Pane.setActiveItem (C:\Users\Jurrian\AppData\Local\atom\app-1.0.19\resources\app.asar\src\pane.js:250:22)
  at Pane.module.exports.Pane.activateItem (C:\Users\Jurrian\AppData\Local\atom\app-1.0.19\resources\app.asar\src\pane.js:314:21)
  at tabs-tab.<anonymous> (C:\Users\Jurrian\AppData\Local\atom\app-1.0.19\resources\app.asar\node_modules\tabs\lib\tab-bar-view.js:210:24)
  at space-pen-ul.jQuery.event.dispatch (C:\Users\Jurrian\AppData\Local\atom\app-1.0.19\resources\app.asar\node_modules\jquery\dist\jquery.js:4435:9)
  at space-pen-ul.elemData.handle (C:\Users\Jurrian\AppData\Local\atom\app-1.0.19\resources\app.asar\node_modules\jquery\dist\jquery.js:4121:28)

Commands

     -0:52.2.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:13.7.0 emmet:merge-lines (atom-text-editor.editor.is-focused)
     -0:06.2.0 core:undo (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "autoHideMenuBar": true,
    "disabledPackages": [
      "wrap-guide"
    ],
    "themes": [
      "atom-material-ui",
      "atom-material-syntax"
    ]
  }
}

Installed Packages

# User
atom-beautify, v0.28.14
atom-material-syntax, v0.2.4
atom-material-ui, v0.6.2
autoclose-html, v0.19.0
emmet, v2.3.13
linter, v1.8.1
linter-htmlhint, v0.1.1
linter-js-standard, v3.2.1
markdown-preview-plus, v2.2.2
minimap, v4.13.4

# Dev
No dev packages

Disable when .jshintrc file is available

I'd be awesome to have an option that disables the Standard linter when a .jshintrc file is in the project.

I'm using Standard for most of my personal projects and JSHint for some others (mostly work related or older projects) β€” and switching between linters is currently a pain.

package.json not found

Error: package.json not found in path
  at findRoot (/home/davide/.atom/packages/linter-js-standard/node_modules/find-root/index.js:13:11)
  at findRoot (/home/davide/.atom/packages/linter-js-standard/node_modules/find-root/index.js:20:10)
  at findRoot (/home/davide/.atom/packages/linter-js-standard/node_modules/find-root/index.js:20:10)
  at findRoot (/home/davide/.atom/packages/linter-js-standard/node_modules/find-root/index.js:20:10)
  at findRoot (/home/davide/.atom/packages/linter-js-standard/node_modules/find-root/index.js:20:10)
  at findRoot (/home/davide/.atom/packages/linter-js-standard/node_modules/find-root/index.js:20:10)
  at findRoot (/home/davide/.atom/packages/linter-js-standard/node_modules/find-root/index.js:20:10)
  at findRoot (/home/davide/.atom/packages/linter-js-standard/node_modules/find-root/index.js:20:10)
  at findRoot (/home/davide/.atom/packages/linter-js-standard/node_modules/find-root/index.js:20:10)
  at LinterJsStandard.checkStyleSettings (/home/davide/.atom/packages/linter-js-standard/lib/linter-js-standard.coffee:113:19)
  at LinterJsStandard.formatShellCmd (/home/davide/.atom/packages/linter-js-standard/lib/linter-js-standard.coffee:70:8)
  at /home/davide/.atom/packages/linter-js-standard/lib/linter-js-standard.coffee:1:1
  at Config.module.exports.Config.observeKeyPath (/usr/share/atom/resources/app.asar/src/config.js:555:7)
  at Config.module.exports.Config.observe (/usr/share/atom/resources/app.asar/src/config.js:135:21)
  at new LinterJsStandard (/home/davide/.atom/packages/linter-js-standard/lib/linter-js-standard.coffee:44:17)
  at Object.lint (/home/davide/.atom/packages/linter/lib/legacy.coffee:61:22)
  at /home/davide/.atom/packages/linter/lib/editor-linter.coffee:85:24
  at /home/davide/.atom/packages/linter/lib/editor-linter.coffee:84:25
  at Set.forEach (native)
  at EditorLinter.triggerLinters (/home/davide/.atom/packages/linter/lib/editor-linter.coffee:78:26)
  at EditorLinter.lint (/home/davide/.atom/packages/linter/lib/editor-linter.coffee:72:18)
  at /home/davide/.atom/packages/linter/lib/editor-linter.coffee:26:37
  at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at /usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1183:25

Object.activate is deprecated.

AtomLinter v0.X.Y API has been deprecated. Please refer to the Linter docs to update and the latest API: https://github.com/AtomLinter/Linter/wiki/Migrating-to-the-new-API

Object.activate (/Users/alex/.atom/packages/linter/lib/main.coffee:57:8)
Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:240:19)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:221:30)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:165:15)
Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:213:14)
PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:452:21)

Viewing ignored file prevents further linting

I'm not sure what the steps to troubleshoot this areβ€”I'm not even sure it's an issue with this package specificallyβ€”but here's what I'm seeing...

package.json

{
  "standard": {
    "ignore": [
      "app/assets/javascripts/vendor/*.js"
    ]
  }
}

Linting works as expected until I open an ignored file within app/assets/javascripts/vendor, at which point linting ceases to function on every file. Invoking the linter on a file manually has no effect. The only way I'm able to get linting to function properly again is to restart Atom.

OS X 10.11.1
Atom 1.0.19

Should not lint html files

Maybe the linter's scope is to greedy in the syntax list for linter: linter-js-standard.coffee#10

By using text.html.basic, any html file is linted, thus a lot of js-standard errors are reported:

  • 'React' must be in scope when using JSX
  • Unexpected token ! for <!DOCTYPE html>
  • etc.

Failed to load the linter-js-standard package

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.7
System: Mac OS X 10.10.4
Thrown From: linter-js-standard package, v2.5.0

Stack Trace

Failed to load the linter-js-standard package

At Cannot find module 'concat-map'

Error: Cannot find module 'concat-map'
    at Module._resolveFilename (module.js:328:15)
    at Function.Module._resolveFilename (/Applications/Atom.app/Contents/Resources/app.asar/src/module-cache.js:383:52)
    at Function.Module._load (module.js:270:25)
    at Module.require (module.js:357:17)
    at require (module.js:376:17)
    at Object.<anonymous> (/Users/killsos/.atom/packages/linter-js-standard/node_modules/minimatch/node_modules/brace-expansion/index.js:1:79)
    at Module._compile (module.js:452:26)
    at Object.loadFile [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/babel.js:163:21)
    at Module.load (module.js:347:32)
    at Function.Module._load (module.js:302:12)

Commands

Config

{
  "core": {
    "themes": [
      "atom-dark-ui-slim",
      "monokai"
    ],
    "disabledPackages": [
      "Atom-Syntax-highlighting-for-Sass",
      "Atom-Syntax-highlighting-for-Sass",
      "Atom-Syntax-highlighting-for-Sass",
      "Atom-Syntax-highlighting-for-Sass",
      "Atom-Syntax-highlighting-for-Sass",
      "Atom-Syntax-highlighting-for-Sass",
      "Atom-Syntax-highlighting-for-Sass",
      "Atom-Syntax-highlighting-for-Sass",
      "Atom-Syntax-highlighting-for-Sass",
      "Atom-Syntax-highlighting-for-Sass",
      "Atom-Syntax-highlighting-for-Sass",
      "Atom-Syntax-highlighting-for-Sass"
    ]
  }
}

Installed Packages

# User
atom-dark-ui-slim, v0.47.1
atom-jshint, v2.0.0
autocomplete-paths, v1.0.2
autocomplete-sass, v0.1.0
color-picker, v2.0.11
docblockr, v0.7.3
emmet, v2.3.12
express-complete, v0.2.0
file-icons, v1.6.7
html-id-class-snippets, v1.4.1
javascript-snippets, v1.0.0
linter, v1.4.3
linter-js-standard, v2.5.0
minimap, v4.13.1
monokai, v0.18.0
pigments, v0.11.0
pretty-json, v0.4.1
sass-watch, v0.3.1
travis-ci-status, v0.16.0
web-browser, v1.5.0

# Dev
No dev packages

Please include a current, updated changelog file.

if you would, please, include a changelog file that is updated & maintained for this repository so we can see what has been fixed in updates, even through Atom editor/updates.

best,

β€” faddah
portland, oregon, u.s.a.

Not working w/ zsh

I think this is the issue, but it could be something else.

atom 1.8.9
linter 0.12.0
linter-js-standard 0.1.2
osx 10.10.2
system iojs 1.4.2

apm --version
apm  0.157.0
npm  2.5.1
node 0.10.35
python 2.7.6
git 1.9.5
apm ls
οΏ½[36mBuilt-in Atom packagesοΏ½[39m (85)
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
└── [email protected]

οΏ½[36m/Users/derekreynolds/.atom/packagesοΏ½[39m (17)
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
└── [email protected]

stdout not captured on Windows 8

I originally reported this as steelbrain/linter#768:

I was originally facing #30, but I've further debugged the issue and it now looks like there is something awry in atom-linter 2.0.1. More specifically, on Windows 8 at least, Atom 1.0.2 seems unable to capture the child process's stdout.

I instrumented helpers.coffee to log the various stages of process creation. Basically, I see linter-js-standard invoke atom.exe with ATOM_SHELL_INTERNAL_RUN_AS_NODE=1. If the file has errors, then the status code differs, so it is linting. However, there is never any standard output and hence no errors.

In a Windows Command Prompt, I did a set on the variable above and then ran atom.exe with the same arguments. Interestingly, it immediately went to a blank prompt and then showed the output of the linter. It doesn't exhibit this behavior with a regular node.exe.

Additionally, I tried overriding command with node.exe (which is in my PATH), and that actually fixed the issue. Hence, it seems as though Electron run as Node behaves differently than a regular Node. It might very well be that the issue is with Electron instead. In that case, electron/electron#1463 should probably be reopened. However, since I've only seen it occur with atom-linter, I wanted to report it here first.

However, it now looks like this issue is linter-js-standard-specific. I've verified that linter-jshint works as expected, as @steelbrain suggested.

Package.json entry to ignore this codebase.

So while I love this plugin, one thing I just realized now that I am using it, while I want to force all my code to follow feross' standard guide, sometimes I work in code where I can't.. Maybe put in support for having a entry in package.json that if found would allow you to just not run the linter on it at all.

For example:

{
    "linter": false
}

Would then be picked up and it won't run at all.

Only one lint error showing at a time

I'm new to Atom so I might be missing something, but after installing the "linter" and "linter-js-standard" packages and opening a javascript file I only get one linter error at a time.

So if I have a file with semicolons all over the place it only marks the first until I fix it and so on.

I've tried this in two different machines and can provide more info if needed.

ignored globals in package.json

I added this to the package.json file in the root of my node.js app:

  "semistandard": {
    "global": [ "__base" ]
  }

and in hundreds of files in the project, I have this:

var util = require(__base + '/models/schemas/util');

But still continually get this message:
screenshot from 2015-10-09 09-03-47

Disable "trailing spaces" warning?

I would like to disable the warning -- not because I disagree with the standard, but because it's very distracting, as it constantly pops up when I'm typing and pause to think. Not to mention I already have the editor set up to remove trailing spaces, since Atom includes the Whitespace package by default.

Failed to activate the linter-js-standard package

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.11
System: Mac OS X 10.10.4
Thrown From: linter-js-standard package, v3.1.0

Stack Trace

Failed to activate the linter-js-standard package

At Cannot read property 'then' of undefined

TypeError: Cannot read property 'then' of undefined
    at Object.module.exports.activate (/Users/rbarros/Desktop/github/linter-js-standard/lib/init.js:45:5)
    at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:243:19)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:224:30
    at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:167:15)
    at Package.module.exports.Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:216:14)
    at PackageManager.module.exports.PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:486:21)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:469:29
    at Config.module.exports.Config.transact (/Applications/Atom.app/Contents/Resources/app.asar/src/config.js:324:16)
    at PackageManager.module.exports.PackageManager.activatePackages (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:464:19)
    at PackageManager.module.exports.PackageManager.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:445:46)
    at Atom.module.exports.Atom.startEditorWindow (/Applications/Atom.app/Contents/Resources/app.asar/src/atom.js:670:21)
    at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-bootstrap.js:12:8)
    at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-bootstrap.js:23:4)
    at Module._compile (module.js:452:26)
    at Object.keys.forEach.Object.defineProperty.value [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:169:21)
    at Module.load (module.js:347:32)

Commands

Config

{
  "core": {
    "disabledPackages": [
      "wrap-guide",
      "atom-jshint",
      "jslint",
      "linter-jshint",
      "linter-php",
      "linter-phpcs"
    ],
    "customFileTypes": {
      "source.js": [
        "jsx"
      ],
      "source": [
        "[object Object]"
      ]
    },
    "themes": [
      "seti-ui",
      "base16-pretty-dark"
    ],
    "audioBeep": false,
    "followSymlinks": false
  },
  "linter-js-standard": {
    "honorStyleSettings": true,
    "checkStyleDevDependencies": true,
    "showEslintRules": true,
    "lintMarkdownFiles": true
  }
}

Installed Packages

# User
Stylus, v1.0.0
auto-indent, v0.5.0
autocomplete-modules, v1.0.0
base16-pretty-dark, v0.2.3
better-handlebars, v0.1.1
docblockr, v0.7.3
git-log, v0.4.1
highlight-selected, v0.10.1
language-ejs, v0.2.0
language-jade, v0.5.1
language-nginx, v0.5.4
language-swig, v0.1.4
linter-coffeelint, v1.0.0
seti-ui, v0.7.1
standard-formatter, v1.1.0
tabs-to-spaces, v0.11.0

# Dev
linter-js-standard, v3.1.0

Rename "Check Style Dev Dependencies"

I love standard and find your linter super helpful, but I'm stuck with 50% of my projects using standard and 50% using jshint. As such I was desperate for a way to only run the linter when a project was using standard... basically a dupe of #56

I saw Check Style Dev Dependencies in the list of options many times, but it never clicked that it was what i needed to get the behaviour I was looking for...

How about rewording it as:

Check for standard
"Only run if standard, semistandard or happiness present in package.json devDependencies"

Add option to only activate on editor save?

I love that this is available - furthermore, it works wonderfully when opening up a JS file and instantly seeing all of the standard messages :)

However, it's a bit distracting when writing/editing code and then standard messages start showing up on the current line that I'm editing.

Would you add an option so that it only activates when a TextEditor (onDidSave) is saved? Or maybe there's a better way to solve this? Do you run into this issue? Thanks.

Parser support

standard supports custom JS parsers. To use a custom parser, install it from npm (example: npm install babel-eslint) and add this to your package.json:

{
  "standard": {
    "parser": "babel-eslint"
  }
}

https://github.com/feross/standard#can-i-use-a-custom-js-parser-for-bleeding-edge-es6-or-es7-support

I can't seem to get linter-js-standard to use this. Is there a way to do it?

Also seems to be related to #13 (reading standard.ignore setting from package.json). Maybe both can features be implemented the same way?

Check style on devDependencies and honour standard spec to ignore files

As @xicombd suggested through one of our conversations, we should have a checkbox on settings with the following label or something alike:

- Check code style on devDependencies

If this option was checked the plugin should parse the project package.json and read devDependencies. If standard or semistandard were present on development dependencies the linter should lint accordingly. If none of those were present it should not fallback to standard style it simply should not lint.

And we should start honouring standard ignore specification as described in standard documentation.

"standard": {
  "ignore": [
    "**/out/",
    "/lib/select2/",
    "/lib/ckeditor/",
    "tmp.js"
  ]
}

babel-eslint not respecting babel config?

I have the following in my package.json:

"babel": {
    "stage": 0
  },
"standard": {
    "parser": "babel-eslint"
}

The stage 0 is for decorators, etc. When I run standard in my project directory, I get no errors. However I'm getting a warning by the linter on a @decorator about illegal token. Adding the 'stage 0' stanza is what enabled standard to pass on the command line. Do you have any insight about making sure the proper parser/transforms/configs are getting picked up by the linter?

Markdown fenced code excessive useless errors

So now if you lint the markdown files you will have the following errors pop up most of the time:

  • no-unused-vars
  • no-undef

I already had pointed out this could happen and it would be annoying.

My solution is to under the hood wrap the fenced code block in the following manner:

/*eslint-disable no-unused-vars  no-undef*/
{ ...code ... }
/*eslint-enable no-unused-vars  no-undef*/

Show eslint rule that line is breaking in output

It would be great if linter-js-standard could show the rule name that a line is violating. This helps if you need to manually disable a specific rule for a line.

Sublime's linter-standard does this like so for a line that is breaking the 'react/prop-types' rule:

screen shot 2015-08-05 at 9 20 05 am

Recognize mocha keywords

In test files for mocha, describe, before, it, beforeEach and a slew of others are all defined globally by default. linter-jshint recognizes these.

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.