-
Notifications
You must be signed in to change notification settings - Fork 3
feat: use oxlint for faster lint #125
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
Open
concertypin
wants to merge
12
commits into
kei-dev/redesign
Choose a base branch
from
kei-dev/oxlint
base: kei-dev/redesign
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
dfae3eb
feat(lint): integrate oxlint for faster and type-aware linting
concertypin af7dab9
chore: improve linting time by concurrent linting
andjsrk e9ce975
chore(lint): restructure linter configuration and optimize for svelte 5
concertypin 0217711
refactor(deps): remove redundant browser testing configuration from v…
concertypin e00ba7c
feat(ci): introduce separate CI workflows for backend and frontend
concertypin 4fe9c6c
refactor(ci): update workflow triggers to use paths instead of branches
concertypin abbb8ff
refactor(eslint): remove unnecessary type assertion for typescript-es…
concertypin bb79ad2
chore: add hybrid benchmark script
concertypin 4ff9423
bench: add partial cache invalidation scenario
concertypin c25a472
build(deps): update dependencies in frontend package.json
concertypin f402620
ci(frontend): enhance CI workflow with pnpm caching and Playwright setup
concertypin 128da0e
chore: trigger CI
concertypin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| { | ||
| "$schema": "./node_modules/oxlint/configuration_schema.json", | ||
| "plugins": [ | ||
| "typescript", | ||
| "unicorn", | ||
| "import", | ||
| "vitest", | ||
| "promise" | ||
| ], | ||
| "jsPlugins": [ | ||
| "eslint-plugin-phosphor-svelte" | ||
| ], | ||
| "env": { | ||
| "builtin": true | ||
| }, | ||
| "ignorePatterns": [ | ||
| "**/node_modules/**", | ||
| "**/dist/**", | ||
| "**/coverage/**", | ||
| "**/.cache/**", | ||
| "**/.vscode/**", | ||
| "**/.git/**", | ||
| "**/conductor/**" | ||
| ], | ||
| "overrides": [ | ||
| { | ||
| "files": [ | ||
| "**/*.d.ts" | ||
| ], | ||
| "rules": { | ||
| "no-unused-vars": "off" | ||
| } | ||
| }, | ||
| { | ||
| "files": [ | ||
| "**/*.svelte", | ||
| "**/*.svelte.ts" | ||
| ], | ||
| "rules": { | ||
| "prefer-const": "off", | ||
| "no-unassigned-vars": "off" | ||
| } | ||
| }, | ||
| { | ||
| "files": [ | ||
| "**/test/**", | ||
| "**/*.test.ts", | ||
| "**/*.test.tsx", | ||
| "**/*.spec.ts" | ||
| ], | ||
| "rules": { | ||
| "jest/require-to-throw-message": "off", | ||
| "jest/expect-expect": "off" | ||
| } | ||
| } | ||
| ], | ||
| "rules": { | ||
| "phosphor-svelte/optimize-imports": "warn" | ||
| }, | ||
| "extends": [ | ||
| "scripts/linter/oxlint-eslint.json" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # Tools Configuration | ||
|
|
||
| This document provides guidelines for configuring the linting and formatting tools in the ArisuTalk frontend project. | ||
|
|
||
| ## Linter Configuration | ||
|
|
||
| This project uses **oxlint** as the primary linter for fast, type-aware linting, with **ESLint** as a fallback for rules that oxlint doesn't support yet. | ||
|
|
||
| ### Oxlint | ||
|
|
||
| Fast linter for TypeScript and JavaScript, built on the Oxc compiler stack. | ||
|
|
||
| **Supports:** | ||
|
|
||
| - Most typescript-eslint rules, including type-aware rules | ||
| - ESLint's JS plugins via the `jsPlugins` feature | ||
| - Plugins: `typescript`, `unicorn`, `import`, `vitest`, `promise` | ||
|
|
||
| **Doesn't support:** | ||
|
|
||
| - Custom file formats and parsers (Svelte, Vue, Angular templates) | ||
| - Some HTML-superset code (only checks `<script>` blocks in `.svelte` files) | ||
|
|
||
| **Configuration:** `.oxlintrc.json` and `scripts/linter/` | ||
|
|
||
| #### Adding New Plugins | ||
|
|
||
| When using new ESLint plugins, try oxlint's [JS Plugins compatibility](https://oxc.rs/docs/guide/usage/linter/js-plugins.html) first: | ||
|
|
||
| 1. Add the plugin to `jsPlugins` in `.oxlintrc.json`: | ||
|
|
||
| ```json | ||
| { | ||
| "jsPlugins": ["eslint-plugin-foo"] | ||
| } | ||
| ``` | ||
|
|
||
| 2. Add rules from the plugin under `rules`: | ||
|
|
||
| ```json | ||
| { | ||
| "rules": { | ||
| "foo/rule-name": "error" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| 3. If the plugin requires Svelte/Vue parser support, fall back to ESLint (see below). | ||
|
|
||
| ### ESLint | ||
|
|
||
| ESLint is used **only** for rules that oxlint doesn't support, primarily: | ||
|
|
||
| - Svelte template-specific rules (`eslint-plugin-svelte`) | ||
| - Any future plugins requiring custom parsers | ||
|
|
||
| **Configuration:** `eslint.config.js` | ||
|
|
||
| The `eslint-plugin-oxlint` integration automatically disables ESLint rules that oxlint already handles, preventing duplicate warnings. | ||
|
|
||
| ### Running Linters | ||
|
|
||
| ```bash | ||
| # Run oxlint only (fast, catches most issues) | ||
| pnpm run lint:oxlint | ||
|
|
||
| # Run ESLint only (Svelte template rules) | ||
| pnpm run lint:eslint | ||
|
|
||
| # Run both with auto-fix | ||
| pnpm run lint | ||
|
|
||
| # Run both without auto-fix (for CI) | ||
| pnpm run lint:check | ||
| ``` | ||
|
|
||
| ## Formatter Configuration | ||
|
|
||
| This project uses **Prettier** for code formatting. Prettier is configured in `.prettierrc` and runs via: | ||
|
|
||
| ```bash | ||
| # Format all files | ||
| pnpm run format | ||
|
|
||
| # Check formatting without modifying files | ||
| pnpm run format:check | ||
| ``` | ||
|
|
||
| **Note:** `eslint-config-prettier` is **not** used, as CI already checks formatting separately and it can slow down TypeScript linting. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| // Base rule, which is similar to ESLint. Machine-generated, unrecommended to edit manually. | ||
| // Instead, extend this in .oxlintrc.json and override rules. | ||
| { | ||
| "$schema": "../../node_modules/oxlint/configuration_schema.json", | ||
| "rules": { | ||
| "@typescript-eslint/await-thenable": "error", | ||
| "@typescript-eslint/ban-ts-comment": "error", | ||
| "@typescript-eslint/no-array-delete": "error", | ||
| "@typescript-eslint/no-base-to-string": "error", | ||
| "@typescript-eslint/no-duplicate-enum-values": "error", | ||
| "@typescript-eslint/no-duplicate-type-constituents": "error", | ||
| "@typescript-eslint/no-explicit-any": "error", | ||
| "@typescript-eslint/no-extra-non-null-assertion": "error", | ||
| "@typescript-eslint/no-floating-promises": "error", | ||
| "@typescript-eslint/no-for-in-array": "error", | ||
| "@typescript-eslint/no-implied-eval": "error", | ||
| "@typescript-eslint/no-misused-new": "error", | ||
| "@typescript-eslint/no-misused-promises": "error", | ||
| "@typescript-eslint/no-namespace": "error", | ||
| "@typescript-eslint/no-non-null-asserted-optional-chain": "error", | ||
| "@typescript-eslint/no-redundant-type-constituents": "error", | ||
| "@typescript-eslint/no-require-imports": "error", | ||
| "@typescript-eslint/no-this-alias": "error", | ||
| "@typescript-eslint/no-unnecessary-type-assertion": "error", | ||
| "@typescript-eslint/no-unnecessary-type-constraint": "error", | ||
| "@typescript-eslint/no-unsafe-argument": "error", | ||
| "@typescript-eslint/no-unsafe-assignment": "error", | ||
| "@typescript-eslint/no-unsafe-call": "error", | ||
| "@typescript-eslint/no-unsafe-declaration-merging": "error", | ||
| "@typescript-eslint/no-unsafe-enum-comparison": "error", | ||
| "@typescript-eslint/no-unsafe-function-type": "error", | ||
| "@typescript-eslint/no-unsafe-member-access": "error", | ||
| "@typescript-eslint/no-unsafe-return": "error", | ||
| "@typescript-eslint/no-unsafe-unary-minus": "error", | ||
| "@typescript-eslint/no-wrapper-object-types": "error", | ||
| "@typescript-eslint/only-throw-error": "error", | ||
| "@typescript-eslint/prefer-as-const": "error", | ||
| "@typescript-eslint/prefer-namespace-keyword": "error", | ||
| "@typescript-eslint/prefer-promise-reject-errors": "error", | ||
| "@typescript-eslint/restrict-plus-operands": "error", | ||
| "@typescript-eslint/restrict-template-expressions": "error", | ||
| "@typescript-eslint/triple-slash-reference": "error", | ||
| "constructor-super": "off", | ||
| "for-direction": "error", | ||
| "no-array-constructor": "error", | ||
| "no-async-promise-executor": "error", | ||
| "no-case-declarations": "error", | ||
| "no-class-assign": "off", | ||
| "no-compare-neg-zero": "error", | ||
| "no-cond-assign": "error", | ||
| "no-const-assign": "off", | ||
| "no-constant-binary-expression": "error", | ||
| "no-constant-condition": "error", | ||
| "no-control-regex": "error", | ||
| "no-debugger": "error", | ||
| "no-dupe-class-members": "off", | ||
| "no-dupe-else-if": "error", | ||
| "no-dupe-keys": "off", | ||
| "no-duplicate-case": "error", | ||
| "no-empty": "error", | ||
| "no-empty-character-class": "error", | ||
| "no-empty-pattern": "error", | ||
| "no-empty-static-block": "error", | ||
| "no-ex-assign": "error", | ||
| "no-extra-boolean-cast": "error", | ||
| "no-fallthrough": "error", | ||
| "no-func-assign": "off", | ||
| "no-import-assign": "off", | ||
| "no-invalid-regexp": "error", | ||
| "no-irregular-whitespace": "error", | ||
| "no-loss-of-precision": "error", | ||
| "no-misleading-character-class": "error", | ||
| "no-new-native-nonconstructor": "off", | ||
| "no-nonoctal-decimal-escape": "error", | ||
| "no-obj-calls": "off", | ||
| "no-prototype-builtins": "error", | ||
| "no-redeclare": "off", | ||
| "no-regex-spaces": "error", | ||
| "no-self-assign": "error", | ||
| "no-setter-return": "off", | ||
| "no-shadow-restricted-names": "error", | ||
| "no-sparse-arrays": "error", | ||
| "no-this-before-super": "off", | ||
| "no-unassigned-vars": "error", | ||
| "no-unsafe-finally": "error", | ||
| "no-unsafe-negation": "off", | ||
| "no-unsafe-optional-chaining": "error", | ||
| "no-unused-expressions": "error", | ||
| "no-unused-labels": "error", | ||
| "no-unused-private-class-members": "error", | ||
| "no-unused-vars": "error", | ||
| "no-useless-backreference": "error", | ||
| "no-useless-catch": "error", | ||
| "no-useless-escape": "error", | ||
| "no-var": "error", | ||
| "prefer-const": "error", | ||
| "prefer-rest-params": "error", | ||
| "prefer-spread": "error", | ||
| "preserve-caught-error": "error", | ||
| "require-yield": "error", | ||
| "use-isnan": "error", | ||
| "valid-typeof": "error" | ||
| }, | ||
| "categories": {} | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.