chore: update knip & config (#48963)

* Re-add knip to manifest devDependencies

* Move updated config to root folder

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

Also see https://github.com/freeCodeCamp/freeCodeCamp/pull/48963#pullrequestreview-1239748056

* Bump knip to fix dependency issue
This commit is contained in:
Lars Kappert
2023-01-09 16:55:28 +01:00
committed by GitHub
parent a65077701f
commit a4795b41c3
4 changed files with 44 additions and 56 deletions
-27
View File
@@ -1,27 +0,0 @@
{
"client":{
"dev": true,
"exclude": ["dependencies"],
"entryFiles": [
"gatsby-*.js",
"src/pages/*.tsx",
"src/templates/Challenges/**/{s,S}how.tsx",
"src/templates/Introduction/**/{intro,super-block-intro}.tsx",
"src/**/*.test.{js,ts,tsx}"
],
"projectFiles": [
"src/**/*.{js,ts,tsx}",
"!static/misc/*.js",
"!i18n/schema-validation.ts",
"!plugins/**",
"!postcss.config.js",
"!src/client/frame-runner.ts",
"!src/client/workers/**",
"!webpack-workers.js",
"!**/i18n/config-for-tests.ts",
"!**/__mocks__/**",
"!**/__fixtures/**",
"!**/node_modules/**"
]
}
}
-27
View File
@@ -1,27 +0,0 @@
{
"client":{
"exclude": ["dependencies"],
"entryFiles": [
"gatsby-*.js",
"src/html.tsx",
"src/pages/*.tsx",
"src/templates/Challenges/**/{s,S}how.tsx",
"src/templates/Introduction/**/{intro,super-block-intro}.tsx",
"**/*.test.{js,ts,tsx}"
],
"projectFiles": [
"**/*.{js,ts,tsx}",
"!static/misc/*.js",
"!i18n/schema-validation.ts",
"!plugins/**",
"!postcss.config.js",
"!src/client/frame-runner.ts",
"!src/client/workers/**",
"!webpack-workers.js",
"!**/__mocks__/**",
"!**/__fixtures/**",
"!**/node_modules/**",
"!**/*.d.ts"
]
}
}
+42
View File
@@ -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"]
}
}
}
+2 -2
View File
@@ -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",