[lint addon / javascript] Produces extraneous messages when option is specified
See original GitHub issueFor example, for the supplied demo, if I modify the lint config to use lint option onUpdateListing:
var editor = CodeMirror.fromTextArea(document.getElementById("code-js"), {
lineNumbers: true,
mode: "javascript",
gutters: ["CodeMirror-lint-markers"],
lint: { onUpdateLinting: function onUpdateLinting(annotationsNotSorted, annotations, cm) {
console.log(annotationsNotSorted);
} }
});
The annotationsNotSorted
returned will have an extraneous annotation "Bad option: onUpdateLinting"
that does not match the editor.
The underlying JSHINT is returning the annotation because CodeMirror addon javascript-hint is passing on non-JSHINT option to JSHINT. See startLinting() in lint.js .
Would there be any interest to accept a patch for this?
I am working on a fix, filtering out lint addon’s own option before passing to mode-specific helper.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
[lint addon / javascript] Produces extraneous messages when ...
The annotationsNotSorted returned will have an extraneous annotation "Bad option: onUpdateLinting" that does not match the editor.
Read more >How To Enable Linting on Save with Visual Studio Code and ...
Learn how to lint your code on every file save using ESLint rules and VS Code settings.
Read more >"parserOptions.project" has been set for @typescript-eslint ...
This setting is required if you want to use rules which require type information. (...) Note that if this setting is specified and ......
Read more >Android Lint Checks - Android Studio Project Site
In Gradle projects you can specify a resource prefix that all resources in the. project must conform to. This makes it easier to...
Read more >Provide a common API for displaying JavaScript messages
Blocked by: [#2853509] Problem/Motivation Provide a consistent method for displaying messages in JavaScript. Currently the Settings tray module needs to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you! It helped me dealing with the following console warning:
Cannot display JSHint error (invalid line 0) {id: "(error)", raw: "Bad {a}option: '{b}'.", code: "E001", evidence: "", line: 0, …}
Leaving it here for anyone else who might encounter the same problem. So what I did I passed an empty object to options in the lint object, like that:I used jshint js , javascriput-hint. js,lint. JS, resulting in my JavaScript hint JS can’t be used. It can’t complete the automatic prompt function. Have you encountered it? If so, please tell me how to deal with it