Comparing version 5.0.0 to 5.1.0
@@ -1,2 +0,10 @@ | ||
<a name="4.0.0"></a> | ||
# [5.0.0](https://github.com/dollarshaveclub/es-check/compare/4.0.0...5.0.0) (2018-11-20) | ||
### Features | ||
* Update Caporal.js, exit without files, options as flags ([#75](https://github.com/dollarshaveclub/es-check/issues/75)) ([6ea433c](https://github.com/dollarshaveclub/es-check/commit/6ea433c)) | ||
# [4.0.0](https://github.com/dollarshaveclub/es-check/compare/3.0.0...4.0.0) (2018-09-13) | ||
@@ -11,3 +19,2 @@ | ||
<a name="3.0.0"></a> | ||
# [3.0.0](https://github.com/dollarshaveclub/es-check/compare/2.3.0...3.0.0) (2018-09-10) | ||
@@ -27,3 +34,2 @@ | ||
<a name="2.3.0"></a> | ||
# [2.3.0](https://github.com/dollarshaveclub/es-check/compare/2.2.0...2.3.0) (2018-09-09) | ||
@@ -38,3 +44,2 @@ | ||
<a name="2.2.0"></a> | ||
# [2.2.0](https://github.com/dollarshaveclub/es-check/compare/2.1.0...2.2.0) (2018-09-04) | ||
@@ -44,3 +49,2 @@ | ||
<a name="2.1.0"></a> | ||
# [2.1.0](https://github.com/dollarshaveclub/es-check/compare/270ed6c...2.1.0) (2018-08-02) | ||
@@ -47,0 +51,0 @@ |
19
index.js
@@ -33,2 +33,3 @@ #!/usr/bin/env node | ||
.option('--allow-hash-bang', 'if the code starts with #! treat it as a comment') | ||
.option('--not', 'folder or file names to skip', prog.LIST) | ||
.action((args, options, logger) => { | ||
@@ -38,3 +39,3 @@ | ||
let v, files, e, esmodule, allowHashBang | ||
let v, files, e, esmodule, allowHashBang, pathsToIgnore | ||
let config = {} | ||
@@ -66,2 +67,6 @@ | ||
pathsToIgnore = options.not | ||
? options.not | ||
: config.not | ||
if (!v) { | ||
@@ -134,2 +139,10 @@ logger.error( | ||
const acornOpts = { ecmaVersion: e, silent: true } | ||
const filterForIgnore = (globbedFiles) => { | ||
if (pathsToIgnore && pathsToIgnore.length > 0) { | ||
const filtered = globbedFiles.filter((filePath) => !pathsToIgnore | ||
.some(ignoreValue => filePath.includes(ignoreValue))) | ||
return filtered; | ||
} | ||
return globbedFiles; | ||
} | ||
@@ -159,3 +172,5 @@ logger.debug(`ES-Check: Going to check files using version ${e}`) | ||
globbedFiles.forEach((file) => { | ||
const filteredFiles = filterForIgnore(globbedFiles); | ||
filteredFiles.forEach((file) => { | ||
const code = fs.readFileSync(file, 'utf8') | ||
@@ -162,0 +177,0 @@ |
{ | ||
"name": "es-check", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "Checks the EcamScript version of .js glob against a specified version of EcamScript with a shell command", | ||
@@ -42,8 +42,8 @@ "main": "index.js", | ||
"husky": "^1.0.0", | ||
"mocha": "^5.0.0", | ||
"nyc": "^12.0.1" | ||
"mocha": "^6.0.0", | ||
"nyc": "^14.1.1" | ||
}, | ||
"dependencies": { | ||
"acorn": "6.0.4", | ||
"caporal": "1.1.0", | ||
"acorn": "6.1.1", | ||
"caporal": "1.3.0", | ||
"glob": "^7.1.2" | ||
@@ -50,0 +50,0 @@ }, |
@@ -35,3 +35,3 @@ <p align="center"> | ||
Removes need for `boolean` in argument; post [Caporal **1.1.0**](https://github.com/mattallty/Caporal.js/commit/ae5d2c3cc1acef1b89a13608033b250fa7750c4e). | ||
This will require an update for any boolean cli flags, in example `--module`, `--allowHashBang`. | ||
This will require an update for any boolean cli flags, in example `--module`, `--allow-hash-bang`. | ||
@@ -132,3 +132,3 @@ Example of CLI boolean flag in previous versions (Versions 0-4.*) | ||
index.js es-check <es-version> [files...] | ||
index.js es-check <ecmaVersion> [files...] | ||
@@ -160,6 +160,11 @@ ``` | ||
--allowHashBang supports files that start with hash bang, default false | ||
--allow-hash-bang supports files that start with hash bang, default false | ||
``` | ||
**Not** | ||
```sh | ||
--not=folderName1,folderName2 An array of file/folder names that you would like to ignore. Defaults to `[]`. | ||
``` | ||
### Global Options | ||
@@ -166,0 +171,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19289
179
244
+ Addedacorn@6.1.1(transitive)
+ Addedcaporal@1.3.0(transitive)
+ Addedcolorette@1.4.0(transitive)
- Removedacorn@6.0.4(transitive)
- Removedcaporal@1.1.0(transitive)
- Removedcolorette@1.0.1(transitive)
- Removedlodash.kebabcase@4.1.1(transitive)
- Removedlodash.merge@4.6.2(transitive)
Updatedacorn@6.1.1
Updatedcaporal@1.3.0