Skip to content

docs(readme): document unsupported TS compiler options #124

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

Merged
merged 2 commits into from
Mar 26, 2020

Conversation

joelmukuthu
Copy link
Contributor

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR relates to an outstanding issue, so please reference it in your PR, or create an explanatory one for discussion. In many cases features are absent for a reason. From this comment on issue Autosubscriptions not working in <script> #98
  • This message body should clearly illustrate what problems it solves. If there are related issues, remember to reference them. N/A
  • Ideally, include a test that fails without this PR but passes with it. PRs will only be merged once they pass CI. (Remember to npm run lint!) N/A

Tests

  • Run the tests tests with npm test or yarn test not necessary, I think.

@kaisermann
Copy link
Member

Just came to my mind that we can, apart from documenting, override them in the typescript transformer: https://github.com/kaisermann/svelte-preprocess/blob/master/src/transformers/typescript.ts#L198.

What do you think?

@joelmukuthu
Copy link
Contributor Author

Hmm, I think that might cause some confusion. I think a better option is maybe to warn the user if they try to use unsupported options. I can work on that too but probably won't be till next weekend.

I'd also like to add a little more info to the README as to why they're not supported, but frankly I'm a bit confused myself. I have this setup:

  • noUnusedLocals: true in tsconfig.json
  • typescript: { tsconfigFile: './tsconfig.json' } in svelte-preprocess's options
  • an unused local variable in a script lang="typescript" tag in a Svelte component

Building the project via webpack works while running tests on Jest (with ts-jest transforming TS to JS) fails with a ParseError: Unexpected character '�' error thrown by the svelte compiler. Does svelte-preprocess already ignore/bypass the TS compilation errors?

@kaisermann
Copy link
Member

svelte-preprocess ignores only some import related diagnostics. Can you provide a minimal repro project?

@kaisermann kaisermann merged commit 145e346 into sveltejs:master Mar 26, 2020
@joelmukuthu
Copy link
Contributor Author

@kaisermann you're right. I have a setup where a lot was going on and I couldn't reproduce it in a smaller project. Thank you for your time!

joelmukuthu added a commit to joelmukuthu/svelte-typescript-jest-webpack that referenced this pull request Mar 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants