Skip to content

Commit

Permalink
add oxlint
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Nov 4, 2024
1 parent f911a4f commit 30ca585
Show file tree
Hide file tree
Showing 7 changed files with 241 additions and 4 deletions.
2 changes: 1 addition & 1 deletion code/lib/cli-storybook/test/default/cli.test.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from 'vitest';
const { describe, it, expect } = require('vitest');

Check failure on line 1 in code/lib/cli-storybook/test/default/cli.test.cjs

View workflow job for this annotation

GitHub Actions / Core Unit Tests, windows-latest

test/default/cli.test.cjs

Error: Vitest cannot be imported in a CommonJS module using require(). Please use "import" instead. If you are using "import" in your source code, then it's possible it was bundled into require() automatically by your bundler. In that case, do not bundle CommonJS output since it will never work with Vitest, or use dynamic import() which is available in all CommonJS modules. ❯ Object.<anonymous> ../../node_modules/vitest/index.cjs:1:7 ❯ test/default/cli.test.cjs:1:34

const run = require('../helpers.cjs');

Expand Down
13 changes: 13 additions & 0 deletions code/oxlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": [
"import",
"unicorn",
"jsdoc"
],
"categories": {
"correctness": "deny",
"perf": "deny",
"suspicious": "deny"
}
}
6 changes: 4 additions & 2 deletions code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"lint": "yarn lint:js && yarn lint:md",
"lint:ejs": "ejslint **/*.ejs",
"lint:js": "yarn lint:js:cmd . --quiet",
"lint:js:cmd": "cross-env NODE_ENV=production eslint --cache --cache-location=../.cache/eslint --ext .js,.jsx,.json,.html,.ts,.tsx,.mjs --report-unused-disable-directives",
"lint:js:cmd": "oxlint && cross-env NODE_ENV=production eslint --cache --cache-location=../.cache/eslint --ext .js,.jsx,.json,.html,.ts,.tsx,.mjs --report-unused-disable-directives",
"lint:md": "../scripts/node_modules/.bin/remark -q .",
"lint:other": "prettier --write '**/*.{css,html,json,md,yml}'",
"lint:package": "sort-package-json",
Expand Down Expand Up @@ -192,6 +192,7 @@
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-depend": "^0.11.0",
"eslint-plugin-local-rules": "portal:../scripts/eslint-plugin-local-rules",
"eslint-plugin-oxlint": "^0.11.0",
"eslint-plugin-playwright": "^1.6.2",
"eslint-plugin-storybook": "^0.8.0",
"github-release-from-changelog": "^2.1.1",
Expand All @@ -202,6 +203,7 @@
"lint-staged": "^13.2.2",
"mock-require": "^3.0.3",
"nx": "18.0.6",
"oxlint": "^0.11.0",
"prettier": "^3.1.1",
"prettier-plugin-brace-style": "^0.6.2",
"prettier-plugin-css-order": "^2.1.2",
Expand Down Expand Up @@ -294,4 +296,4 @@
]
]
}
}
}
110 changes: 110 additions & 0 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4586,6 +4586,62 @@ __metadata:
languageName: node
linkType: hard

"@oxlint/darwin-arm64@npm:0.11.0":
version: 0.11.0
resolution: "@oxlint/darwin-arm64@npm:0.11.0"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"@oxlint/darwin-x64@npm:0.11.0":
version: 0.11.0
resolution: "@oxlint/darwin-x64@npm:0.11.0"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"@oxlint/linux-arm64-gnu@npm:0.11.0":
version: 0.11.0
resolution: "@oxlint/linux-arm64-gnu@npm:0.11.0"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard

"@oxlint/linux-arm64-musl@npm:0.11.0":
version: 0.11.0
resolution: "@oxlint/linux-arm64-musl@npm:0.11.0"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard

"@oxlint/linux-x64-gnu@npm:0.11.0":
version: 0.11.0
resolution: "@oxlint/linux-x64-gnu@npm:0.11.0"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard

"@oxlint/linux-x64-musl@npm:0.11.0":
version: 0.11.0
resolution: "@oxlint/linux-x64-musl@npm:0.11.0"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard

"@oxlint/win32-arm64@npm:0.11.0":
version: 0.11.0
resolution: "@oxlint/win32-arm64@npm:0.11.0"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

"@oxlint/win32-x64@npm:0.11.0":
version: 0.11.0
resolution: "@oxlint/win32-x64@npm:0.11.0"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard

"@phenomnomnominal/tsquery@npm:~5.0.1":
version: 5.0.1
resolution: "@phenomnomnominal/tsquery@npm:5.0.1"
Expand Down Expand Up @@ -6935,6 +6991,7 @@ __metadata:
eslint-import-resolver-typescript: "npm:^3.6.1"
eslint-plugin-depend: "npm:^0.11.0"
eslint-plugin-local-rules: "portal:../scripts/eslint-plugin-local-rules"
eslint-plugin-oxlint: "npm:^0.11.0"
eslint-plugin-playwright: "npm:^1.6.2"
eslint-plugin-storybook: "npm:^0.8.0"
github-release-from-changelog: "npm:^2.1.1"
Expand All @@ -6945,6 +7002,7 @@ __metadata:
lint-staged: "npm:^13.2.2"
mock-require: "npm:^3.0.3"
nx: "npm:18.0.6"
oxlint: "npm:^0.11.0"
prettier: "npm:^3.1.1"
prettier-plugin-brace-style: "npm:^0.6.2"
prettier-plugin-css-order: "npm:^2.1.2"
Expand Down Expand Up @@ -14520,6 +14578,15 @@ __metadata:
languageName: node
linkType: soft

"eslint-plugin-oxlint@npm:^0.11.0":
version: 0.11.0
resolution: "eslint-plugin-oxlint@npm:0.11.0"
dependencies:
jsonc-parser: "npm:^3.3.1"
checksum: 10c0/89050c240c569c9828237adf1031ceef0c7ccc8bc006b63aa347c8facc3189cf8774344de690b4433d382b3a7d80680941326fc9c9eaca8f8e9c24543048d3d1
languageName: node
linkType: hard

"eslint-plugin-playwright@npm:^1.6.2":
version: 1.6.2
resolution: "eslint-plugin-playwright@npm:1.6.2"
Expand Down Expand Up @@ -18652,6 +18719,13 @@ __metadata:
languageName: node
linkType: hard

"jsonc-parser@npm:^3.3.1":
version: 3.3.1
resolution: "jsonc-parser@npm:3.3.1"
checksum: 10c0/269c3ae0a0e4f907a914bf334306c384aabb9929bd8c99f909275ebd5c2d3bc70b9bcd119ad794f339dec9f24b6a4ee9cd5a8ab2e6435e730ad4075388fc2ab6
languageName: node
linkType: hard

"jsonexport@npm:^3.0.1":
version: 3.2.0
resolution: "jsonexport@npm:3.2.0"
Expand Down Expand Up @@ -22106,6 +22180,42 @@ __metadata:
languageName: node
linkType: hard

"oxlint@npm:^0.11.0":
version: 0.11.0
resolution: "oxlint@npm:0.11.0"
dependencies:
"@oxlint/darwin-arm64": "npm:0.11.0"
"@oxlint/darwin-x64": "npm:0.11.0"
"@oxlint/linux-arm64-gnu": "npm:0.11.0"
"@oxlint/linux-arm64-musl": "npm:0.11.0"
"@oxlint/linux-x64-gnu": "npm:0.11.0"
"@oxlint/linux-x64-musl": "npm:0.11.0"
"@oxlint/win32-arm64": "npm:0.11.0"
"@oxlint/win32-x64": "npm:0.11.0"
dependenciesMeta:
"@oxlint/darwin-arm64":
optional: true
"@oxlint/darwin-x64":
optional: true
"@oxlint/linux-arm64-gnu":
optional: true
"@oxlint/linux-arm64-musl":
optional: true
"@oxlint/linux-x64-gnu":
optional: true
"@oxlint/linux-x64-musl":
optional: true
"@oxlint/win32-arm64":
optional: true
"@oxlint/win32-x64":
optional: true
bin:
oxc_language_server: bin/oxc_language_server
oxlint: bin/oxlint
checksum: 10c0/7002aef24409555df2377e4d6be18dae09f918eed0820aa0e6b2af3933f76b1789507bde6d68f6a7f4a01dad01bd3112582e4440bb0874791835f72f9d34fce8
languageName: node
linkType: hard

"p-event@npm:^4.1.0":
version: 4.2.0
resolution: "p-event@npm:4.2.0"
Expand Down
2 changes: 1 addition & 1 deletion scripts/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
root: true,
extends: [
//
"plugin:oxlint/recommended",
'@storybook/eslint-config-storybook',
'plugin:storybook/recommended',
'plugin:depend/recommended'
Expand Down
2 changes: 2 additions & 0 deletions scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-json": "^4.0.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-oxlint": "^0.11.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2",
Expand All @@ -141,6 +142,7 @@
"node-gyp": "^9.3.1",
"nx": "18.0.6",
"ora": "^5.4.1",
"oxlint": "^0.11.0",
"p-limit": "^3.1.0",
"p-retry": "^5.1.2",
"picocolors": "^1.1.0",
Expand Down
110 changes: 110 additions & 0 deletions scripts/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,62 @@ __metadata:
languageName: node
linkType: hard

"@oxlint/darwin-arm64@npm:0.11.0":
version: 0.11.0
resolution: "@oxlint/darwin-arm64@npm:0.11.0"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"@oxlint/darwin-x64@npm:0.11.0":
version: 0.11.0
resolution: "@oxlint/darwin-x64@npm:0.11.0"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"@oxlint/linux-arm64-gnu@npm:0.11.0":
version: 0.11.0
resolution: "@oxlint/linux-arm64-gnu@npm:0.11.0"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard

"@oxlint/linux-arm64-musl@npm:0.11.0":
version: 0.11.0
resolution: "@oxlint/linux-arm64-musl@npm:0.11.0"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard

"@oxlint/linux-x64-gnu@npm:0.11.0":
version: 0.11.0
resolution: "@oxlint/linux-x64-gnu@npm:0.11.0"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard

"@oxlint/linux-x64-musl@npm:0.11.0":
version: 0.11.0
resolution: "@oxlint/linux-x64-musl@npm:0.11.0"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard

"@oxlint/win32-arm64@npm:0.11.0":
version: 0.11.0
resolution: "@oxlint/win32-arm64@npm:0.11.0"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

"@oxlint/win32-x64@npm:0.11.0":
version: 0.11.0
resolution: "@oxlint/win32-x64@npm:0.11.0"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard

"@pkgjs/parseargs@npm:^0.11.0":
version: 0.11.0
resolution: "@pkgjs/parseargs@npm:0.11.0"
Expand Down Expand Up @@ -1604,6 +1660,7 @@ __metadata:
eslint-plugin-import: "npm:^2.29.1"
eslint-plugin-json: "npm:^4.0.0"
eslint-plugin-jsx-a11y: "npm:^6.8.0"
eslint-plugin-oxlint: "npm:^0.11.0"
eslint-plugin-prettier: "npm:^5.1.3"
eslint-plugin-react: "npm:^7.34.2"
eslint-plugin-react-hooks: "npm:^4.6.2"
Expand All @@ -1627,6 +1684,7 @@ __metadata:
node-gyp: "npm:^9.3.1"
nx: "npm:18.0.6"
ora: "npm:^5.4.1"
oxlint: "npm:^0.11.0"
p-limit: "npm:^3.1.0"
p-retry: "npm:^5.1.2"
picocolors: "npm:^1.1.0"
Expand Down Expand Up @@ -5667,6 +5725,15 @@ __metadata:
languageName: node
linkType: hard

"eslint-plugin-oxlint@npm:^0.11.0":
version: 0.11.0
resolution: "eslint-plugin-oxlint@npm:0.11.0"
dependencies:
jsonc-parser: "npm:^3.3.1"
checksum: 10c0/89050c240c569c9828237adf1031ceef0c7ccc8bc006b63aa347c8facc3189cf8774344de690b4433d382b3a7d80680941326fc9c9eaca8f8e9c24543048d3d1
languageName: node
linkType: hard

"eslint-plugin-prettier@npm:^5.1.3":
version: 5.1.3
resolution: "eslint-plugin-prettier@npm:5.1.3"
Expand Down Expand Up @@ -8296,6 +8363,13 @@ __metadata:
languageName: node
linkType: hard

"jsonc-parser@npm:^3.3.1":
version: 3.3.1
resolution: "jsonc-parser@npm:3.3.1"
checksum: 10c0/269c3ae0a0e4f907a914bf334306c384aabb9929bd8c99f909275ebd5c2d3bc70b9bcd119ad794f339dec9f24b6a4ee9cd5a8ab2e6435e730ad4075388fc2ab6
languageName: node
linkType: hard

"jsonfile@npm:^6.0.1":
version: 6.1.0
resolution: "jsonfile@npm:6.1.0"
Expand Down Expand Up @@ -10512,6 +10586,42 @@ __metadata:
languageName: node
linkType: hard

"oxlint@npm:^0.11.0":
version: 0.11.0
resolution: "oxlint@npm:0.11.0"
dependencies:
"@oxlint/darwin-arm64": "npm:0.11.0"
"@oxlint/darwin-x64": "npm:0.11.0"
"@oxlint/linux-arm64-gnu": "npm:0.11.0"
"@oxlint/linux-arm64-musl": "npm:0.11.0"
"@oxlint/linux-x64-gnu": "npm:0.11.0"
"@oxlint/linux-x64-musl": "npm:0.11.0"
"@oxlint/win32-arm64": "npm:0.11.0"
"@oxlint/win32-x64": "npm:0.11.0"
dependenciesMeta:
"@oxlint/darwin-arm64":
optional: true
"@oxlint/darwin-x64":
optional: true
"@oxlint/linux-arm64-gnu":
optional: true
"@oxlint/linux-arm64-musl":
optional: true
"@oxlint/linux-x64-gnu":
optional: true
"@oxlint/linux-x64-musl":
optional: true
"@oxlint/win32-arm64":
optional: true
"@oxlint/win32-x64":
optional: true
bin:
oxc_language_server: bin/oxc_language_server
oxlint: bin/oxlint
checksum: 10c0/7002aef24409555df2377e4d6be18dae09f918eed0820aa0e6b2af3933f76b1789507bde6d68f6a7f4a01dad01bd3112582e4440bb0874791835f72f9d34fce8
languageName: node
linkType: hard

"p-finally@npm:^1.0.0":
version: 1.0.0
resolution: "p-finally@npm:1.0.0"
Expand Down

0 comments on commit 30ca585

Please sign in to comment.