Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
kazushisan
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
Show HN: lscode – TypeScript's LanguageService for AI Coding Agents
(github.com)
2 points
by
kazushisan
9mo ago
|
0 comments
2.
▲
Detect and remove dead code automatically with "TypeScript Remove (tsr)"
(kazushikonosu.io)
2 points
by
kazushisan
2y ago
|
2 comments
3.
▲
TypeScript Remove (tsr) removes unused code from TypeScript projects
(github.com)
1 points
by
kazushisan
2y ago
|
1 comments
4.
▲
by
kazushisan
2y ago
A few months back I posted a Show HN to share my idea about removing unused code in TypeScript projects automatically by statically analyzing the codebase: https://news.ycombinator.com/item?id=41554014 I didn't expect
5.
▲
by
kazushisan
2y ago
I'm not trying to be offensive here, but I've realized that the design choices of the tool and the explanation in README was a little too difficult and unfriendly for the average TypeScript user. I've added a more detailed ex
6.
▲
by
kazushisan
2y ago
I wont go into detail about what it is (since the docs are good enough) but in short, it's a feature to let you setup multiple TypeScript projects in the same repo. Some things that project references will solve: - importing test files
7.
▲
by
kazushisan
2y ago
Thanks! will work on a fix. my original assumption was that users would `npm i` beforehand.
8.
▲
by
kazushisan
2y ago
possibly... not a priority at this moment but contributions are welcome!
9.
▲
by
kazushisan
2y ago
You need a valid tsconfig that defines the scope of the project and it seems renovate’s tsconfig doesn’t meet this requirement. You can always --skip manually as an alternative option.
10.
▲
by
kazushisan
2y ago
I’ve been using it for my next.js project and passing something like `/pages\//` to `skip` was good enough for me… Is there something I’m missing out?
11.
▲
by
kazushisan
2y ago
My understanding is that Knip is for detecting unused things and that it's auto-fix feature is still experimental, but with that out of the way... - In general, I personally do not like the idea of having to add another config file in
12.
▲
by
kazushisan
2y ago
I may be opinionated but I believe that the best practice is to configure a separate tsconfig for test files with project references. As long as the test files are not included in the tsconfig passed to ts-remove-unused, it should remove ex
13.
▲
by
kazushisan
2y ago
Perhaps you need to specify skip option for the entry point file?
14.
▲
by
kazushisan
2y ago
I was initially using it but decided to write my own tool because I was too lazy to go through the result of ts-prune and delete the code myself :P
15.
▲
by
kazushisan
2y ago
Thanks for the input! I think there may be a misunderstanding about what this does. Existing linters work great for detecting unused code within a file but once you add `export` to it, you can’t detect unused code with linters even if it’s
16.
▲
by
kazushisan
2y ago
I’m sorry that it may have been unclear that the tool will make modifications without the check flag. I’m glad you didn’t loose any unstated changes :) I will add a cautionary note to README to make it clear!
17.
▲
Show HN: ts-remove-unused – Remove unused code from your TypeScript project
(github.com)
141 points
by
kazushisan
2y ago
|
66 comments