@@ -2,25 +2,62 @@ import type { KnipConfig } from 'knip';
22
33const config : KnipConfig = {
44 // ! at the end means files are used in production
5- entry : [ 'node_package/src/ReactOnRails.ts!' , 'node_package/src/ReactOnRails.node.ts!' ] ,
6- project : [ 'node_package/src/**/*.[jt]s!' , 'node_package/tests/**/*.[jt]s' ] ,
7- ignoreBinaries : [
8- // Knip fails to detect it's declared in devDependencies
9- 'nps' ,
10- // local scripts
11- 'node_package/scripts/.*' ,
12- ] ,
13- ignoreDependencies : [
14- // Required for TypeScript compilation, but we don't depend on Turbolinks itself.
15- '@types/turbolinks' ,
16- // used in package-scripts.yml
17- 'concurrently' ,
18- // The Knip ESLint plugin fails to detect it's transitively required by a config,
19- // though we don't actually use its rules anywhere.
20- 'eslint-plugin-jsx-a11y' ,
21- ] ,
22- babel : {
23- config : [ 'node_package/babel.config.js' , 'package.json' ] ,
5+ workspaces : {
6+ '.' : {
7+ entry : [ 'node_package/src/ReactOnRails.ts!' , 'node_package/src/ReactOnRails.node.ts!' ] ,
8+ project : [ 'node_package/src/**/*.[jt]s!' , 'node_package/tests/**/*.[jt]s' ] ,
9+ ignoreBinaries : [
10+ // Knip fails to detect it's declared in devDependencies
11+ 'nps' ,
12+ // local scripts
13+ 'node_package/scripts/.*' ,
14+ ] ,
15+ ignoreDependencies : [
16+ // Required for TypeScript compilation, but we don't depend on Turbolinks itself.
17+ '@types/turbolinks' ,
18+ // used in package-scripts.yml
19+ 'concurrently' ,
20+ // The Knip ESLint plugin fails to detect it's transitively required by a config,
21+ // though we don't actually use its rules anywhere.
22+ 'eslint-plugin-jsx-a11y' ,
23+ ] ,
24+ babel : {
25+ config : [ 'node_package/babel.config.js' ] ,
26+ } ,
27+ } ,
28+ 'spec/dummy' : {
29+ entry : [
30+ 'app/assets/config/manifest.js!' ,
31+ 'client/app/packs/**/*.js!' ,
32+ // Not sure why this isn't detected as a dependency of client/app/packs/server-bundle.js
33+ 'client/app/generated/server-bundle-generated.js!' ,
34+ 'spec/fixtures/automated_packs_generation/**/*.js{x,}' ,
35+ 'config/webpack/{production,development,test}.js' ,
36+ // Declaring this as webpack.config instead doesn't work correctly
37+ 'config/webpack/webpack.config.js' ,
38+ ] ,
39+ project : [
40+ '**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}!' ,
41+ 'config/webpack/*.js' ,
42+ ] ,
43+ paths : {
44+ 'Assets/*' : [ 'client/app/assets/*' ] ,
45+ } ,
46+ ignoreBinaries : [
47+ // Has to be installed globally
48+ 'yalc' ,
49+ // Local binaries
50+ 'bin/.*' ,
51+ ] ,
52+ ignoreDependencies : [
53+ // There's no ReScript plugin for Knip
54+ '@rescript/react' ,
55+ // The Babel plugin fails to detect it
56+ 'babel-plugin-transform-react-remove-prop-types' ,
57+ // Temporary!
58+ '.*' ,
59+ ] ,
60+ } ,
2461 } ,
2562} ;
2663
0 commit comments