ricardofbarros / linter-js-standard Goto Github PK
View Code? Open in Web Editor NEWAtom linter plugin for JavaScript, using JavaScript Standard Style
Home Page: https://atom.io/packages/linter-js-standard
License: MIT License
Atom linter plugin for JavaScript, using JavaScript Standard Style
Home Page: https://atom.io/packages/linter-js-standard
License: MIT License
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
Hey all - noob questions that I couldn't find an answer for.
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?
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?
Now it will only check JSX file with .js.jsx extension.
New option to be implemented:
Ignore node_modules/**, default: true
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.
Drop the coffeescript.
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})
}
Happens when updating to version 2.0.0 or later
1.2.0 still lints.
The bug that the known issue points to in the readme is marked as solved, is this issue still relevant?
Repro:
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
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)
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)
{
"core": {
"themes": [
"atom-light-ui",
"atom-light-syntax"
],
"disabledPackages": [
"welcome",
"timecop",
"symbols-view",
"styleguide",
"release-notes",
"metrics",
"bookmarks"
]
},
"linter-js-standard": {
"honorStyleSettings": true
}
}
# 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
which node
: /usr/local/bin/node
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.
-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)
This report was created in and posted from the Atom editor using the package bug-report
v0.6.3.
[Enter steps to reproduce below:]
Atom Version: 1.0.19
System: Microsoft Windows 10 Home
Thrown From: linter-js-standard package, v3.2.1
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)
-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)
{
"core": {
"autoHideMenuBar": true,
"disabledPackages": [
"wrap-guide"
],
"themes": [
"atom-material-ui",
"atom-material-syntax"
]
}
}
# 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
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.
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
This is related to the changed output of standard, the regex must be updated.
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)
Would it be difficult to add support for happiness. It is also based off of standard
and the README indicates this module supports it, but that appears to be incorrect.
https://github.com/JedWatson/happiness
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
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>
[Enter steps to reproduce below:]
Atom Version: 1.0.7
System: Mac OS X 10.10.4
Thrown From: linter-js-standard package, v2.5.0
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)
{
"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"
]
}
}
# 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
Cross-posting this issue for @zeke:
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.
This supports ignore
which is great, if I want to ignore a whole file, but I don't want to ignore files, I want it to not error out on me when I am writing tests. So support for global would be great. :)
{
"standard": {
"global": [ "myVar1", "myVar2" ]
}
}
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]
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 invokeatom.exe
withATOM_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 ranatom.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 regularnode.exe
.Additionally, I tried overriding
command
withnode.exe
(which is in myPATH
), 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.
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.
Putting this in my init script as suggested by the readme will stop the packages panel etc. from working:
sys = require('sys')
exec = require('child_process').exec;
exec "source ~/.bash_profile && echo $PATH", (err, stdout) ->
process.env.PATH = stdout.replace '\n', ''
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.
This would abstract away the need to keep the parser in this module itself, instead relying on the project to get the right module. linter-eslint
does this.
By using atom-package-deps
you are able to install linter
automatically on activation. This will allow new Atom users to install only your package and nothing else, removing one step from the installation process.
Please see AtomLinter/linter-ruby#38 for example.
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.
Some newer changes are not being merged in, eg. standard/eslint-config-standard#1
[Enter steps to reproduce below:]
Atom Version: 1.0.11
System: Mac OS X 10.10.4
Thrown From: linter-js-standard package, v3.1.0
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)
{
"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
}
}
# 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
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
"
Just FYI!: standard/standard@28e5f56
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.
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?
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"
]
}
https://github.com/ricardofbarros/linter-js-standard/blob/master/lib/linter-js-standard.js#L29
This seems to be triggered when you're in a JS file and save the file under a different name (Using Save as...
)
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?
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*/
In test files for mocha, describe
, before
, it
, beforeEach
and a slew of others are all defined globally by default. linter-jshint
recognizes these.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.