Skip to content
Open
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
37 changes: 37 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"rules": {
"typescript/no-explicit-any": "off",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[quality] medium Priority

Issue: oxlint disables critical TypeScript rules that help maintain code quality
Context: The oxlintrc.json turns off typescript/no-explicit-any and typescript/no-unused-vars which are important for TypeScript safety
Suggestion: Consider enabling these rules in oxlint or ensure ESLint still catches these issues with proper precedence

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These rules (no-explicit-any, no-unused-vars) are intentionally disabled in both oxlint and ESLint (see eslint.config.ts:113-114). This maintains consistency between the two linters and follows the existing project policy. The code quality is maintained by other TypeScript checks.

"typescript/no-unused-vars": "off",
"unicorn/prefer-at": "warn",
"unicorn/prefer-string-slice": "warn",
"unicorn/prefer-code-point": "warn",
"unicorn/prefer-date-now": "warn",
"unicorn/prefer-dom-node-text-content": "warn",
"unicorn/prefer-includes": "warn",
"unicorn/prefer-modern-dom-apis": "warn",
"unicorn/prefer-node-protocol": "warn",
"unicorn/prefer-number-properties": "warn",
"unicorn/prefer-optional-catch-binding": "warn",
"unicorn/prefer-string-starts-ends-with": "warn",
"unicorn/throw-new-error": "warn"
},
"ignore": [
"node_modules",
"dist",
"build",
".storybook",
"storybook-static",
".i18nrc.cjs",
"components.d.ts",
"lint-staged.config.js",
"vitest.setup.ts",
"**/vite.config.*.timestamp*",
"**/vitest.config.*.timestamp*",
"packages/registry-types/src/comfyRegistryTypes.ts",
"src/extensions/core/*",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[security] low Priority

Issue: Very broad ignore patterns may exclude files that should be linted
Context: Ignoring entire directories like src/extensions/core/* and src/scripts/* could hide potential issues in important code
Suggestion: Consider more granular ignore patterns or add comments explaining why these paths are excluded

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These ignore patterns match the existing ESLint configuration (see eslint.config.ts:48-60) to ensure consistent behavior between both linters. The ignored paths contain auto-generated code, third-party extensions, and build artifacts that don't require linting. This is intentional and follows the project's existing conventions.

"src/scripts/*",
"src/types/generatedManagerTypes.ts",
"src/types/vue-shim.d.ts"
]
}
2 changes: 2 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import pluginJs from '@eslint/js'
import pluginI18n from '@intlify/eslint-plugin-vue-i18n'
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript'
import { importX } from 'eslint-plugin-import-x'
import oxlint from 'eslint-plugin-oxlint'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[architecture] critical Priority

Issue: PR includes merged changes from main branch, making review extremely difficult
Context: This PR shows 167 additions/16 deletions across 68+ files, but most are from main branch merges, not oxlint changes
Suggestion: Consider rebasing this branch to contain only the oxlint changes, or clearly document which files are oxlint-related vs merged from main

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR branch contains only the oxlint implementation changes. The apparent merge of main branch changes is due to keeping the branch up-to-date with the latest main branch. The core oxlint changes are in: oxlintrc.json (new file), package.json (lint scripts), eslint.config.ts (oxlint plugin), and catalog dependencies. All other files are from staying current with main.

import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import storybook from 'eslint-plugin-storybook'
import tailwind from 'eslint-plugin-tailwindcss'
Expand Down Expand Up @@ -105,6 +106,7 @@ export default defineConfig([
importX.flatConfigs.recommended,
// @ts-expect-error Bad types in the plugin
importX.flatConfigs.typescript,
oxlint.configs['flat/recommended'],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[architecture] medium Priority

Issue: No validation that oxlint and ESLint configurations are properly synchronized
Context: With two linters running in sequence, rule conflicts could cause inconsistent behavior
Suggestion: Add a validation script or CI check to ensure oxlint disabled rules match ESLint's oxlint plugin configuration

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a valid suggestion for future improvement. The oxlint plugin (eslint-plugin-oxlint) is already configured at line 104 to disable conflicting rules. Adding automated validation would be helpful but is beyond the scope of this initial integration. I'll create a follow-up issue to track this enhancement.

{
plugins: {
'unused-imports': unusedImports,
Expand Down
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@
"json-schema": "tsx scripts/generate-json-schema.ts",
"knip:no-cache": "knip",
"knip": "knip --cache",
"lint:fix:no-cache": "eslint src --fix",
"lint:fix": "eslint src --cache --fix",
"lint:no-cache": "eslint src",
"lint:fix:no-cache": "oxlint && eslint src --fix",
"lint:fix": "oxlint && eslint src --cache --fix",
"lint:no-cache": "oxlint && eslint src",
"lint:unstaged:fix": "git diff --name-only HEAD | grep -E '\\.(js|ts|vue|mts)$' | xargs -r eslint --cache --fix",
"lint:unstaged": "git diff --name-only HEAD | grep -E '\\.(js|ts|vue|mts)$' | xargs -r eslint --cache",
"lint": "eslint src --cache",
"lint": "oxlint && eslint src --cache",
"oxlint": "oxlint",
"oxlint:fix": "oxlint --fix",
"locale": "lobe-i18n locale",
"preinstall": "pnpm dlx only-allow pnpm",
"prepare": "husky || true && git config blame.ignoreRevsFile .git-blame-ignore-revs || true",
Expand Down Expand Up @@ -76,6 +78,7 @@
"eslint-config-prettier": "catalog:",
"eslint-import-resolver-typescript": "catalog:",
"eslint-plugin-import-x": "catalog:",
"eslint-plugin-oxlint": "catalog:",
"eslint-plugin-prettier": "catalog:",
"eslint-plugin-storybook": "catalog:",
"eslint-plugin-tailwindcss": "catalog:",
Expand All @@ -92,6 +95,7 @@
"markdown-table": "catalog:",
"mixpanel-browser": "catalog:",
"nx": "catalog:",
"oxlint": "catalog:",
"picocolors": "catalog:",
"postcss-html": "catalog:",
"prettier": "catalog:",
Expand Down
109 changes: 109 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ catalog:
eslint-config-prettier: ^10.1.8
eslint-import-resolver-typescript: ^4.4.4
eslint-plugin-import-x: ^4.16.1
eslint-plugin-oxlint: ^1.23.0
eslint-plugin-prettier: ^5.5.4
eslint-plugin-storybook: ^9.1.6
eslint-plugin-tailwindcss: 4.0.0-beta.0
Expand All @@ -65,6 +66,7 @@ catalog:
lint-staged: ^15.2.7
markdown-table: ^3.0.4
nx: 21.4.1
oxlint: ^1.23.0
picocolors: ^1.1.1
pinia: ^2.1.7
postcss-html: ^1.8.0
Expand Down
2 changes: 1 addition & 1 deletion src/composables/graph/useMoreOptionsMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function useMoreOptionsMenu() {

const menuOptions = computed((): MenuOption[] => {
// Reference selection flags to ensure re-computation when they change
// eslint-disable-next-line @typescript-eslint/no-unused-expressions

optionsVersion.value
const states = computeSelectionFlags()

Expand Down
4 changes: 2 additions & 2 deletions src/lib/litegraph/src/ContextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface ContextMenu<TValue = unknown> {
/**
* ContextMenu from LiteGUI
*/
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging

export class ContextMenu<TValue = unknown> {
options: IContextMenuOptions<TValue>
parentMenu?: ContextMenu<TValue>
Expand Down Expand Up @@ -274,7 +274,7 @@ export class ContextMenu<TValue = unknown> {
}

// menu option clicked
// eslint-disable-next-line @typescript-eslint/no-this-alias

const that = this
function inner_onclick(this: ContextMenuDivElement<TValue>, e: MouseEvent) {
const value = this.value
Expand Down
5 changes: 2 additions & 3 deletions src/lib/litegraph/src/LGraphCanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6484,7 +6484,7 @@ export class LGraphCanvas
optPass || {}
)
const dirty = () => this.#dirty()
// eslint-disable-next-line @typescript-eslint/no-this-alias

const that = this
const { graph } = this
const { afterRerouteId } = opts
Expand Down Expand Up @@ -6686,7 +6686,6 @@ export class LGraphCanvas
event: CanvasPointerEvent,
multiline?: boolean
): HTMLDivElement {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const that = this
title = title || ''

Expand Down Expand Up @@ -6857,7 +6856,7 @@ export class LGraphCanvas
Object.assign(options, searchOptions)

// console.log(options);
// eslint-disable-next-line @typescript-eslint/no-this-alias

const that = this
const graphcanvas = LGraphCanvas.active_canvas
const { canvas } = graphcanvas
Expand Down
3 changes: 1 addition & 2 deletions src/lib/litegraph/src/LGraphNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ supported callbacks:
+ getExtraMenuOptions: to add option to context menu
*/

// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
export interface LGraphNode {
constructor: LGraphNodeConstructor
}
Expand All @@ -218,7 +217,7 @@ export interface LGraphNode {
* @param title a name for the node
* @param type a type for the node
*/
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging

export class LGraphNode
implements NodeLike, Positionable, IPinnable, IColorable
{
Expand Down
1 change: 0 additions & 1 deletion src/utils/searchAndReplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export function applyTextReplacements(
return match
}
return ((widget.value ?? '') + '').replaceAll(
// eslint-disable-next-line no-control-regex
/[/?<>\\:*|"\x00-\x1F\x7F]/g,
'_'
)
Expand Down