Skip to content

Commit 1803fbd

Browse files
committed
add oxlint setup
1 parent 7aa9ca2 commit 1803fbd

File tree

4 files changed

+165
-2
lines changed

4 files changed

+165
-2
lines changed

.oxlintrc.json

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": ["unicorn", "typescript", "oxc"],
4+
"categories": {},
5+
"rules": {
6+
"for-direction": "warn",
7+
"no-async-promise-executor": "warn",
8+
"no-caller": "warn",
9+
"no-class-assign": "warn",
10+
"no-compare-neg-zero": "warn",
11+
"no-cond-assign": "warn",
12+
"no-const-assign": "warn",
13+
"no-constant-binary-expression": "warn",
14+
"no-constant-condition": "warn",
15+
"no-control-regex": "warn",
16+
"no-debugger": "warn",
17+
"no-delete-var": "warn",
18+
"no-dupe-class-members": "warn",
19+
"no-dupe-else-if": "warn",
20+
"no-dupe-keys": "warn",
21+
"no-duplicate-case": "warn",
22+
"no-empty-character-class": "warn",
23+
"no-empty-pattern": "warn",
24+
"no-empty-static-block": "warn",
25+
"no-eval": "warn",
26+
"no-ex-assign": "warn",
27+
"no-extra-boolean-cast": "warn",
28+
"no-func-assign": "warn",
29+
"no-global-assign": "warn",
30+
"no-import-assign": "warn",
31+
"no-invalid-regexp": "warn",
32+
"no-irregular-whitespace": "warn",
33+
"no-loss-of-precision": "warn",
34+
"no-new-native-nonconstructor": "warn",
35+
"no-nonoctal-decimal-escape": "warn",
36+
"no-obj-calls": "warn",
37+
"no-self-assign": "warn",
38+
"no-setter-return": "warn",
39+
"no-shadow-restricted-names": "warn",
40+
"no-sparse-arrays": "warn",
41+
"no-this-before-super": "warn",
42+
"no-unassigned-vars": "warn",
43+
"no-unsafe-finally": "warn",
44+
"no-unsafe-negation": "warn",
45+
"no-unsafe-optional-chaining": "warn",
46+
"no-unused-expressions": "warn",
47+
"no-unused-labels": "warn",
48+
"no-unused-private-class-members": "warn",
49+
"no-unused-vars": "error",
50+
"no-useless-backreference": "warn",
51+
"no-useless-catch": "warn",
52+
"no-useless-escape": "warn",
53+
"no-useless-rename": "warn",
54+
"no-with": "warn",
55+
"require-yield": "warn",
56+
"use-isnan": "warn",
57+
"valid-typeof": "warn",
58+
"oxc/bad-array-method-on-arguments": "warn",
59+
"oxc/bad-char-at-comparison": "warn",
60+
"oxc/bad-comparison-sequence": "warn",
61+
"oxc/bad-min-max-func": "warn",
62+
"oxc/bad-object-literal-comparison": "warn",
63+
"oxc/bad-replace-all-arg": "warn",
64+
"oxc/const-comparisons": "warn",
65+
"oxc/double-comparisons": "warn",
66+
"oxc/erasing-op": "warn",
67+
"oxc/missing-throw": "warn",
68+
"oxc/number-arg-out-of-range": "warn",
69+
"oxc/only-used-in-recursion": "warn",
70+
"oxc/uninvoked-array-callback": "warn",
71+
"typescript/await-thenable": "warn",
72+
"typescript/no-array-delete": "warn",
73+
"typescript/no-base-to-string": "warn",
74+
"typescript/no-duplicate-enum-values": "warn",
75+
"typescript/no-duplicate-type-constituents": "warn",
76+
"typescript/no-extra-non-null-assertion": "warn",
77+
"typescript/no-floating-promises": "warn",
78+
"typescript/no-for-in-array": "warn",
79+
"typescript/no-implied-eval": "warn",
80+
"typescript/no-meaningless-void-operator": "warn",
81+
"typescript/no-misused-new": "warn",
82+
"typescript/no-misused-spread": "warn",
83+
"typescript/no-non-null-asserted-optional-chain": "warn",
84+
"typescript/no-redundant-type-constituents": "warn",
85+
"typescript/no-this-alias": "warn",
86+
"typescript/no-unnecessary-parameter-property-assignment": "warn",
87+
"typescript/no-unsafe-declaration-merging": "warn",
88+
"typescript/no-unsafe-unary-minus": "warn",
89+
"typescript/no-useless-empty-export": "warn",
90+
"typescript/no-wrapper-object-types": "warn",
91+
"typescript/prefer-as-const": "warn",
92+
"typescript/require-array-sort-compare": "warn",
93+
"typescript/restrict-template-expressions": "warn",
94+
"typescript/triple-slash-reference": "warn",
95+
"typescript/unbound-method": "warn",
96+
"unicorn/no-await-in-promise-methods": "warn",
97+
"unicorn/no-empty-file": "warn",
98+
"unicorn/no-invalid-fetch-options": "warn",
99+
"unicorn/no-invalid-remove-event-listener": "warn",
100+
"unicorn/no-new-array": "warn",
101+
"unicorn/no-single-promise-in-promise-methods": "warn",
102+
"unicorn/no-thenable": "warn",
103+
"unicorn/no-unnecessary-await": "warn",
104+
"unicorn/no-useless-fallback-in-spread": "warn",
105+
"unicorn/no-useless-length-check": "warn",
106+
"unicorn/no-useless-spread": "warn",
107+
"unicorn/prefer-set-size": "warn",
108+
"unicorn/prefer-string-starts-ends-with": "warn"
109+
},
110+
"settings": {
111+
"jsx-a11y": {
112+
"polymorphicPropName": null,
113+
"components": {},
114+
"attributes": {}
115+
},
116+
"next": {
117+
"rootDir": []
118+
},
119+
"react": {
120+
"formComponents": [],
121+
"linkComponents": []
122+
},
123+
"jsdoc": {
124+
"ignorePrivate": false,
125+
"ignoreInternal": false,
126+
"ignoreReplacesDocs": true,
127+
"overrideReplacesDocs": true,
128+
"augmentsExtendsReplacesDocs": false,
129+
"implementsReplacesDocs": false,
130+
"exemptDestructuredRootsFromChecks": false,
131+
"tagNamePreference": {}
132+
}
133+
},
134+
"env": {
135+
"builtin": true
136+
},
137+
"globals": {},
138+
"ignorePatterns": []
139+
}

bun.lock

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,29 @@
99
"devDependencies": {
1010
"@types/invariant": "^2.2.2",
1111
"@types/react-native": "^0.66.8",
12+
"oxlint": "^1.24.0",
1213
"prettier": "^2.7.1",
1314
"typescript": "^3.8.3",
1415
},
1516
},
1617
},
1718
"packages": {
19+
"@oxlint/darwin-arm64": ["@oxlint/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-1Kd2+Ai1ttskhbJR+DNU4Y4YEDyP/cd50nWt2rAe2aE78dMOalaVGps3s8UnJkXpDL9ZqkgOHVDE5Doj2lxatw=="],
20+
21+
"@oxlint/darwin-x64": ["@oxlint/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-/R9VbnuTp7bLIBh6ucDHjx0po0wLQODLqzy+L/Frn5z4ifMVdE63DB+LHO8QAj+WEQleQq3u/MMms7RFPulCLA=="],
22+
23+
"@oxlint/linux-arm64-gnu": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-fA90bIQ1b44eNg0uULlTonqsADVIBnMz169mav6IhfZL9V6DpBCUWrV+8tEQCxbDvYC0WY1guBpPo2QWUnC/Dw=="],
24+
25+
"@oxlint/linux-arm64-musl": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-p7Bv9FTQ1lf4Z7OiIFwiy+cY2fxN6IJc0+2gJ4z2fpaQ0J2rQQcKdJ5RLQTxf+tAu7hyqjc6bf61EAGa9lb/GA=="],
26+
27+
"@oxlint/linux-x64-gnu": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-wIQOpTONiJ9pYPnLEq7UFuml8mpmSFTfUveNbT2rw9iXfj2nLMf7NIqGnUYQdvnnOi+maag9uei/WImXIm9LQQ=="],
28+
29+
"@oxlint/linux-x64-musl": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-HxcDX/SpTH7yC/Rn2MinjSHZmNpn79yJkBid792DWjP9bo0CnlNXOXMPXsbm+WqptvqQ9yUPCxf7KascUvxLyQ=="],
30+
31+
"@oxlint/win32-arm64": ["@oxlint/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-P1KtZ/xL+TcNTTmOtEsVrpqAdmpu2UCRAILjoqQyrYvI/CW6SdvoJfMBTntKOZaB52Peq2BHTgsYovON8q4FfQ=="],
32+
33+
"@oxlint/win32-x64": ["@oxlint/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-JMbMm7i1esFl12fRdOQwoeEeufWXxihOme8pZpI6jrwWK1kCIANMb5agI5Lkjf5vToQOP3DLXYc29aDm16fw6g=="],
34+
1835
"@types/invariant": ["@types/[email protected]", "", {}, "sha512-IwpIMieE55oGWiXkQPSBY1nw1nFs6bsKXTFskNY8sdS17K24vyEBRQZEwlRS7ZmXCWnJcQtbxWzly+cODWGs2A=="],
1936

2037
"@types/prop-types": ["@types/[email protected]", "", {}, "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw=="],
@@ -33,6 +50,8 @@
3350

3451
"loose-envify": ["[email protected]", "", { "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, "bin": { "loose-envify": "cli.js" } }, "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q=="],
3552

53+
"oxlint": ["[email protected]", "", { "optionalDependencies": { "@oxlint/darwin-arm64": "1.24.0", "@oxlint/darwin-x64": "1.24.0", "@oxlint/linux-arm64-gnu": "1.24.0", "@oxlint/linux-arm64-musl": "1.24.0", "@oxlint/linux-x64-gnu": "1.24.0", "@oxlint/linux-x64-musl": "1.24.0", "@oxlint/win32-arm64": "1.24.0", "@oxlint/win32-x64": "1.24.0" }, "peerDependencies": { "oxlint-tsgolint": ">=0.2.0" }, "optionalPeers": ["oxlint-tsgolint"], "bin": { "oxlint": "bin/oxlint", "oxc_language_server": "bin/oxc_language_server" } }, "sha512-swXlnHT7ywcCApkctIbgOSjDYHwMa12yMU0iXevfDuHlYkRUcbQrUv6nhM5v6B0+Be3zTBMNDGPAMQv0oznzRQ=="],
54+
3655
"prettier": ["[email protected]", "", { "bin": { "prettier": "bin-prettier.js" } }, "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q=="],
3756

3857
"typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q=="],

examples/RNOneSignalTS/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"scripts": {
66
"android": "react-native run-android",
77
"ios": "react-native run-ios",
8-
"start": "react-native start"
8+
"start": "react-native start",
9+
"lint": "oxlint src",
10+
"lint:fix": "oxlint src --fix"
911
},
1012
"dependencies": {
1113
"@react-native/new-app-screen": "0.81.4",

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@
66
"types": "dist/index.d.ts",
77
"scripts": {
88
"prepare": "bun run build",
9-
"build": "tsc"
9+
"build": "tsc",
10+
"lint": "oxlint src && prettier --check src",
11+
"lint:fix": "oxlint src --fix && prettier --write src"
1012
},
1113
"dependencies": {
1214
"invariant": "^2.2.2"
1315
},
1416
"devDependencies": {
1517
"@types/invariant": "^2.2.2",
1618
"@types/react-native": "^0.66.8",
19+
"oxlint": "^1.24.0",
1720
"prettier": "^2.7.1",
1821
"typescript": "^3.8.3"
1922
},

0 commit comments

Comments
 (0)