Skip to content

Commit dac8907

Browse files
GH CI action and lint --fix on save for workspace (#14) @robinheinze
* Add ci action for PRs * remove action * Format on save for workspace * Revert "remove action" This reverts commit eeb6b85. * fix eslint rule --------- Co-authored-by: Jamon Holmgren <code@jamon.dev>
1 parent f0a75fc commit dac8907

File tree

5 files changed

+63
-6
lines changed

5 files changed

+63
-6
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
ci:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: "18"
19+
cache: "npm"
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Run CI script
25+
run: npm run ci

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ build/
1515
web-build/
1616

1717
## Editors
18-
.vscode
18+
.vscode/*
19+
!.vscode/settings.json
1920
.cursor
2021
buildServer.json # for sweetpad
2122

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.codeActionsOnSave": {
4+
"source.fixAll": "explicit"
5+
},
6+
"eslint.format.enable": true
7+
}

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"pod": "./bin/pod-install",
1010
"pod-clean": "./bin/pod-install clean",
1111
"lint": "eslint .",
12+
"ci": "npm run lint",
1213
"start": "REACT_NATIVE_PATH=./node_modules/react-native-macos RCT_SCRIPT_RN_DIR=$REACT_NATIVE_PATH RCT_NEW_ARCH_ENABLED=1 ./node_modules/react-native-macos/scripts/packager.sh start",
1314
"test": "jest",
1415
"postinstall": "ln -sf $(pwd)/node_modules/react-native-macos $(pwd)/node_modules/react-native && patch-package"
@@ -36,6 +37,7 @@
3637
"eslint-config-prettier": "^10.1.1",
3738
"eslint-plugin-prettier": "^4.2.1",
3839
"eslint-plugin-reactotron": "^0.1.7",
40+
"eslint-plugin-unused-imports": "^4.2.0",
3941
"jest": "^29.7.0",
4042
"patch-package": "^8.0.0",
4143
"prettier": "2.8.8",
@@ -67,18 +69,23 @@
6769
],
6870
"plugins": [
6971
"reactotron",
70-
"prettier"
72+
"prettier",
73+
"unused-imports"
7174
],
7275
"rules": {
7376
"prettier/prettier": "error",
7477
"@typescript-eslint/array-type": 0,
7578
"@typescript-eslint/ban-ts-comment": 0,
7679
"@typescript-eslint/no-explicit-any": 0,
77-
"@typescript-eslint/no-unused-vars": [
78-
"error",
80+
"@typescript-eslint/no-unused-vars": "off",
81+
"unused-imports/no-unused-imports": "error",
82+
"unused-imports/no-unused-vars": [
83+
"warn",
7984
{
80-
"argsIgnorePattern": "^_",
81-
"varsIgnorePattern": "^_"
85+
"vars": "all",
86+
"varsIgnorePattern": "^_",
87+
"args": "after-used",
88+
"argsIgnorePattern": "^_"
8289
}
8390
],
8491
"@typescript-eslint/no-var-requires": 0,

0 commit comments

Comments
 (0)