-
Notifications
You must be signed in to change notification settings - Fork 4k
Added knip config and action for unused files/exports #90642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
3420956
Added knip config and action for unused files/exports
shubham1206agra f7d32e1
Removed unused file
shubham1206agra 041c849
Removed unused file
shubham1206agra 83fb763
Fix action
shubham1206agra 1549f3f
Fix action
shubham1206agra 5bcad41
Improve action
shubham1206agra b13fadf
Improve action
shubham1206agra c18ffad
Improve action
shubham1206agra 53ab8a2
Merge branch 'main' of https://github.com/shubham1206agra/App into kn…
shubham1206agra e702af1
Improve action
shubham1206agra 5396063
Improve action
shubham1206agra d938c2d
Removed unused export
shubham1206agra 1c3911b
Fix ts
shubham1206agra 57abb0f
Merge branch 'main' of https://github.com/shubham1206agra/App into kn…
shubham1206agra 19bd514
Removed unused export
shubham1206agra d000299
Add knip-changed script
shubham1206agra 12ddc1a
Fix cspell
shubham1206agra 93365a8
Update knip version
shubham1206agra 29505ed
Merge main
shubham1206agra 6844c16
Removed unused export
shubham1206agra a56e7f1
Merge branch 'main' into knip-config
shubham1206agra 4129435
Improve action
shubham1206agra fcedc5f
Merge main
shubham1206agra 40de85e
Removed unused export
shubham1206agra 26c86f1
Merge branch 'main' into knip-config
shubham1206agra bc1217e
Fix ts
shubham1206agra d55edae
Removed unused export
shubham1206agra 7e2e013
Fix ESLint
shubham1206agra 4ac568a
Merge main
shubham1206agra 4898314
Add more files
shubham1206agra a962657
Merge branch 'Expensify:main' into knip-config
shubham1206agra 42a3c47
Apply suggestion from @shubham1206agra
shubham1206agra e148b58
Merge main
shubham1206agra 0171f04
Add more files
shubham1206agra 12365e6
Merge branch 'main' of https://github.com/shubham1206agra/App into kn…
shubham1206agra fbf873c
Add more files
shubham1206agra 0ca80e6
Fix ts
shubham1206agra ce7d886
Fix ESLint
shubham1206agra 158ec28
Merge branch 'main' of https://github.com/shubham1206agra/App into kn…
shubham1206agra b12e1ad
Add more files
shubham1206agra 4eedce7
Merge branch 'main' into knip-config
shubham1206agra a79a750
Merge branch 'main' into knip-config
shubham1206agra bf37d11
Add more files
shubham1206agra d6a9506
Merge main
shubham1206agra 63474e8
Add more files
shubham1206agra bdaa81c
Apply suggestions from code review
shubham1206agra ff6305f
Merge branch 'Expensify:main' into knip-config
shubham1206agra 388e30d
Merge branch 'main' into knip-config
shubham1206agra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: Knip check | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize] | ||
| branches-ignore: [staging, production] | ||
| paths: | ||
| - '**.js' | ||
| - '**.jsx' | ||
| - '**.ts' | ||
| - '**.tsx' | ||
| - '**.mjs' | ||
| - '**.cjs' | ||
| - 'knip.json' | ||
| - 'package.json' | ||
| - 'package-lock.json' | ||
| - 'patches/**' | ||
| - 'tsconfig.json' | ||
|
|
||
| concurrency: | ||
| group: ${{ github.ref == 'refs/heads/main' && format('{0}-{1}', github.ref, github.sha) || github.ref }}-knip | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| knip-compare: | ||
| name: Compare knip issues against main | ||
| runs-on: blacksmith-2vcpu-ubuntu-2404 | ||
| steps: | ||
| - name: Checkout PR | ||
| uses: useblacksmith/checkout@c9796daa2a4bdebdab5bd16be2c09a70cd4e1121 # v1 | ||
|
|
||
| - name: Setup Node | ||
| uses: ./.github/actions/composite/setupNode | ||
|
|
||
| - name: Run knip on PR | ||
| run: KNIP=true npx knip --reporter json --no-exit-code > /tmp/knip-pr.json | ||
|
|
||
| - name: Checkout main | ||
| run: | | ||
| git fetch origin main --no-tags --depth=1 | ||
| git checkout origin/main | ||
|
|
||
| - name: Run knip on main | ||
| run: KNIP=true npx knip --reporter json --no-exit-code > /tmp/knip-main.json | ||
|
shubham1206agra marked this conversation as resolved.
|
||
|
|
||
| - name: Restore PR workspace | ||
| run: git checkout ${{ github.sha }} | ||
|
|
||
| - name: Compare reports | ||
| run: npx ts-node ./scripts/compareKnipReports.ts --mainPath=/tmp/knip-main.json --prPath=/tmp/knip-pr.json | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| { | ||
| "entry": [ | ||
| "index.js", | ||
| "wdyr.ts", | ||
| "src/App.tsx", | ||
| "src/HybridAppHandler.tsx", | ||
| "scripts/**/*.{js,ts}", | ||
| "web/proxy.ts", | ||
| "config/webpack/**/*.{js,mjs,ts}", | ||
| ".github/scripts/**/*.ts", | ||
| ".github/actions/javascript/**/*.ts", | ||
| ".storybook/**/*.{js,ts,tsx}", | ||
| "metro.config.js", | ||
| "eslint.changed.config.mjs", | ||
| "react-native.config.js", | ||
| "rock.config.mjs" | ||
| ], | ||
| "project": [ | ||
| "src/**/*.{js,jsx,ts,tsx}", | ||
| "tests/**/*.{js,jsx,ts,tsx}", | ||
| "__mocks__/**/*.{js,jsx,ts,tsx}", | ||
| "web/**/*.{js,jsx,ts,tsx}", | ||
| "config/**/*.{js,mjs,ts,tsx}", | ||
| "scripts/**/*.{js,ts}", | ||
| "jest/**/*.{js,ts}", | ||
| ".storybook/**/*.{js,ts,tsx}", | ||
| ".github/actions/javascript/**/*.ts" | ||
| ], | ||
| "ignore": [".github/actions/**/index.js", "tests/perf-test/**", "web/snippets/gib.js"], | ||
| "ignoreDependencies": [ | ||
| "@expensify/react-native-hybrid-app", | ||
| "group-ib-fp", | ||
| "react-native-image-size", | ||
| "react-native-picker-select", | ||
| "lodash", | ||
| "@babel/plugin-proposal-private-methods", | ||
| "@babel/plugin-proposal-private-property-in-object", | ||
| "babel-plugin-module-resolver", | ||
| "babel-plugin-transform-remove-console", | ||
| "@fullstory/babel-plugin-react-native", | ||
| "eslint-config-airbnb-typescript", | ||
| "eslint-config-prettier", | ||
| "eslint-plugin-storybook", | ||
| "@dword-design/eslint-plugin-import-alias", | ||
| "tsconfig-paths", | ||
| "@vercel/ncc", | ||
| "shellcheck", | ||
| "patch-package", | ||
| "diff-so-fancy" | ||
| ], | ||
| "ignoreBinaries": ["metro-symbolicate", "mkcert"], | ||
| "eslint": { | ||
| "config": ["config/eslint/eslint.config.mjs", "eslint.changed.config.mjs"] | ||
| }, | ||
| "webpack": { | ||
| "config": ["config/webpack/webpack.common.ts"] | ||
| }, | ||
| "babel": { | ||
| "config": ["babel.config.js"] | ||
| }, | ||
| "jest": { | ||
| "config": ["jest.config.js"] | ||
| }, | ||
| "storybook": { | ||
| "config": [".storybook/main.ts"] | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.