Skip to content

Commit 3c3d8f4

Browse files
chore: replace eslint with oxlint for faster linting
1 parent 7bcf907 commit 3c3d8f4

File tree

5 files changed

+83
-1
lines changed

5 files changed

+83
-1
lines changed

.oxlintrc.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"rules": {
3+
"react/jsx-key": "error",
4+
"react/jsx-no-comment-textnodes": "error",
5+
"react/jsx-no-duplicate-props": "error",
6+
"react/jsx-no-target-blank": "error",
7+
"react/jsx-no-undef": "error",
8+
"react/jsx-uses-react": "error",
9+
"react/jsx-uses-vars": "error",
10+
"react/no-children-prop": "error",
11+
"react/no-danger-with-children": "error",
12+
"react/no-deprecated": "error",
13+
"react/no-direct-mutation-state": "error",
14+
"react/no-find-dom-node": "error",
15+
"react/no-is-mounted": "error",
16+
"react/no-render-return-value": "error",
17+
"react/no-string-refs": "error",
18+
"react/no-unescaped-entities": "error",
19+
"react/no-unknown-property": "error",
20+
"react/no-unsafe": "error",
21+
"react/require-render-return": "error"
22+
}
23+
}

example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"@expo/webpack-config": "^18.0.1",
2424
"babel-loader": "^8.1.0",
2525
"babel-plugin-module-resolver": "^4.1.0",
26+
"oxlint": "^1.26.0",
2627
"prettier": "2.0.5"
2728
},
2829
"private": true

example/yarn.lock

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,46 @@
16431643
mkdirp "^1.0.4"
16441644
rimraf "^3.0.2"
16451645

1646+
1647+
version "1.26.0"
1648+
resolved "https://registry.yarnpkg.com/@oxlint/darwin-arm64/-/darwin-arm64-1.26.0.tgz#4460bb931e1f605ef2450094bec0476ef3af32c9"
1649+
integrity sha512-kTmm1opqyn7iZopWHO3Ml4D/44pA5eknZBepgxCnTaPrW8XgCEUI85Q5AvOOvoNve8NziTYb8ax+CyuGJIgn/Q==
1650+
1651+
1652+
version "1.26.0"
1653+
resolved "https://registry.yarnpkg.com/@oxlint/darwin-x64/-/darwin-x64-1.26.0.tgz#9184a7d310d8e99bd15e755d4d23de5c997647af"
1654+
integrity sha512-/hMfZ9j7ZzVPRmMm02PHNc6MIMk0QYv5VowZJRIp40YLqLPvFfGNGZBj8e1fDVgZMFEGWDQK3yrt1uBKxXAK4Q==
1655+
1656+
1657+
version "1.26.0"
1658+
resolved "https://registry.yarnpkg.com/@oxlint/linux-arm64-gnu/-/linux-arm64-gnu-1.26.0.tgz#25a36bc02d6c11380981a7819551a296fe3b9e84"
1659+
integrity sha512-iv4wdrwdCa8bhJxOpKlvfxqTs0LgW5tKBUMvH9B13zREHm1xT9JRZ8cQbbKiyC6LNdggwu5S6TSvODgAu7/DlA==
1660+
1661+
1662+
version "1.26.0"
1663+
resolved "https://registry.yarnpkg.com/@oxlint/linux-arm64-musl/-/linux-arm64-musl-1.26.0.tgz#dde234d4af7088b12ba2ea7f62d867c0aa3dd8d0"
1664+
integrity sha512-a3gTbnN1JzedxqYeGTkg38BAs/r3Krd2DPNs/MF7nnHthT3RzkPUk47isMePLuNc4e/Weljn7m2m/Onx22tiNg==
1665+
1666+
1667+
version "1.26.0"
1668+
resolved "https://registry.yarnpkg.com/@oxlint/linux-x64-gnu/-/linux-x64-gnu-1.26.0.tgz#c60793496aa9769730a98c8e84cc4733d909a533"
1669+
integrity sha512-cCAyqyuKpFImjlgiBuuwSF+aDBW2h19/aCmHMTMSp6KXwhoQK7/Xx7/EhZKP5wiQJzVUYq5fXr0D8WmpLGsjRg==
1670+
1671+
1672+
version "1.26.0"
1673+
resolved "https://registry.yarnpkg.com/@oxlint/linux-x64-musl/-/linux-x64-musl-1.26.0.tgz#c001a2c0ec20afd4d3a0c582f9eb5753c4e2fbd9"
1674+
integrity sha512-8VOJ4vQo0G1tNdaghxrWKjKZGg73tv+FoMDrtNYuUesqBHZN68FkYCsgPwEsacLhCmtoZrkF3ePDWDuWEpDyAg==
1675+
1676+
1677+
version "1.26.0"
1678+
resolved "https://registry.yarnpkg.com/@oxlint/win32-arm64/-/win32-arm64-1.26.0.tgz#2ec48232563dba5c18cbcba0407f797fb7558397"
1679+
integrity sha512-N8KUtzP6gfEHKvaIBZCS9g8wRfqV5v55a/B8iJjIEhtMehcEM+UX+aYRsQ4dy5oBCrK3FEp4Yy/jHgb0moLm3Q==
1680+
1681+
1682+
version "1.26.0"
1683+
resolved "https://registry.yarnpkg.com/@oxlint/win32-x64/-/win32-x64-1.26.0.tgz#1a3003764c64d80a1f080dede6f5d3e13355b987"
1684+
integrity sha512-7tCyG0laduNQ45vzB9blVEGq/6DOvh7AFmiUAana8mTp0zIKQQmwJ21RqhazH0Rk7O6lL7JYzKcu+zaJHGpRLA==
1685+
16461686
"@pkgjs/parseargs@^0.11.0":
16471687
version "0.11.0"
16481688
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"
@@ -6828,6 +6868,20 @@ own-keys@^1.0.1:
68286868
object-keys "^1.1.1"
68296869
safe-push-apply "^1.0.0"
68306870

6871+
oxlint@^1.26.0:
6872+
version "1.26.0"
6873+
resolved "https://registry.yarnpkg.com/oxlint/-/oxlint-1.26.0.tgz#ddd8b41460a25d8d85da098028f28bf2c0b27948"
6874+
integrity sha512-KRpL+SMi07JQyggv5ldIF+wt2pnrKm8NLW0B+8bK+0HZsLmH9/qGA+qMWie5Vf7lnlMBllJmsuzHaKFEGY3rIA==
6875+
optionalDependencies:
6876+
"@oxlint/darwin-arm64" "1.26.0"
6877+
"@oxlint/darwin-x64" "1.26.0"
6878+
"@oxlint/linux-arm64-gnu" "1.26.0"
6879+
"@oxlint/linux-arm64-musl" "1.26.0"
6880+
"@oxlint/linux-x64-gnu" "1.26.0"
6881+
"@oxlint/linux-x64-musl" "1.26.0"
6882+
"@oxlint/win32-arm64" "1.26.0"
6883+
"@oxlint/win32-x64" "1.26.0"
6884+
68316885
p-finally@^1.0.0:
68326886
version "1.0.0"
68336887
resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"

lefthook.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
pre-commit:
22
parallel: true
33
commands:
4+
lint:
5+
files: git diff --name-only @{push}
6+
glob: "*.{js,ts,jsx,tsx}"
7+
run: npx oxlint {files}
48
types:
59
files: git diff --name-only @{push}
610
glob: "*.{js,ts, jsx, tsx}"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"scripts": {
3030
"test": "jest",
3131
"typecheck": "tsc --noEmit",
32-
"lint": "eslint \"**/*.{js,ts,tsx}\"",
32+
"lint": "oxlint .",
3333
"prepack": "bob build",
3434
"release": "release-it --ci --github.autoGenerate",
3535
"example": "yarn --cwd example",

0 commit comments

Comments
 (0)