Gathering detailed insights and metrics for eslint-friendly-formatter
Gathering detailed insights and metrics for eslint-friendly-formatter
Gathering detailed insights and metrics for eslint-friendly-formatter
Gathering detailed insights and metrics for eslint-friendly-formatter
eslint-formatter-friendly
simple formatter/reporter for eslint that's friendly with Sublime Text and iterm2 'click to open file' functionality
eslint-nibble
Ease into ESLint, by fixing one rule at a time
eslint-formatter-friendly-cn
simple formatter/reporter for eslint that's friendly with Sublime Text and iterm2 'click to open file' functionality
@beisen/hookformatter
主要是照抄了下 eslint-friendly-formatter
A simple formatter/reporter for ESLint that's friendly with Sublime Text and iterm2 "click to open file" functionality
npm install eslint-friendly-formatter
Typescript
Module System
Min. Node Version
Node Version
NPM Version
98.2
Supply Chain
99
Quality
75.3
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
56,966,700
Last Day
5,827
Last Week
117,177
Last Month
519,870
Last Year
5,955,055
MIT License
199 Stars
124 Commits
28 Forks
10 Watchers
9 Branches
13 Contributors
Updated on Jun 02, 2025
Minified
Minified + Gzipped
Latest Version
4.0.1
Package Id
eslint-friendly-formatter@4.0.1
Size
11.06 kB
NPM Version
3.10.8
Node Version
6.9.1
Published on
Apr 09, 2018
Cumulative downloads
Total Downloads
Last Day
-22.3%
5,827
Compared to previous day
Last Week
-17.3%
117,177
Compared to previous week
Last Month
2.9%
519,870
Compared to previous month
Last Year
2.5%
5,955,055
Compared to previous year
A simple formatter/reporter for ESLint that's friendly with Sublime Text and iterm2 "click to open file" functionality
I decided to use eslint to verify my code and sadly the reporter was not terminal friendly. Basically I cannot click on the file to open it with my text editor and go directly to the line where the error was reported. This module fixes that issue, by using the syntax that "sublime text" introduced to open files.
Filenames may be given a :line or :line:column suffix to open at a specific location.
This module is based on the original stylish
formatter that is now part of ESLint, it adds the following
All the errors are reported at the end, so no more search for errors between tons of report lines
RuleIds are clickable on terminals like iTerm2 and take you to the ruleId documentation site.
A summary is shown at the end with the offended ruleIds, ruleIds are also clickable.
It also shows a bit of context where the error happened, Making easier to understand the nature of the error
If you use iTerm2 or Guake* the link for the file becomes clickable and will open your editor at the given line. Please make sure you have properly configured the option to open uris that matches files with your editor of choice. Sublime is a great choice!, but this should work as well with other editors that understand the pattern used by sublime
* Note: Until Guake v0.7.3 is released, it may be necessary to compile master from source.
1npm i --save-dev eslint-friendly-formatter
Install eslint
and eslint-friendly-formatter
.
1npm i -D eslint eslint-friendly-formatter
Add a script to your package json like:
1{ 2 "scripts": { 3 "eslint": "eslint --format 'node_modules/eslint-friendly-formatter' file1 file2 dir1/ dir2/", 4 } 5}
Note: In windows you might not need the quotes around the path to the module.
1{ 2 "scripts": { 3 "eslint": "eslint --format node_modules/eslint-friendly-formatter file1 file2 dir1/ dir2/", 4 } 5}
see issue #17
Create a external tool to run eslint using this module as your formatter like this
npm
run eslint
$ProjectFileDir$
Use an output filter like:
1$FILE_PATH$.*:$LINE$.*:$COLUMN$
When launching the tool now the files will be also clickable, see:
In the command line
1# just make sure you pass the path to the module to the format option of eslint 2eslint.js --format './node_modules/eslint-friendly-formatter/index.js' index.js test/ -c './eslint.json'
Or as a module
1var eslint = require('eslint'); 2var opts = readJson('./path/to/options'); 3 4var engine = new eslint.CLIEngine( opts ); 5var report = engine.executeOnFiles( ['file1.js', 'file2.js'/*, ...*/] ); 6var results = report.results || []; 7 8var formatter = require('eslint-friendly-formatter'); 9var output = formatter(results); 10 11// this will print the report if any... 12console.log(output); 13
It works with gulp
and gulp-eslint
1var friendlyFormatter = require("eslint-friendly-formatter"); 2// Your js task 3gulp.task("javascript", function() { 4 return gulp.src(["src/js/**/*.js"]) 5 // Your eslint pipe 6 .pipe(eslint(".eslintrc")) 7 .pipe(eslint.format(friendlyFormatter)) 8 // Continue your other tasks 9 .pipe(concat("app.js")) 10 .pipe(gulp.dest("dist/js")) 11});
It should work well in with eslint-grunt or grunt-eslint
1grunt.initConfig({ 2 // when using eslint-grunt: 3 eslint: { 4 options: { 5 formatter: './node_modules/eslint-friendly-formatter' 6 }), 7 target1: { 8 //.. 9 } 10 }, 11 // when using grunt-eslint: 12 eslint: { 13 options: { 14 format: './node_modules/eslint-friendly-formatter' 15 }), 16 target2: { 17 //.. 18 } 19 } 20});
UPDATE:
We can pass variables to the formatter using a double dash at the end of the eslint command -- --eff-by-issue
. So a new flag can be used to group eslint issues by ruleId
instead as by file. This is useful if you want to fix at once all the errors/warnigs of the same kind.
Eslint does not support passing parameters to formatters from the cli yet.So in order
to pass parameters to the formatter we will have to rely on environment variables
Only shows the errors
/warnigs
that match the given ruleId
filter. This option will only filter the reported rules the error and warning counts will be the same as when all rules are reported same as the exit code.
1eslint -f node_modules/eslint-friendly-formatter client/**/*.js server/**/*.js -- --eff-by-issue --eff-filter 'global-require' # notice the --
Normally the reporter will group issues by file, which is handy for normal development. But there are some cases where you might want to fix all the errors of a same kind all at once. For those cases this flag can be used to make the reporter group the issues by ruleId.
1eslint -f node_modules/eslint-friendly-formatter client/**/*.js server/**/*.js -- --eff-by-issue # notice the --
Important: don't forget to add the flag at the end and after --
otherwise it will be interpreted as a eslint parameter and will fail as that parameter is not known to eslint.
Same as environment variable EFF_ABSOLUTE_PATHS
. If set to true the paths will be absolute. Otherwise they will be relative to CWD.
EFF_NO_GRAY
Disable the gray color output
We use the gray color to show some info about the context where the error/warning happens. If for some reason you want to disable the gray color, in cases like this one , you can do it using an environment variable.
1export EFF_NO_GRAY=true
And the gray color won't be used.
EFF_ABSOLUTE_PATHS
Make the paths of the files in the reporter be absolute instead of relative as it is by default in the received results.
Some terminals work better with relative paths (like iTerm2
with fish
) and other dislike it like Guake
. So starting in version v.1.1.0 the paths will be relative by deafult. If you need the absolute please export the following variable
1export EFF_ABSOLUTE_PATHS=true
EFF_EDITOR_SCHEME
If this parameter is set, a url will be output below the filename.
Some terminals only support clicking on urls, and editors can be configured to respond to custom url schemes.
1export EFF_EDITOR_SCHEME=editor://open?file={file}&line={line}&column={column}
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 6/23 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
51 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More