Skip to content

Commit a7b0ff0

Browse files
authored
chore: Clean up unused code (#395)
## Description This PR adds unused code check which ensures that there is no dead code in the package and everything that is marked as exported is used in other files (I don't forget to export types or sth else from the library entry point).
1 parent e2df3f4 commit a7b0ff0

File tree

33 files changed

+1282
-1083
lines changed

33 files changed

+1282
-1083
lines changed

.github/workflows/code_quality.yml renamed to .github/workflows/code_quality_checks.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Code Quality Checks
1+
name: 🔍 Code Quality Checks
22

33
on:
44
push:
@@ -9,8 +9,7 @@ on:
99
- main
1010

1111
jobs:
12-
checks:
13-
name: 🔍 Code Quality Checks
12+
check:
1413
runs-on: ubuntu-latest
1514
steps:
1615
- name: 🛒 Checkout code

.github/workflows/rebase.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Automatic Rebase
1+
name: 🌿 Rebase
2+
23
on:
34
issue_comment:
45
types: [created]
56
jobs:
67
rebase:
7-
name: 🌿 Rebase
88
runs-on: ubuntu-latest
99
if: >-
1010
github.event.issue.pull_request != '' &&

.github/workflows/release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
name: Release
1+
name: 🚀 Release
22

33
on:
44
workflow_dispatch:
55

66
jobs:
77
release:
8-
name: 🚀 Release
98
runs-on: ubuntu-latest
109

1110
permissions:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 🗑️ Unused Code Check
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
check:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: 🛒 Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: 🔧 Setup Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 20
23+
cache: 'yarn'
24+
25+
- name: 📦 Install dependencies
26+
run: yarn install --immutable
27+
28+
- name: 🧹 Find unused JS/TS code
29+
working-directory: packages/react-native-sortables
30+
run: yarn knip

.github/workflows/check_pr_title.yml renamed to .github/workflows/validate_pr_title.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Lint PR
1+
name: 👌 Validate PR title
22

33
on:
44
pull_request_target:
@@ -10,8 +10,7 @@ on:
1010
permissions: write-all
1111

1212
jobs:
13-
validate_pr_title:
14-
name: 👌 Validate PR title
13+
validate:
1514
runs-on: ubuntu-latest
1615
steps:
1716
- uses: amannn/action-semantic-pull-request@v5

.yarn/releases/yarn-4.3.1.cjs

Lines changed: 0 additions & 894 deletions
This file was deleted.

.yarn/releases/yarn-4.9.2.cjs

Lines changed: 942 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
nodeLinker: node-modules
22

3-
yarnPath: .yarn/releases/yarn-4.3.1.cjs
3+
yarnPath: .yarn/releases/yarn-4.9.2.cjs

eslint.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export default [
1212
'**/jest.setup.js',
1313
'**/dist',
1414
'**/README.md',
15-
'**/CONTRIBUTING.md'
15+
'**/CONTRIBUTING.md',
16+
'**/CHANGELOG.md'
1617
]
1718
},
1819
...baseConfig

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "react-native-sortables-monorepo",
33
"version": "1.0.0",
44
"devDependencies": {
5-
"@types/eslint": "^8.56.10",
5+
"@types/eslint": "^9.6.1",
66
"@types/jest": "^29.5.12",
77
"@types/node": "^20.14.9",
88
"eslint": "^9.28.0",
@@ -24,11 +24,8 @@
2424
"syncpack format"
2525
]
2626
},
27-
"packageManager": "yarn@4.3.1",
27+
"packageManager": "yarn@4.9.2",
2828
"private": true,
29-
"resolutions": {
30-
"typescript": "5.3.3"
31-
},
3229
"scripts": {
3330
"build": "yarn workspace react-native-sortables build",
3431
"clean": "yarn workspace react-native-sortables clean",

0 commit comments

Comments
 (0)