azz / prettier-tslint

Code ➡️ prettier ➡️ tslint --fix ➡️ Formatted Code ✨
https://npm.im/prettier-tslint
MIT License
225 stars 13 forks source link

Honor prettier's --with-node-modules flag #20

Closed mschnee closed 4 years ago

mschnee commented 6 years ago

The following code in expand-globs.js ignores and bypasses .prettierignore as well as prettier's --with-node-modules options, as well as a direct path to a file under a node_modules folder:

return globby.sync([...globs, "!**/node_modules/**", "!./node_modules/**"],{
  dot: true,
});

This means prettier-tslint will skip any file in a monorepository or workspace organized to leverage node's module-resolution, e.g.

prettier-tslint fix --with-node-modules ./packages/node_modules/@scope/packageName/src/path/to/file.ts

This PR takes the same approach to addressing this problem that prettier did: with the addition of a --with-node-modules flag. It appears to also "just work" with vscode integration.

I have also added additional tests for expand-globs.js.

mschnee commented 4 years ago

Closing as stale. @typescript-eslint