Skip to content

Commit

Permalink
feat(packages/sui-lint): add ignore-pattern option
Browse files Browse the repository at this point in the history
  • Loading branch information
jordevo committed Dec 3, 2023
1 parent ebe0866 commit 9f7d10d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/sui-lint/bin/sui-lint-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ program
.option('--add-fixes')
.option('--staged')
.option('--fix', 'fix automatically problems with js files')
.option('--ignore-pattern <ignorePattern...>', 'Path pattern to ignore for linting')
.parse(process.argv)

const {addFixes, fix, staged} = program.opts()
const {addFixes, fix, ignorePattern = [], staged} = program.opts()

const {CI} = process.env
const EXTENSIONS = ['js', 'jsx', 'ts', 'tsx']
Expand All @@ -23,7 +24,7 @@ const DEFAULT_PATTERN = './'
const LINT_FORMATTER = 'stylish'
const baseConfig = {
...config,
ignorePatterns: IGNORE_PATTERNS.concat(getGitIgnoredFiles())
ignorePatterns: IGNORE_PATTERNS.concat(getGitIgnoredFiles()).concat(ignorePattern)
}

;(async function main() {
Expand Down

0 comments on commit 9f7d10d

Please sign in to comment.