Re:Oxlint – written in Rust – 50-100 Times Faster than ESLint
by thfuran on Friday December 15, 2023 @08:58AM
(#38654210)
>Do you have some source files that are somehow exempt from bugs and would be a waste of the linter's time?
Every file not touched in any given diff
Re:Oxlint – written in Rust – 50-100 Times Faster than ESLint
by OJFord on Friday December 15, 2023 @09:10AM
(#38654312)
What if the diff adds a new linter rule, should we only run it on the linter config file?
What if the linter uses more context than a single file, a type-checker for example or even just checking the correct number of arguments (regardless of type) are passed to an imported function - or that that symbol is indeed even callable? Should we only run the linter on the caller's file, or the callee's, when they haven't both changed?
Re:Oxlint – written in Rust – 50-100 Times Faster than ESLint
by ehutch79 on Friday December 15, 2023 @09:23AM
(#38654457)
Run the linter on the code base then, when you make the change? Not every check-in on the off chance a rule changed. Or, add some logic that the CI runs it against the whole code base only when the rules changed, otherwise just the relevant files to the commit/pr
Also, ESLint doesn't do type checking. That's typescripts job, and apparently typescripts runtime isn't an issue.
Re:Oxlint – written in Rust – 50-100 Times Faster than ESLint
by spenczar5 on Friday December 15, 2023 @09:49AM
(#38654707)
If a different (unchanged) file depends on the one you changed, you could have changed the API in a way that makes the unchanged file unacceptable to your linter.
Re:Oxlint – written in Rust – 50-100 Times Faster than ESLint
by Shish2k on Friday December 15, 2023 @09:49AM
(#38654705)
If I change a function signature, then my code is fine - but all the other files which import and use my function will break
Re:Oxlint – written in Rust – 50-100 Times Faster than ESLint
by zdragnar on Friday December 15, 2023 @09:53AM
(#38654745)
That's a job for TypeScript, not eslint.
Re:Oxlint – written in Rust – 50-100 Times Faster than ESLint
by kristiandupont on Friday December 15, 2023 @12:56PM
(#38656682)
Linter rules can rely on the type system
Re:Oxlint – written in Rust – 50-100 Times Faster than ESLint
by zdragnar on Friday December 15, 2023 @01:55PM
(#38657299)
What eslint rule would apply to the caller of a function after that function's signature changes that wouldn't also be picked up by TypeScript?
In particular, the call site itself hasn't changed, as this thread assumes the linter is only run on changed files
Re:Oxlint – written in Rust – 50-100 Times Faster than ESLint
by kristiandupont on Friday December 15, 2023 @03:14PM
(#38658264)
Anamexis has a couple of examples in this response: https://news.ycombinator.com/item?id=38655101
Probably not, but it's a trick question: if you try to look for exceptions to the rule, you have already wasted so much time that running a linter on all files would be faster.