Skip to content

Commit 5c2989f

Browse files
authored
chore: add knip to validate included dependencies
1 parent a777fd1 commit 5c2989f

File tree

5 files changed

+1107
-4623
lines changed

5 files changed

+1107
-4623
lines changed

.knip.jsonc

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"$schema": "https://unpkg.com/knip@5/schema-jsonc.json",
3+
"entry": [
4+
"bin/mocha.js!",
5+
"bin/_mocha!",
6+
"browser-entry.js!",
7+
"index.js!",
8+
"lib/cli/index.js!",
9+
".eleventy.js",
10+
"karma.conf.js"
11+
],
12+
"project": [
13+
"{bin,lib,scripts,test}/**/*.{js,ts,mjs,cjs}"
14+
],
15+
"ignore": [
16+
"test/integration/fixtures/esm/type-module/test-that-imports-non-existing-module.fixture.js",
17+
"test/integration/fixtures/options/watch/test-with-dependency.fixture.js"
18+
],
19+
"ignoreDependencies": [
20+
"@mocha/docdash",
21+
"coffeescript",
22+
"fake",
23+
"jsdoc-ts-utils",
24+
"karma-chrome-launcher",
25+
"karma-mocha-reporter",
26+
"karma-mocha",
27+
"karma-sauce-launcher",
28+
"non-existent-package"
29+
],
30+
"mocha": {
31+
"entry": ["test/**/*.{js,ts,mjs,cjs}"]
32+
},
33+
"webpack": {
34+
"config": "test/browser-specific/fixtures/webpack/webpack.config.js"
35+
},
36+
"rules": {
37+
"exports": "off"
38+
}
39+
}

lib/cli/commands.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
* @module
88
*/
99

10-
exports.init = require('./init');
11-
12-
// default command
13-
exports.run = require('./run');
10+
module.exports = {
11+
init: require('./init'),
12+
// default command
13+
run: require('./run'),
14+
}

lib/cli/run.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const {
2424
} = require('./run-helpers');
2525
const {ONE_AND_DONES, ONE_AND_DONE_ARGS} = require('./one-and-dones');
2626
const debug = require('debug')('mocha:cli:run');
27-
const defaults = require('../mocharc');
27+
const defaults = require('../mocharc.json');
2828
const {types, aliases} = require('./run-option-metadata');
2929

3030
/**

0 commit comments

Comments
 (0)