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