IanVS / eslint-nibble

Ease into ESLint, by fixing one rule at a time
MIT License
787 stars 29 forks source link

Can't specify directories #106

Closed ehaynes99 closed 1 year ago

ehaynes99 commented 1 year ago

Specifying the name of a directory fails with an error, which is inconsistent with the behavior of eslint:

npx eslint src
# ...
# outputs errors
# ...
✖ 198 problems (198 errors, 0 warnings)
$ npx eslint-nibble src
/home/ehaynes99/tmp/example/node_modules/eslint/lib/cli-eng
ine/file-enumerator.js:320
                    throw new NoFilesFoundError(
                          ^

NoFilesFoundError: No files matching 'src' were found.
    at FileEnumerator.iterateFiles (/home/ehaynes99/tmp/example/node_modules/eslint/lib/cli-engine/file-enumerator.js:320:27)
    at iterateFiles.next (<anonymous>)
    at CLIEngine.executeOnFiles (/home/ehaynes99/tmp/example/node_modules/eslint/lib/cli-engine/cli-engine.js:786:48)
    at ESLint.lintFiles (/home/ehaynes99/tmp/example/node_modules/eslint/lib/eslint/eslint.js:551:23)
    at Object.nibbleOnFiles (/home/ehaynes99/tmp/example/node_modules/eslint-nibble/src/nibbler.js:115:31)
    at Object.execute (/home/ehaynes99/tmp/example/node_modules/eslint-nibble/src/cli.js:75:34)
    at /home/ehaynes99/tmp/example/node_modules/eslint-nibble/bin/eslint-nibble.js:6:28
    at Object.<anonymous> (/home/ehaynes99/tmp/example/node_modules/eslint-nibble/bin/eslint-nibble.js:13:3)
    at Module._compile (node:internal/modules/cjs/loader:1165:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10
) {
  messageTemplate: 'file-not-found',
  messageData: { pattern: 'src', globDisabled: false }
}

It works if a glob is supplied:

npx eslint-nibble src/**/*.ts

Or if the ext flag is used:

npx eslint-nibble --ext .ts src
IanVS commented 1 year ago

Thanks for bringing this up. Would you be able to provide a small reproduction that I can look into?

IanVS commented 1 year ago

Closing from lack of response. Please share steps to reproduce if you're still experiencing this.