Closed jmmendivil closed 3 years ago
Thanks for the bug report. This is related to https://github.com/typescript-eslint/typescript-eslint/issues/885
It seems I overlooked implementing the --stdin-filename
flag. I have implemented the flag in https://github.com/toddbluhm/ts-standard/pull/92 and confirmed that --stdin
with --stdin-filename
works. The CLI now also exits with an error if you try to use --stdin
without the --stdin-filename
flag.
My setup was as follows:
Folder structure
src/simple.ts
package.json
tsconfig.eslint.json
tsconfig.json
My tsconfig.json
and tsconfig.eslint.json
files uses src/**/*
for includes
.
In package.json
I had the following script:
cat ./src/simple.ts | ts-standard --stdin --stdin-filename ./src/simple.ts
I also testing out the --fix
flag and confirmed that worked also by using this script:
cat ./src/simple.ts | ts-standard --stdin --stdin-filename ./src/simple.ts --fix | tee ./src/simple.ts
If you are still running into issues, I can post the full example project and/or provide more detailed specifics.
I am so sorry for the delay on this! 10.0.0
has been released with a fix for this as well as a migration to the official standard
org.
@toddbluhm I've found this while trying to configure ALE to use ts-standard
rather than standard
for typescript files. Is the ts-standard --stdin
interface fully compatible with standard
counterpart?
Thx and keep up the good work ;)
@lorenzogrv The interface should be fully compatible with the exception that the --stdin-filename
flag with the file path needs to also be provided.
The typescript compiler/linter requires the path in order to properly lint the file (it still uses the stdin
data for linting and outputs to stdout
but the parser underneath requires the file path). I was unable to find a way around this requirement. If you are unable to provide the file path, then it will not work for your use case.
If --stdin
is not working as expected, feel free to open a bug report for us to look into 😄 I do not actively use the --stdin
flag so it could very well be broken.
@toddbluhm Thanks! Need to dig more, but knowing about --stdin-filename
is useful information.
While I have been using JavaScript and standard for years, I'm a beginer within typescript, so will research more before opening a bug report. I'm sure the experimental setup I did for ALE is not correct. Anyway your clues about --stdin
fragility may put me in the path to integrate successfully within my beloved vim
.
Keep up the good work :+1:
Hey, thank you, great project.
I would like to use it with ale (vim) for asynchronous lint, but it seems stdin isn't working as expected.
simple.ts
Output from
ts-standard ./src/simple.ts
All fine.
But if I do
cat ./src/simple.ts | ts-standard --stdin
Am I missing something?
macos 10.15.4 node v10.15.1 npm 6.14.7