How to use the globby.default function in globby

To help you get started, we’ve selected a few globby examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Akryum / nodepack / packages / @nodepack / plugin-typescript / src / lib / tslint.js View on Github external
)
  }

  const files = args._ && args._.length
    ? args._
    : ['src/**/*.ts', 'src/**/*.tsx', 'tests/**/*.ts', 'tests/**/*.tsx']

  // respect linterOptions.exclude from tslint.json
  if (config && config.linterOptions && config.linterOptions.exclude) {
    // use the raw tslint.json data because config contains absolute paths
    const rawTslintConfig = JSON.parse(fs.readFileSync(tslintConfigPath, 'utf-8'))
    const excludedGlobs = rawTslintConfig.linterOptions.exclude
    excludedGlobs.forEach((g) => files.push('!' + g))
  }

  return globby(files, { cwd }).then(files => {
    files.forEach(lint)
    if (silent) return
    const result = linter.getResult()
    if (!result) {
      console.log(`No result.\n`)
    } else if (result.output.trim()) {
      process.stdout.write(result.output)
    } else if (result.fixes && result.fixes.length) {
      // some formatters do not report fixes.
      const f = new tslint.Formatters.ProseFormatter()
      process.stdout.write(f.format(result.failures, result.fixes))
    } else if (!result.failures.length) {
      console.log(`No lint errors found.\n`)
    }

    if (result.failures.length && !args.force) {

globby

User-friendly glob matching

MIT
Latest version published 3 months ago

Package Health Score

86 / 100
Full package analysis