Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: Explore using Oxlint #29525

Draft
wants to merge 2 commits into
base: next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 63 additions & 63 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -745,73 +745,73 @@ workflows:
when:
equal: [normal, << pipeline.parameters.workflow >>]
jobs:
- pretty-docs
# - pretty-docs
- build
- lint:
requires:
- build
- knip:
requires:
- build
- check:
requires:
- build
- unit-tests:
requires:
- build
- store-test-results:
requires:
- unit-tests
- script-checks:
requires:
- build
- chromatic-internal-storybook:
requires:
- build
- coverage:
requires:
- unit-tests
- create-sandboxes:
parallelism: 14
requires:
- build
- build-sandboxes:
parallelism: 14
requires:
- create-sandboxes
- chromatic-sandboxes:
parallelism: 11
requires:
- build-sandboxes
- e2e-production:
parallelism: 9
requires:
- build-sandboxes
- e2e-dev:
parallelism: 2
requires:
- create-sandboxes
- test-runner-production:
parallelism: 9
requires:
- build-sandboxes
- vitest-integration:
parallelism: 5
requires:
- create-sandboxes
- bench:
parallelism: 5
requires:
- build-sandboxes
- test-ui-testing-module:
requires:
- build
- test-portable-stories:
requires:
- build
matrix:
parameters:
directory: ["react", "vue3", "nextjs", "svelte"]
# - knip:
# requires:
# - build
# - check:
# requires:
# - build
# - unit-tests:
# requires:
# - build
# - store-test-results:
# requires:
# - unit-tests
# - script-checks:
# requires:
# - build
# - chromatic-internal-storybook:
# requires:
# - build
# - coverage:
# requires:
# - unit-tests
# - create-sandboxes:
# parallelism: 14
# requires:
# - build
# - build-sandboxes:
# parallelism: 14
# requires:
# - create-sandboxes
# - chromatic-sandboxes:
# parallelism: 11
# requires:
# - build-sandboxes
# - e2e-production:
# parallelism: 9
# requires:
# - build-sandboxes
# - e2e-dev:
# parallelism: 2
# requires:
# - create-sandboxes
# - test-runner-production:
# parallelism: 9
# requires:
# - build-sandboxes
# - vitest-integration:
# parallelism: 5
# requires:
# - create-sandboxes
# - bench:
# parallelism: 5
# requires:
# - build-sandboxes
# - test-ui-testing-module:
# requires:
# - build
# - test-portable-stories:
# requires:
# - build
# matrix:
# parameters:
# directory: ["react", "vue3", "nextjs", "svelte"]
# TODO: reenable once we find out the source of flakyness
# - test-runner-dev:
# requires:
Expand Down
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
Loading
Loading