Skip to content

Commit f22e400

Browse files
authored
feat(tools): introduce knip to find unused files, dependencies & exports (freeCodeCamp#47836)
* chore(deps): add exportman to devDependencies * chore(client): add exportman config for /client folder * chore: migrate from exportman to knip * chore: add npm script * chore: prepare npm script for usage in CI
1 parent 130634d commit f22e400

File tree

4 files changed

+349
-11
lines changed

4 files changed

+349
-11
lines changed

config/knip/knip.dev.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"client":{
3+
"dev": true,
4+
"exclude": ["dependencies"],
5+
"entryFiles": [
6+
"gatsby-*.js",
7+
"src/pages/*.tsx",
8+
"src/templates/Challenges/**/{s,S}how.tsx",
9+
"src/templates/Introduction/**/{intro,super-block-intro}.tsx",
10+
"src/**/*.test.{js,ts,tsx}"
11+
],
12+
"projectFiles": [
13+
"src/**/*.{js,ts,tsx}",
14+
"!static/misc/*.js",
15+
"!i18n/schema-validation.ts",
16+
"!plugins/**",
17+
"!postcss.config.js",
18+
"!src/client/frame-runner.ts",
19+
"!src/client/workers/**",
20+
"!webpack-workers.js",
21+
"!**/i18n/config-for-tests.ts",
22+
"!**/__mocks__/**",
23+
"!**/__fixtures/**",
24+
"!**/node_modules/**"
25+
]
26+
}
27+
}

config/knip/knip.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"client":{
3+
"exclude": ["dependencies"],
4+
"entryFiles": [
5+
"gatsby-*.js",
6+
"src/html.tsx",
7+
"src/pages/*.tsx",
8+
"src/templates/Challenges/**/{s,S}how.tsx",
9+
"src/templates/Introduction/**/{intro,super-block-intro}.tsx"
10+
],
11+
"projectFiles": [
12+
"**/*.{js,ts,tsx}",
13+
"!static/misc/*.js",
14+
"!i18n/schema-validation.ts",
15+
"!plugins/**",
16+
"!postcss.config.js",
17+
"!src/client/frame-runner.ts",
18+
"!src/client/workers/**",
19+
"!webpack-workers.js",
20+
"!**/*.test.{js,ts,tsx}",
21+
"!**/i18n/config-for-tests.ts",
22+
"!**/__mocks__/**",
23+
"!**/__fixtures/**",
24+
"!**/node_modules/**",
25+
"!**/*.d.ts"
26+
]
27+
}
28+
}

0 commit comments

Comments
 (0)