eslint-output
Advanced tools
Comparing version 1.2.3 to 2.0.0
40
app.js
#!/usr/bin/env node | ||
const CLIEngine = require('eslint').CLIEngine; | ||
const { CLIEngine } = require('eslint'); | ||
const path = require('path'); | ||
@@ -16,14 +16,11 @@ const yargs = require('yargs'); | ||
const cli = new CLIEngine( | ||
Object.assign( | ||
{ | ||
envs: ['browser', 'mocha'], | ||
useEslintrc: true, | ||
}, | ||
rc.cliEngineConfig, | ||
{ cwd }, | ||
), | ||
); | ||
const config = { | ||
useEslintrc: true, | ||
...(rc.cliEngineConfig || {}), | ||
cwd, | ||
}; | ||
const filesToVerify = rc.files || ['.']; | ||
const report = cli.executeOnFiles(rc.files || ['.']); | ||
const cli = new CLIEngine(config); | ||
const report = cli.executeOnFiles(filesToVerify); | ||
@@ -41,5 +38,3 @@ if (quiet) { | ||
return debug( | ||
`a 'path' prop is required for this format (${ | ||
format.name | ||
}), please specify and run again`, | ||
`a 'path' prop is required for this format (${format.name}), please specify and run again`, | ||
); | ||
@@ -57,3 +52,3 @@ } | ||
let formats = rc.formats; | ||
let { formats } = rc; | ||
@@ -65,3 +60,3 @@ if (!Array.isArray(rc.formats)) { | ||
formats.forEach(format => { | ||
formats.forEach((format) => { | ||
const formatter = cli.getFormatter(format.name); | ||
@@ -76,8 +71,11 @@ if (formatter) { | ||
if ( | ||
report.errorCount > 0 || | ||
(typeof maxWarnings === 'number' && report.warningCount > maxWarnings) | ||
) { | ||
const isRunFailed = () => { | ||
const exceededMaxWarnings = | ||
typeof maxWarnings === 'number' && report.warningCount > maxWarnings; | ||
return report.errorCount > 0 || exceededMaxWarnings; | ||
}; | ||
if (isRunFailed()) { | ||
process.exitCode = 1; | ||
debug('exited with code: 1'); | ||
} |
@@ -1,4 +0,8 @@ | ||
const rc = require('rc'); | ||
const { cosmiconfigSync } = require('cosmiconfig'); | ||
module.exports = rc('eslintoutput', { | ||
const explorerSync = cosmiconfigSync('eslintoutput'); | ||
const searchedFor = explorerSync.search(); | ||
module.exports = { | ||
files: ['.'], | ||
@@ -11,2 +15,3 @@ formats: [ | ||
], | ||
}); | ||
...searchedFor.config, | ||
}; |
{ | ||
"name": "eslint-output", | ||
"version": "1.2.3", | ||
"version": "2.0.0", | ||
"description": "export multiple formats of eslint", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
"lint:fix": "eslint --fix .", | ||
"lint:outputs": "node app.js", | ||
"lint:outputs": "DEBUG=true node app.js", | ||
"publish": "git push origin --tags && git push origin", | ||
@@ -35,15 +35,16 @@ "release:patch": "npm version patch && npm publish --access public", | ||
"dependencies": { | ||
"debug": "^4.1.0", | ||
"rc": "^1.2.8", | ||
"write": "^1.0.3", | ||
"yargs": "^13.2.4" | ||
"cosmiconfig": "^6.0.0", | ||
"debug": "^4.1.1", | ||
"write": "^2.0.0", | ||
"yargs": "^15.3.1" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^4.19.1", | ||
"eslint-config-airbnb-base": "^11.3.2", | ||
"eslint-plugin-import": "^2.14.0" | ||
"eslint": "^6.8.0", | ||
"eslint-config-airbnb-base": "^14.1.0", | ||
"eslint-config-prettier": "^6.10.1", | ||
"eslint-plugin-import": "^2.20.2" | ||
}, | ||
"peerDependencies": { | ||
"eslint": ">=3" | ||
"eslint": ">=6" | ||
} | ||
} |
@@ -1,3 +0,2 @@ | ||
eslint-output | ||
======== | ||
# eslint-output | ||
@@ -10,2 +9,3 @@ [![npm version](https://badge.fury.io/js/eslint-output.svg)](https://badge.fury.io/js/eslint-output) | ||
Install `eslint-output` using `npm` or your favorite node modules manager. | ||
```shell | ||
@@ -22,3 +22,2 @@ npm i --save-dev eslint-output | ||
**Example `.eslintoutputrc`** | ||
@@ -45,2 +44,3 @@ | ||
##### Commad line options | ||
``` | ||
@@ -57,1 +57,4 @@ --quiet Don't report warnings, only errors | ||
### Breaking changes | ||
- removed explicitly setting `env: [''browser', 'mocha']` |
5128
57
4
+ Addedcosmiconfig@^6.0.0
+ Added@babel/code-frame@7.26.2(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@types/parse-json@4.0.2(transitive)
+ Addedadd-filename-increment@1.0.0(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedcliui@6.0.0(transitive)
+ Addedcosmiconfig@6.0.0(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedfind-up@4.1.0(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedjson-parse-even-better-errors@2.3.1(transitive)
+ Addedlines-and-columns@1.2.4(transitive)
+ Addedlocate-path@5.0.0(transitive)
+ Addedp-locate@4.1.0(transitive)
+ Addedparse-json@5.2.0(transitive)
+ Addedpath-type@4.0.0(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedstrip-filename-increment@2.0.1(transitive)
+ Addedwrap-ansi@6.2.0(transitive)
+ Addedwrite@2.0.0(transitive)
+ Addedyaml@1.10.2(transitive)
+ Addedyargs@15.4.1(transitive)
+ Addedyargs-parser@18.1.3(transitive)
- Removedrc@^1.2.8
- Removedansi-regex@4.1.1(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedcliui@5.0.0(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removeddeep-extend@0.6.0(transitive)
- Removedemoji-regex@7.0.3(transitive)
- Removedfind-up@3.0.0(transitive)
- Removedini@1.3.8(transitive)
- Removedis-fullwidth-code-point@2.0.0(transitive)
- Removedlocate-path@3.0.0(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedp-locate@3.0.0(transitive)
- Removedpath-exists@3.0.0(transitive)
- Removedrc@1.2.8(transitive)
- Removedstring-width@3.1.0(transitive)
- Removedstrip-ansi@5.2.0(transitive)
- Removedstrip-json-comments@2.0.1(transitive)
- Removedwrap-ansi@5.1.0(transitive)
- Removedwrite@1.0.3(transitive)
- Removedyargs@13.3.2(transitive)
- Removedyargs-parser@13.1.2(transitive)
Updateddebug@^4.1.1
Updatedwrite@^2.0.0
Updatedyargs@^15.3.1