Skip to content

Commit ea3c4a5

Browse files
committed
fix oxlint issues
1 parent 49192d9 commit ea3c4a5

File tree

6 files changed

+21
-23
lines changed

6 files changed

+21
-23
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
- name: Install dependencies
4040
run: bun install --frozen-lockfile
4141

42-
- name: Check Code formatting
43-
run: bun run format:check
42+
- name: Check linting
43+
run: bun run lint
4444

4545
- name: Run tests
4646
run: bun run test:coverage

.oxlintrc.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
{
22
"$schema": "./node_modules/oxlint/configuration_schema.json",
3-
"plugins": [
4-
"unicorn",
5-
"typescript",
6-
"oxc"
7-
],
3+
"plugins": ["unicorn", "typescript", "oxc"],
84
"categories": {},
95
"rules": {
106
"for-direction": "warn",
@@ -50,7 +46,7 @@
5046
"no-unused-expressions": "warn",
5147
"no-unused-labels": "warn",
5248
"no-unused-private-class-members": "warn",
53-
"no-unused-vars": "warn",
49+
"no-unused-vars": "error",
5450
"no-useless-backreference": "warn",
5551
"no-useless-catch": "warn",
5652
"no-useless-escape": "warn",
@@ -140,4 +136,4 @@
140136
},
141137
"globals": {},
142138
"ignorePatterns": []
143-
}
139+
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
"format:check:spotless": "./example/IonicCapOneSignal/android/gradlew spotlessCheck",
1717
"format:check:prettier": "prettier --check \"**/*.{ts,tsx}\" --ignore-path .gitignore",
1818
"format:check": "concurrently \"npm:format:check:spotless\" \"npm:format:check:prettier\"",
19+
"lint": "oxlint ./www && bun run format:check",
20+
"lint:fix": "oxlint ./www --fix && bun run format:fix",
1921
"test": "vitest",
2022
"test:coverage": "vitest run --coverage"
2123
},

www/InAppMessagesNamespace.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ describe('InAppMessages', () => {
253253
});
254254

255255
test('should resolve Promise when cordova.exec succeeds', async () => {
256-
mockExec.mockImplementation((resolve, reject) => {
256+
mockExec.mockImplementation((resolve) => {
257257
resolve(true);
258258
});
259259

www/LocationNamespace.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('Location', () => {
4646

4747
describe('isShared', () => {
4848
test('should return a Promise and call cordova.exec for isShared', () => {
49-
mockExec.mockImplementation((resolve, reject) => {
49+
mockExec.mockImplementation((resolve) => {
5050
resolve(true);
5151
});
5252

@@ -64,7 +64,7 @@ describe('Location', () => {
6464
});
6565

6666
test('should resolve Promise when cordova.exec succeeds', async () => {
67-
mockExec.mockImplementation((resolve, reject) => {
67+
mockExec.mockImplementation((resolve) => {
6868
resolve(true);
6969
});
7070

@@ -75,7 +75,7 @@ describe('Location', () => {
7575
test('should reject Promise when cordova.exec fails', async () => {
7676
const mockError = new Error('Location permission denied');
7777

78-
mockExec.mockImplementation((resolve, reject) => {
78+
mockExec.mockImplementation((_resolve, reject) => {
7979
reject(mockError);
8080
});
8181
await expect(location.isShared()).rejects.toThrow(mockError.message);

www/NotificationsNamespace.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('Notifications', () => {
2020

2121
describe('getPermissionAsync', () => {
2222
test('should return a Promise and call cordova.exec for getPermissionAsync', () => {
23-
mockExec.mockImplementation((resolve, reject) => {
23+
mockExec.mockImplementation((resolve) => {
2424
resolve(true);
2525
});
2626

@@ -38,7 +38,7 @@ describe('Notifications', () => {
3838
});
3939

4040
test('should resolve Promise when cordova.exec succeeds', async () => {
41-
mockExec.mockImplementation((resolve, reject) => {
41+
mockExec.mockImplementation((resolve) => {
4242
resolve(true);
4343
});
4444

@@ -50,7 +50,7 @@ describe('Notifications', () => {
5050
test('should reject Promise when cordova.exec fails', async () => {
5151
const mockError = new Error('Permission check failed');
5252

53-
mockExec.mockImplementation((resolve, reject) => {
53+
mockExec.mockImplementation((_resolve, reject) => {
5454
reject(mockError);
5555
});
5656

@@ -62,7 +62,7 @@ describe('Notifications', () => {
6262

6363
describe('permissionNative', () => {
6464
test('should return a Promise and call cordova.exec for permissionNative', () => {
65-
mockExec.mockImplementation((resolve, reject) => {
65+
mockExec.mockImplementation((resolve) => {
6666
resolve(OSNotificationPermission.Authorized);
6767
});
6868

@@ -81,7 +81,7 @@ describe('Notifications', () => {
8181
});
8282

8383
test('should resolve with OSNotificationPermission enum value', async () => {
84-
mockExec.mockImplementation((resolve, reject) => {
84+
mockExec.mockImplementation((resolve) => {
8585
resolve(OSNotificationPermission.Authorized);
8686
});
8787

@@ -93,7 +93,7 @@ describe('Notifications', () => {
9393
test('should reject Promise when cordova.exec fails', async () => {
9494
const mockError = new Error('Permission check failed');
9595

96-
mockExec.mockImplementation((resolve, reject) => {
96+
mockExec.mockImplementation((_resolve, reject) => {
9797
reject(mockError);
9898
});
9999
await expect(notifications.permissionNative()).rejects.toThrow(
@@ -106,7 +106,7 @@ describe('Notifications', () => {
106106
test.each([[true], [false]])(
107107
'should call cordova.exec for requestPermission with fallbackToSettings %s',
108108
async (fallback) => {
109-
mockExec.mockImplementation((resolve, reject) => {
109+
mockExec.mockImplementation((resolve) => {
110110
resolve(true);
111111
});
112112

@@ -123,7 +123,7 @@ describe('Notifications', () => {
123123
);
124124

125125
test('should use default fallbackToSettings of false when not provided', () => {
126-
mockExec.mockImplementation((resolve, reject) => {
126+
mockExec.mockImplementation((resolve) => {
127127
resolve(true);
128128
});
129129

@@ -143,7 +143,7 @@ describe('Notifications', () => {
143143

144144
describe('canRequestPermission', () => {
145145
test('should return a Promise and call cordova.exec for canRequestPermission', () => {
146-
mockExec.mockImplementation((resolve, reject) => {
146+
mockExec.mockImplementation((resolve) => {
147147
resolve(true);
148148
});
149149

@@ -162,7 +162,7 @@ describe('Notifications', () => {
162162
});
163163

164164
test('should resolve with boolean value', async () => {
165-
mockExec.mockImplementation((resolve, reject) => {
165+
mockExec.mockImplementation((resolve) => {
166166
resolve(false);
167167
});
168168

0 commit comments

Comments
 (0)