svelte-check: check only files mentioned as arguments
See original GitHub issueI’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:
- Created 3 years ago
- Reactions:5
- Comments:5 (3 by maintainers)
Top Results From Across the Web
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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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”.Could incremental builds aleviate this? https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html
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.