Comments (6)
Absolutely. This has actually been in some old version, but it will be back as a new feature after v1 lands.
from knip.
The feature to add paths
has been added in v1.6.0. Also see the docs at https://github.com/webpro/knip#paths.
from knip.
I am not entirely sure but I think knip only checks for tsconfig.json
but not other variations of that filename right?
With https://nx.dev/ which we use, it's common to have a tsconfig.base.json
(notice the name) at the root of the project.
When running knip without any config, I see our custom lib names as "Unlisted or unresolved dependencies".
When basically copying and pasting the paths from compilerOptions.paths
to knip.json
paths, these unresolved deps are gone. So I think it would make sense to support tsconfig.base.json
out of the box.
from knip.
Additionally, we have imports like ~/components/plans-details/TierCircle
which show up as unresolved.
The tsconfig.paths config for that is:
"~/*": ["./*"]
Just putting my 2 cents here since its related to import path aliases improvements 😄
from knip.
I am not entirely sure but I think knip only checks for
tsconfig.json
but not other variations of that filename right?With https://nx.dev/ which we use, it's common to have a
tsconfig.base.json
(notice the name) at the root of the project.When running knip without any config, I see our custom lib names as "Unlisted or unresolved dependencies". When basically copying and pasting the paths from
compilerOptions.paths
toknip.json
paths, these unresolved deps are gone. So I think it would make sense to supporttsconfig.base.json
out of the box.
The default is indeed tsconfig.json
(in root and/or in any workspace package). This can be overridden using -t
or --tsConfig
. When there is an extends
in the TS config, that should work fine, too. You should not need to manually copy over the paths
when using TS config.
from knip.
Going to close this one as I think the original issue is resolved.
from knip.
Related Issues (20)
- Failed to find tsconfig files being extended with "ENOENT: no such file or directory, ..." HOT 6
- `Reason: Unexpected identifier 'Promise'` error on fresh Sveltekit project HOT 1
- `main` property definition is missing in `package.json` HOT 1
- Request new plugins here HOT 10
- Webpack plugin breaks if `--env` vars are used HOT 4
- TypeError: Cannot read properties of undefined (reading 'length') HOT 3
- 'playwright-ct' is missing in `KnipConfig` type HOT 1
- False positive for "Unlisted binaries" with pnpm HOT 3
- webpack detection should recognize either `webpack` or `webpack-cli` in `devDependencies` HOT 1
- Object destructuring assignment not recognized as reference HOT 2
- Suggestion: support finding references in MDX HOT 2
- lint-staged reported as unused with husky 9 after install HOT 2
- ELIFECYCLE Command failed with exit code 1. HOT 11
- False positive with exported interface HOT 2
- Add support for unused (never set) properties in interfaces / inline types HOT 1
- npm packages typed via `*.d.ts` reported as unused HOT 3
- disable rule for workspace HOT 1
- knip.mjs config file listed as unused file HOT 1
- `declare module '*.foo'` reported as unlisted dependencies HOT 4
- Donating Funds to knip HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knip.