Skip to content

Commit

Permalink
🚧chore:migrate unimported to knip
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasWerey committed Oct 7, 2024
1 parent 76947d8 commit ad56ac2
Show file tree
Hide file tree
Showing 17 changed files with 4,401 additions and 3,059 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-desktop-external-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
name: lint-desktop-external
path: ${{ github.workspace }}/apps/ledger-live-desktop/lint-desktop-external.json
- name: check for dead code
run: pnpm desktop unimported
run: pnpm knip-check --filter=./apps/ledger-live-desktop
shell: bash

unit-tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-desktop-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
name: lint-desktop
path: ${{ github.workspace }}/apps/ledger-live-desktop/lint-desktop.json
- name: check for dead code
run: pnpm desktop unimported
run: pnpm knip-check --filter=./apps/ledger-live-desktop
shell: bash

unit-tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-mobile-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Run linter
run: pnpm lint --filter="live-mobile" --api="http://127.0.0.1:${{ steps.toolchain.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo" -- --format="json" -o="lint-mobile.json"
- name: check for dead code
run: pnpm mobile unimported
run: pnpm knip-check --filter="live-mobile"
shell: bash
- name: Run code checkers
run: pnpm typecheck --filter="live-mobile" --api="http://127.0.0.1:${{ steps.toolchain.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo"
Expand Down
39 changes: 0 additions & 39 deletions apps/ledger-live-desktop/.unimportedrc.json

This file was deleted.

4 changes: 2 additions & 2 deletions apps/ledger-live-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"test:playwright:clean": "git clean -fdX tests/artifacts",
"typecheck": "node scripts/typecheck.js",
"check": "pnpm lint; pnpm typecheck",
"unimported": "unimported",
"assets:replace": "zx ./scripts/replace-assets.mjs"
"assets:replace": "zx ./scripts/replace-assets.mjs",
"knip-check": "pnpm knip --directory ../.. --workspace apps/ledger-live-desktop"
},
"dependencies": {
"@braze/web-sdk": "^4.6.3",
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

45 changes: 0 additions & 45 deletions apps/ledger-live-mobile/.unimportedrc.json

This file was deleted.

4 changes: 2 additions & 2 deletions apps/ledger-live-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
"download-hermes-profile": "zx ./scripts/download-hermes-profile.mjs",
"e2e:loadConfig": "ts-node ./e2e/bridge/start-server.ts",
"check": "pnpm lint; pnpm typecheck",
"unimported": "unimported",
"assets:replace": "zx ./scripts/replace-assets.mjs"
"assets:replace": "zx ./scripts/replace-assets.mjs",
"knip-check": "pnpm knip --directory ../.. --workspace apps/ledger-live-mobile"
},
"dependencies": {
"@azure/core-asynciterator-polyfill": "^1.0.2",
Expand Down
19 changes: 0 additions & 19 deletions apps/ledger-live-mobile/src/logic/keyboardVisible.ts

This file was deleted.

45 changes: 45 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"rules": {
"binaries": "off",
"classMembers": "off",
"dependencies": "error",
"devDependencies": "off",
"optionalPeerDependencies": "off",
"duplicates": "warn",
"enumMembers": "error",
"exports": "error",
"files": "error",
"nsExports": "off",
"nsTypes": "off",
"types": "error",
"unlisted": "off",
"unresolved": "off"
},
"ignoreExportsUsedInFile": true,

"workspaces": {
"./apps/ledger-live-desktop": {
"entry": [
"src/index.ts",
"src/renderer/index.ts",
"src/preloader/index.ts",
"src/renderer/webworkers/workers/*.ts",
"src/webviewPreloader/dappPreloader.ts",
"src/webviewPreloader/index.ts"
],
"project": ["src/**"],
"ignore": ["src/**/__integration__/**"],
"ignoreBinaries": ["eslint", "knip", "prettier", "zx", "lint"],
"ignoreDependencies": ["prop-types", "allure-commandline", "msw"]
},

"./apps/ledger-live-mobile": {
"entry": ["index.js"],
"project": ["src/**"],
"ignore": ["src/**/__integration__/**", "src/**/*.android.*", "src/**/*.ios.*"],
"ignoreBinaries": ["eslint", "knip", "prettier", "zx", "lint"],
"ignoreDependencies": []
}
}
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"lint:fix": "pnpm turbo lint:fix --no-daemon",
"typecheck": "pnpm turbo typecheck --no-daemon",
"unimported": "pnpm turbo unimported",
"knip-check": "pnpm turbo knip-check",
"desktop": "pnpm --filter ledger-live-desktop",
"cli": "pnpm --filter live-cli",
"coin": "pnpm --filter coin-framework",
Expand Down Expand Up @@ -171,6 +172,7 @@
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-prettier": "^5.0.1",
"knip": "^5.30.5",
"nyc": "^15.1.0",
"prettier": "^3.0.3",
"rimraf": "^4.4.1",
Expand Down
Loading

0 comments on commit ad56ac2

Please sign in to comment.