Skip to content

Commit

Permalink
chore: update knip & config (freeCodeCamp#48963)
Browse files Browse the repository at this point in the history
* Re-add knip to manifest devDependencies

* Move updated config to root folder

* Move knip back to `npx y` in npm script

Also see freeCodeCamp#48963 (review)

* Bump knip to fix dependency issue
  • Loading branch information
webpro authored Jan 9, 2023
1 parent a650777 commit a4795b4
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 56 deletions.
27 changes: 0 additions & 27 deletions config/knip/knip.dev.json

This file was deleted.

27 changes: 0 additions & 27 deletions config/knip/knip.json

This file was deleted.

42 changes: 42 additions & 0 deletions knip.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"$schema": "https://unpkg.com/knip@next/schema.json",

"ignore": "**/*.d.ts",
"ignoreBinaries": ["cd", "echo", "sh"],

// Only workspaces with a configuration below are analyzed by Knip
"workspaces": {
".": {
"entry": [],
// Configuration options can be overridden individually (necessary here as the default is `cypress/e2e/**/*.cy.{js,jsx,ts,tsx}`).
"cypress": ["cypress.config.js", "cypress/e2e/**/*.{js,ts}"]
},
"client": {
// Files used by Gatsby are handled by Knip's Gatsby plugin (https://github.com/webpro/knip/blob/next/src/plugins/gatsby/README.md)
// The rest are `webpack.entry` files.
"entry": [],
"project": ["**/*.{js,ts,tsx}"],
"webpack": {
"config": "webpack-workers.js",
"entry": [
"src/client/frame-runner.ts",
"src/client/workers/sass-compile.ts",
"src/client/workers/test-evaluator.ts"
]
},
"ignore": ["i18n/schema-validation.*", "**/__mocks__", "**/__fixtures__"]
},
"client/plugins/*": {
"entry": "gatsby-node.js"
},
// This monospace gives a few unused files, so as not to make the node.js-find-unused workflow fail this is still commented out
// Also try --production to find more unused files.
// "tools/ui-components": {
// "entry": ["src/index.ts!", "utils/gen-component-script.ts"],
// "project": ["src/**/*.{ts,tsx}!", "utils/*.ts"]
// },
"tools/scripts/build": {
"entry": ["*.ts"]
}
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
"format:prettier": "prettier --write .",
"hooks:install": "node node_modules/husky/husky.js install",
"hooks:uninstall": "node node_modules/husky/husky.js uninstall",
"knip": "npx -y knip -c config/knip/knip.json --dir client --include files",
"knip:client": "npx -y knip -c config/knip/knip.json --dir client",
"knip": "npx -y knip@^1.0.0-beta.10 --include files",
"knip:all": "npx -y knip@^1.0.0-beta.10",
"prelint": "npm run -w=client predevelop",
"lint": "npm-run-all create:* -p lint:*",
"lint:challenges": "cd ./curriculum && npm run lint",
Expand Down

0 comments on commit a4795b4

Please sign in to comment.