Skip to content

Commit

Permalink
feat(cli): add --ignore option (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
romkhub committed Nov 23, 2022
1 parent c3a7f17 commit 21e212c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## 15.1.0 2022-11-23
- Enhancement: Added `--ignore` option support

## 15.0.0 2022-04-20

- In addition to breaking changes and other in `15.0.0-0`, only some dependency updates
Expand Down
3 changes: 3 additions & 0 deletions bin/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ function cli (rawOpts) {
],
string: [
'ext',
'ignore',
'global',
'plugin',
'parser',
Expand Down Expand Up @@ -76,6 +77,7 @@ Flags:
Flags (advanced):
--stdin Read file text from stdin
--ext Specify JavaScript file extensions
--ignore Specify files to ignore
--global Declare global variable
--plugin Use custom eslint plugin
--env Use custom eslint environment
Expand All @@ -94,6 +96,7 @@ Flags (advanced):
const lintOpts = {
fix: argv.fix,
extensions: argv.ext,
ignore: argv.ignore,
globals: argv.global,
plugins: argv.plugin,
envs: argv.env,
Expand Down
3 changes: 3 additions & 0 deletions lib/resolve-eslint-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ const resolveEslintConfig = function (rawOpts, baseEslintConfig, customEslintCon
setParser(eslintConfig, typeof packageOpts.parser === 'string' ? packageOpts.parser : opts.parser)

if (customEslintConfigResolver) {
/**
* @type {string}
*/
let rootDir
if (opts.usePackageJson) {
const filePath = pkgConf.filepath(packageOpts)
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "standard-engine",
"version": "15.0.0",
"version": "15.1.0",
"description": "Wrap your standards in a tortilla and cover it in special sauce.",
"keywords": [
"JavaScript Standard Style",
Expand Down Expand Up @@ -39,7 +39,7 @@
"build:1-declaration": "tsc -p declaration.tsconfig.json",
"build": "run-s build:*",
"check:dependency-check": "dependency-check *.js 'bin/**/*.js' 'lib/**/*.js' --no-dev",
"check:installed-check": "installed-check",
"check:installed-check": "installed-check --engine-ignore dependency-check",
"check:standard": "standard",
"check:tsc": "tsc",
"check:type-coverage": "type-coverage --detail --strict --at-least 95 --ignore-files 'test/*'",
Expand Down Expand Up @@ -79,7 +79,8 @@
"standard": "^17.0.0-2",
"tape": "^5.5.2",
"type-coverage": "^2.21.0",
"typescript": "~4.6.3"
"typescript": "~4.6.3",
"version-guard": "^1.1.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
Expand Down
2 changes: 1 addition & 1 deletion test/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { StandardEngine } = require('../')

async function getStandard () {
/** @type {string} */
const configFile = (await import('../tmp/standard/options.js')).default.eslintConfig.overrideConfigFile
const configFile = (await import('../tmp/standard/lib/options.js')).default.eslintConfig.overrideConfigFile
return new StandardEngine({
cmd: 'pocketlint',
version: '0.0.0',
Expand Down

0 comments on commit 21e212c

Please sign in to comment.