Skip to content

Commit f31487b

Browse files
authored
chore: Replace ESLint with oxlint and fix lint warnings (#1437)
1 parent c83da4c commit f31487b

File tree

30 files changed

+173
-451
lines changed

30 files changed

+173
-451
lines changed
File renamed without changes.

.cursor/rules/conventions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
description: Project conventions for PRs and commits
3+
alwaysApply: true
4+
---
5+
6+
Use semantic PR titles following the conventional commits format, e.g. `fix: address bug ...`, `feat: add ...`, `refactor: ...`, `chore: ...`, `build: ...`, `docs: ...`, `test: ...`.

.eslintrc.cjs

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

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ ngrok.log
1515
!.vscode/settings.json
1616
!.vscode/keybindings.json
1717
!.vscode/extensions.json
18-
.cursor/
18+
.cursor/*
19+
!.cursor/rules/
1920

2021
coverage
2122

.oxlintrc.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": ["typescript"],
4+
"categories": {},
5+
"rules": {},
6+
"settings": {
7+
"jsx-a11y": {
8+
"polymorphicPropName": null,
9+
"components": {},
10+
"attributes": {}
11+
},
12+
"jsdoc": {
13+
"ignorePrivate": false,
14+
"ignoreInternal": false,
15+
"ignoreReplacesDocs": true,
16+
"overrideReplacesDocs": true,
17+
"augmentsExtendsReplacesDocs": false,
18+
"implementsReplacesDocs": false,
19+
"exemptDestructuredRootsFromChecks": false,
20+
"tagNamePreference": {}
21+
},
22+
"vitest": {
23+
"typecheck": false
24+
}
25+
},
26+
"env": {
27+
"builtin": true
28+
},
29+
"globals": {},
30+
"ignorePatterns": []
31+
}

bun.lock

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

package.json

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"test": "vitest run --coverage",
3333
"test:watch": "vitest watch --coverage",
3434
"validate:build": "node build/scripts/validate.js",
35-
"lint": "eslint src --ext .js,.jsx,.ts,.tsx; prettylint 'src/**/*' 'test/**/*' '__test__/**/*' --no-editorconfig",
36-
"lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix; prettylint 'src/**/*' 'test/**/*' '__test__/**/*' --no-editorconfig --fix"
35+
"lint": "oxlint src; prettier --check 'src/**/*' '__test__/**/*'",
36+
"lint:fix": "oxlint src --fix; prettier --write 'src/**/*' '__test__/**/*'"
3737
},
3838
"config": {
3939
"sdkVersion": "160600"
@@ -51,19 +51,15 @@
5151
"@types/jsdom": "^28.0.0",
5252
"@types/jsonp": "^0.2.3",
5353
"@types/uuid": "^11.0.0",
54-
"@typescript-eslint/eslint-plugin": "^5.36.1",
55-
"@typescript-eslint/parser": "^5.36.1",
5654
"@vitest/coverage-v8": "4.0.18",
5755
"concurrently": "^9.2.1",
5856
"deepmerge": "^4.3.1",
59-
"eslint": "^8.23.0",
60-
"eslint-config-prettier": "9.0.0",
6157
"fake-indexeddb": "6.2.5",
6258
"intl-tel-input": "^25.15.1",
6359
"jsdom": "^28.1.0",
6460
"msw": "^2.12.10",
61+
"oxlint": "^1.51.0",
6562
"prettier": "3.8.1",
66-
"prettylint": "^2.0.0",
6763
"terser": "^5.46.0",
6864
"type-fest": "^5.4.4",
6965
"typescript": "^5.9.3",
@@ -81,12 +77,12 @@
8177
},
8278
{
8379
"path": "./build/releases/OneSignalSDK.page.es6.js",
84-
"limit": "43.75 kB",
80+
"limit": "43.701 kB",
8581
"gzip": true
8682
},
8783
{
8884
"path": "./build/releases/OneSignalSDK.sw.js",
89-
"limit": "12.743 kB",
85+
"limit": "12.701 kB",
9086
"gzip": true
9187
},
9288
{

src/core/executors/LoginUserOperationExecutor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
ExecutionResult,
44
type IOperationExecutor,
55
} from 'src/core/types/operation';
6-
import { getTimeZoneId } from 'src/shared/helpers/general';
76
import {
87
getResponseStatusType,
98
ResponseStatusType,
@@ -367,3 +366,5 @@ const getLanguage = () => {
367366
return 'en';
368367
}
369368
};
369+
370+
const getTimeZoneId = () => Intl.DateTimeFormat().resolvedOptions().timeZone;

src/onesignal/User.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ function isObjectSerializable(value: unknown): boolean {
319319
try {
320320
JSON.stringify(value);
321321
return true;
322-
} catch (e) {
322+
} catch {
323323
return false;
324324
}
325325
}

src/page/managers/slidedownManager/SlidedownManager.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ export const mockPhoneLibraryLoading = () => {
307307
OneSignal._didLoadITILibrary = true;
308308

309309
// @ts-expect-error - mock intl-tel-input
310-
window.intlTelInput = vi.fn().mockImplementation((input) => ({
310+
window.intlTelInput = vi.fn().mockImplementation((_input) => ({
311311
getNumber: () => '+1234567890', // Return formatted number
312312
isValidNumber: () => true,
313313
getNumberType: () => 0,

0 commit comments

Comments
 (0)