eslint-formatter-comment
Advanced tools
+21
| The MIT License (MIT) | ||
| Copyright (c) 2015 Peter Lyons LLC | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. |
+1
-1
@@ -44,3 +44,3 @@ // This is a slightly modified variant of the compact formatter | ||
| output += " - " + message.message; | ||
| output += message.ruleId ? " /* eslint " + message.ruleId + ":0 */" : ""; | ||
| output += message.ruleId ? " // eslint-disable-line " + message.ruleId : ""; | ||
| output += "\n"; | ||
@@ -47,0 +47,0 @@ }); |
+1
-1
| { | ||
| "name": "eslint-formatter-comment", | ||
| "version": "1.0.0", | ||
| "version": "2.0.0", | ||
| "description": "Compact formatter for ESLint errors including a JavaScript comment to disable the rule", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+9
-7
@@ -6,16 +6,18 @@ # eslint comment formatter | ||
| - filename with line and column appended with colons as many editor CLIs will accept this as a command line argument and place the cursor exactly on the error using this information | ||
| - Allows copy/pasting of a complete JavaScript comment to disable this rule in a specific location. Note that some rules have configuration more complicated that just on or off, but at the moment this formatter always just outputs ":0" to disable. Pull requests welcome to make this specific to each rule. | ||
| - Allows copy/pasting of a complete JavaScript comment to disable this rule in a specific location. | ||
| Note this is a copy and tweak job from the built-in "compact" eslint formatter. | ||
| # Example Output | ||
| ## Example Output | ||
| ``` | ||
| app/entries/operations/index.js:6:15 Error - Missing semicolon. /* eslint semi:0 */ | ||
| app/entries/operations/index.js:6:10 Error - Strings must use doublequote. /* eslint quotes:0 */ | ||
| app/entries/operations/index.js:6:4 Error - foo is defined but never used /* eslint no-unused-vars:0 */ | ||
| app/entries/operations/index.js:1:26 Error - Strings must use singlequote. // eslint-disable-line quotes | ||
| app/entries/operations/index.js:2:38 Error - Extra semicolon. // eslint-disable-line semi | ||
| app/entries/operations/index.js:3:5 Error - foo is defined but never used // eslint-disable-line no-unused-vars | ||
| app/entries/operations/index.js:3:9 Error - Extra semicolon. // eslint-disable-line semi | ||
| ``` | ||
| #License | ||
| # License | ||
| This formatter is MIT licensed. The [ESLint License](./ESLint.license) is included with this repository as well. | ||
| This formatter is [MIT licensed](./LICENSE.txt). The [ESLint License](./ESLint.license) is included with this repository as well. |
5322
23.42%5
25%23
9.52%