From 9f7d10d905d8f7f49390b09a2b43fc54a7a2e668 Mon Sep 17 00:00:00 2001 From: "jordi.munoz@adevinta.com" Date: Sun, 3 Dec 2023 20:40:56 +0100 Subject: [PATCH 1/2] feat(packages/sui-lint): add ignore-pattern option --- packages/sui-lint/bin/sui-lint-js.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/sui-lint/bin/sui-lint-js.js b/packages/sui-lint/bin/sui-lint-js.js index a42604e76..b6302bcd1 100755 --- a/packages/sui-lint/bin/sui-lint-js.js +++ b/packages/sui-lint/bin/sui-lint-js.js @@ -12,9 +12,10 @@ program .option('--add-fixes') .option('--staged') .option('--fix', 'fix automatically problems with js files') + .option('--ignore-pattern ', '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'] @@ -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() { From faa02f31c3da4414a5757d17e1bead09dc2a9b8f Mon Sep 17 00:00:00 2001 From: "jordi.munoz@adevinta.com" Date: Sun, 3 Dec 2023 20:45:41 +0100 Subject: [PATCH 2/2] refactor(packages/sui-lint): rename option to ignore-patterns --- packages/sui-lint/bin/sui-lint-js.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/sui-lint/bin/sui-lint-js.js b/packages/sui-lint/bin/sui-lint-js.js index b6302bcd1..4e2f90642 100755 --- a/packages/sui-lint/bin/sui-lint-js.js +++ b/packages/sui-lint/bin/sui-lint-js.js @@ -12,10 +12,10 @@ program .option('--add-fixes') .option('--staged') .option('--fix', 'fix automatically problems with js files') - .option('--ignore-pattern ', 'Path pattern to ignore for linting') + .option('--ignore-patterns ', 'Path patterns to ignore for linting') .parse(process.argv) -const {addFixes, fix, ignorePattern = [], staged} = program.opts() +const {addFixes, fix, ignorePatterns = [], staged} = program.opts() const {CI} = process.env const EXTENSIONS = ['js', 'jsx', 'ts', 'tsx'] @@ -24,7 +24,7 @@ const DEFAULT_PATTERN = './' const LINT_FORMATTER = 'stylish' const baseConfig = { ...config, - ignorePatterns: IGNORE_PATTERNS.concat(getGitIgnoredFiles()).concat(ignorePattern) + ignorePatterns: IGNORE_PATTERNS.concat(getGitIgnoredFiles()).concat(ignorePatterns) } ;(async function main() {