Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--stdin-filename option is gone and now stdin is completely broken again #273

Open
mrpeabody opened this issue Oct 27, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@mrpeabody
Copy link

What version of this package are you using?

The most recent 12.0.1

What operating system, Node.js, and npm version?
Ubuntu 22.04 LTS, Node v14.19.3, NPM 6.14.17
What happened?

ts-standard does not support reading files from stdin. Previous workaround was to specify the --stdin-filename option which is not available anymore.

Easy to repro: have a type import in a .ts file (import type { ... ] from '...') and then check the file from stdin:

ts-standard --stdin < <filename>.ts

Output:

ts-standard: Standard for TypeScript! (https://github.com/standard/ts-standard)
  <text>:18:13: Parsing error: Unexpected token { (null)

Regular check works fine: ts-standard <filename>.ts

ts-standard: Standard for TypeScript! (https://github.com/standard/ts-standard)
ts-standard: Run `ts-standard --fix` to automatically fix some problems.
  <path>.ts:116:20: A space is required after '{'. (@typescript-eslint/object-curly-spacing)
  <path>.ts:116:43: A space is required before '}'. (@typescript-eslint/object-curly-spacing)

What did you expect to happen?

I'd expect it to work (that is, either fix --stdin or return --stdin-filename option back)

Are you willing to submit a pull request to fix this bug?

@jxpx777
Copy link

jxpx777 commented Nov 3, 2023

I ran into this myself when trying to get ALE working with a Typescript project. It looks like this was removed in 12.0 during the rewrite to use standard-engine. What's not clear to me is if this is a compatibility problem with standard-engine or if this was just an oversight during that migration. Downgrading to ts-standard@11 flagged incompatibilities with the latest Typescript version. 😞 I just changed ALE back to using ESLint… it's not as nice as just using ts-standard, but at least it works without errors.

#83

jxpx777 added a commit to Wafris/node-wafris that referenced this issue Dec 16, 2023
Using the Standard Typescript ESLint but specifically _not_ using `ts-standard` because it does not play nice with e.g. `vim-test`. See standard/ts-standard#273

Editorconfig, ESLint, and Prettier _can_ all play nicely together and using them together helps focus the purpose of changes. For more, see https://blog.theodo.com/2019/08/empower-your-dev-environment-with-eslint-prettier-and-editorconfig-with-no-conflicts/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

3 participants