Conversation
webpro
left a comment
There was a problem hiding this comment.
Thanks for the PR, Aaron! Much appreciated. Just not sure I agree with the isEnabled changes. Any chance you could take a look?
| @@ -1,4 +1,4 @@ | |||
| { | |||
| "extension": ["ts"], | |||
There was a problem hiding this comment.
There is https://mochajs.org/#-extension-ext or is this only supported as command-line argument?
There was a problem hiding this comment.
I removed it from the test because the plugin doesn't support it and spec with a glob overrules it. Figured the test should be matched to the plugin implementation.
commit: |
|
Thanks, Aaron! Much appreciated. Good discussion to better understand how Knip's being used, feel free to open other issues/RFCs/PRs as you see fit. |
|
🚀 This pull request is included in v5.57.0. See Release 5.57.0 for release notes. Using Knip in a commercial project? Please consider becoming a sponsor. |
The
mochaplugin has the following issues:mochain source code, but Mocha does not.ts-node/registerordotenv/config) in therequiresconfiguration field.The
mochatest has the following issues:isEnabledreturns false since the fixture package.json dependencies do not includemocha; so it does not actually test the pluginextension, which plugin does not support, and does not havespecwhich the plugin does supportThis PR addresses:
isEnabledwill return true if default Mocha config file is present.resolveConfigaddsmochadependencyresolveConfigsupports both entries and dependencies from therequirefieldspecinstead ofextensionmocha,@types/mocha, andts-nodedependencies in package.jsonrequire