question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

svelte-check: check only files mentioned as arguments

See original GitHub issue

I’m using lint-staged with husky to automatically lint files before commits. In large codebases it could be useful to lint only the changed files

If this is not possible because it needs to read the entire workspace to validate even a single file, then I don’t think this feature is worth the effort

example usage:

svelte-check src/app.svelte src/button.svelte

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dummdidummcommented, Oct 11, 2020

If we would construct a module graph we would need to read all files anyway. I also would not want to implement such a module resolution myself and rather rely on the ts language service to do this. The second step would be to do some kind of “find references” on each changed file and then delete all unreferenced from the language server. I’m not sure this would save that much time in the end. The --incremental flag sounds like a more promising solution to speed things up. But I’m not sure if we should magically use that flag, maybe rather add a readme entry like “takes too long? Try incremental builds”.

0reactions
AlexAegiscommented, Oct 11, 2020

means the TypeScript compiler cannot reuse the previous output and will likely take longer to construct the new program

Could incremental builds aleviate this? https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html

svelte-check is not a per-file linter, it also does checks across svelte files.

I feared that in the issue description. For this svelte-check would need to use the provided file list as an affected module list and traverse the directly referenced modules and check those too. TypeScript compilation would be needed but if the aforementioned incremental builds are viable (Maybe not? I don’t know if the svelte compiler would need a similar functionality for this to be viable) then it would be possible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docs • Svelte
Complete documentation for Svelte.
Read more >
Advanced routing • Docs • SvelteKit
Rest parameters​​ svelte will match /a/z (i.e. there's no parameter at all) as well as /a/b/z and /a/b/c/z and so on. Make sure...
Read more >
Configuration • Docs • SvelteKit
Your project's configuration lives in a svelte.config.js file at the root of your project. As well as SvelteKit, this config object is used...
Read more >
Command Line Interface • Docs • SvelteKit
svelte -kit sync creates the generated files for your project such as types and a tsconfig.json . When you create a new project,...
Read more >
Form actions • Docs • SvelteKit
A +page.server.js file can export actions, which allow you to POST data to ... To invoke a named action, add a query parameter...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found