es-check 6.0.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +14 -10
  3. package/package.json +5 -5
package/README.md CHANGED
@@ -196,7 +196,7 @@ ES Check is a small utility using powerful tools that [Isaac Z. Schlueter](https
196
196
 
197
197
  ## Contributing
198
198
 
199
- ES Check has 3 main dependencies: [acorn](https://github.com/ternjs/acorn/), [glob](https://www.npmjs.com/package/glob), and [caporal](https://github.com/mattallty/Caporal.js). To contribute, file an [issue](https://github.com/dollarshaveclub/es-check/issues) or submit a pull request.
199
+ ES Check has 3 main dependencies: [acorn](https://github.com/ternjs/acorn/), [glob](https://www.npmjs.com/package/glob), and [caporal](https://github.com/mattallty/Caporal.js). To contribute, file an [issue](https://github.com/yowainwright/es-check/issues) or submit a pull request.
200
200
 
201
201
  ### Contributors
202
202
 
package/index.js CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  'use strict'
4
4
 
5
- const prog = require('caporal')
5
+ const { program } = require('@caporal/core')
6
6
  const acorn = require('acorn')
7
7
  const glob = require('glob')
8
8
  const fs = require('fs')
9
9
  const path = require('path')
10
10
 
11
11
  const pkg = require('./package.json')
12
- const argsArray = process.argv
12
+ const argsArray = process.argv.slice(2)
13
13
 
14
14
  /**
15
15
  * es-check 🏆
@@ -20,7 +20,7 @@ const argsArray = process.argv
20
20
  * to to test the EcmaScript version of each file
21
21
  * - error failures
22
22
  */
23
- prog
23
+ program
24
24
  .version(pkg.version)
25
25
  .argument(
26
26
  '[ecmaVersion]',
@@ -35,8 +35,10 @@ prog
35
35
  '--allow-hash-bang',
36
36
  'if the code starts with #! treat it as a comment'
37
37
  )
38
- .option('--not', 'folder or file names to skip', prog.LIST)
39
- .action((args, options, logger) => {
38
+ .option('--not', 'folder or file names to skip', {
39
+ validator: program.ARRAY
40
+ })
41
+ .action(({ logger, args, options }) => {
40
42
  const configFilePath = path.resolve(process.cwd(), '.escheckrc')
41
43
 
42
44
  /**
@@ -51,14 +53,16 @@ prog
51
53
  const expectedEcmaVersion = args.ecmaVersion
52
54
  ? args.ecmaVersion
53
55
  : config.ecmaVersion
54
- const files = args.files.length ? args.files : [].concat(config.files)
56
+ const files =
57
+ args.files && args.files.length ? args.files : [].concat(config.files)
55
58
  const esmodule = options.module ? options.module : config.module
56
59
  const allowHashBang = options.allowHashBang
57
60
  ? options.allowHashBang
58
61
  : config.allowHashBang
59
- const pathsToIgnore = options.not.length
60
- ? options.not
61
- : [].concat(config.not || [])
62
+ const pathsToIgnore =
63
+ options.not && options.not.length
64
+ ? options.not
65
+ : [].concat(config.not || [])
62
66
 
63
67
  if (!expectedEcmaVersion) {
64
68
  logger.error(
@@ -226,4 +230,4 @@ prog
226
230
  logger.info(`ES-Check: there were no ES version matching errors! 🎉`)
227
231
  })
228
232
 
229
- prog.parse(argsArray)
233
+ program.run(argsArray)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-check",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "Checks the ECMAScript version of .js glob against a specified version of ECMAScript with a shell command",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
@@ -33,9 +33,9 @@
33
33
  },
34
34
  "homepage": "https://github.com/yowainwright/es-check#readme",
35
35
  "devDependencies": {
36
- "@commitlint/cli": "^12.0.1",
36
+ "@commitlint/cli": "^14.1.0",
37
37
  "@commitlint/config-conventional": "^13.1.0",
38
- "@commitlint/prompt": "^12.0.1",
38
+ "@commitlint/prompt": "^13.1.0",
39
39
  "assert": "^2.0.0",
40
40
  "codecov": "^3.0.0",
41
41
  "commitizen": "^4.2.2",
@@ -46,7 +46,7 @@
46
46
  "eslint-config-standard": "^16.0.3",
47
47
  "eslint-plugin-import": "^2.23.4",
48
48
  "eslint-plugin-node": "^11.1.0",
49
- "eslint-plugin-prettier": "^3.4.0",
49
+ "eslint-plugin-prettier": "^4.0.0",
50
50
  "eslint-plugin-promise": "^5.1.0",
51
51
  "husky": "^7.0.1",
52
52
  "mocha": "^9.0.1",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "acorn": "^8.4.1",
59
- "caporal": "^1.4.0",
59
+ "@caporal/core": "^2.0.2",
60
60
  "glob": "^7.1.7"
61
61
  },
62
62
  "engines": {