Skip to content

linter: Memory Leak with JS Plugins #19480

@Arnagos

Description

@Arnagos

What version of Oxlint are you using?

oxlint 1.43.0 / oxlint-tsgolint 0.11.5

What command did you run?

oxlint --type-aware (via vite-plugin-checker)

What does your .oxlintrc.json config file look like?

{
  "$schema": "node_modules/oxlint/configuration_schema.json",
  "plugins": ["eslint", "typescript", "import", "react", "jsx-a11y", "promise"],
  "jsPlugins": [
    "eslint-plugin-storybook",
    "@tanstack/eslint-plugin-query",
    {
      "name": "react-hooks-js",
      "specifier": "eslint-plugin-react-hooks"
    }
  ],
  "categories": {
    "correctness": "error",
    "suspicious": "warn",
    "perf": "warn",
    "style": "warn"
  },
  "env": {
    "builtin": true,
    "browser": true,
    "commonjs": true,
    "es2024": true,
    "jest": true,
    "node": true,
    "shared-node-browser": true
  },
  "ignorePatterns": [
    ".idea/**",
    ".tanstack/**",
    ".yarn/**",
    "dist/**",
    "nginx/**",
    "public/**",
    "node_moduels/**",
    "obj/**",
    "**/api/**",
    "src/__tests__/data/**/*",
    "src/__tests__/__snapshots__/**/*",
    "routeTree.gen.ts",
    "swagger.json"
  ],
  "rules": {
    "no-var": "error",
    "prefer-rest-params": "error",
    "prefer-spread": "error",
    "no-array-constructor": "error",
    "no-unused-expressions": "error",
    "no-empty-function": "error",
    "require-await": "error",
    "sort-keys": "off",
    "prefer-object-spread": "off",
    "sort-imports": "off",
    "no-duplicate-imports": "off",
    "no-magic-numbers": "off",
    "no-ternary": "off",
    "init-declarations": "off",
    "func-style": "off",
    "no-continue": "off",
    "max-params": "off",
    "arrow-body-style": "off",
    "id-length": "off",
    "no-await-in-loop": "error",
    "no-barrel-file": "error",
    "import/no-cycle": "error",
    "prefer-destructuring": "off",
    "new-cap": "off",
    "max-statements": "off",
    "capitalized-comments": "off",
    "no-implicit-coercion": "off",

    "typescript/await-thenable": "error",
    "typescript/no-array-delete": "error",
    "typescript/no-base-to-string": "error",
    "typescript/no-duplicate-type-constituents": "error",
    "typescript/no-floating-promises": "error",
    "typescript/no-for-in-array": "error",
    "typescript/no-implied-eval": "error",
    "typescript/no-meaningless-void-operator": "error",
    "typescript/no-misused-promises": "error",
    "typescript/no-misused-spread": "error",
    "typescript/no-mixed-enums": "error",
    "typescript/no-redundant-type-constituents": "error",
    "typescript/no-unnecessary-boolean-literal-compare": "error",
    "typescript/no-unnecessary-template-expression": "error",
    "typescript/no-unnecessary-type-arguments": "error",
    "typescript/no-unnecessary-type-assertion": "error",
    "typescript/no-unsafe-return": "error",
    "typescript/no-unsafe-unary-minus": "error",
    "typescript/non-nullable-type-assertion-style": "error",
    "typescript/only-throw-error": "error",
    "typescript/prefer-promise-reject-errors": "error",
    "typescript/prefer-reduce-type-parameter": "error",
    "typescript/prefer-return-this-type": "error",
    "typescript/promise-function-async": "error",
    "typescript/related-getter-setter-pairs": "error",
    "typescript/require-array-sort-compare": "error",
    "typescript/require-await": "error",
    "typescript/restrict-plus-operands": "error",
    "typescript/restrict-template-expressions": "error",
    "typescript/use-unknown-in-catch-callback-variable": "error",

    "typescript/switch-exhaustiveness-check": ["off", { "considerDefaultExhaustiveForUnions": true }],
    "typescript/unbound-method": "off",
    "typescript/no-unsafe-type-assertion": "off",
    "typescript/return-await": "off",
    "typescript/no-confusing-void-expression": "off",
    "typescript/no-unsafe-assignment": "off",
    "typescript/no-unsafe-member-access": "off",
    "typescript/no-unsafe-call": "off",
    "typescript/no-unsafe-argument": "off",
    "typescript/no-unsafe-enum-comparison": "off",

    "@typescript-eslint/ban-ts-comment": ["error", { "minimumDescriptionLength": 10 }],
    "@typescript-eslint/no-duplicate-enum-values": "error",
    "@typescript-eslint/no-dynamic-delete": "error",
    "@typescript-eslint/no-explicit-any": "error",
    "@typescript-eslint/no-extra-non-null-assertion": "error",
    "@typescript-eslint/no-extraneous-class": "error",
    "@typescript-eslint/no-misused-new": "error",
    "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
    "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
    "@typescript-eslint/no-require-imports": "error",
    "@typescript-eslint/no-this-alias": "error",
    "@typescript-eslint/no-unnecessary-type-constraint": "error",
    "@typescript-eslint/no-unsafe-declaration-merging": "error",
    "@typescript-eslint/no-unsafe-function-type": "error",
    "@typescript-eslint/no-wrapper-object-types": "error",
    "@typescript-eslint/prefer-as-const": "error",
    "@typescript-eslint/prefer-literal-enum-member": "error",
    "@typescript-eslint/prefer-namespace-keyword": "error",
    "@typescript-eslint/triple-slash-reference": "error",
    "@typescript-eslint/adjacent-overload-signatures": "error",
    "@typescript-eslint/array-type": ["error", { "default": "generic" }],
    "@typescript-eslint/ban-tslint-comment": "error",
    "@typescript-eslint/consistent-generic-constructors": "error",
    "@typescript-eslint/consistent-indexed-object-style": "error",
    "@typescript-eslint/consistent-type-definitions": "error",
    "@typescript-eslint/no-confusing-non-null-assertion": "error",
    "@typescript-eslint/no-inferrable-types": "error",
    "@typescript-eslint/prefer-for-of": "error",
    "@typescript-eslint/prefer-function-type": "error",
    "@typescript-eslint/explicit-function-return-type": ["error", { "allowExpressions": true }],
    "@typescript-eslint/no-empty-interface": "off",

    "react/jsx-key": "warn",
    "react/jsx-no-comment-textnodes": "warn",
    "react/jsx-no-duplicate-props": "warn",
    "react/jsx-no-target-blank": "warn",
    "react/jsx-no-undef": "warn",
    "react/jsx-props-no-spreading": "off",
    "react/jsx-max-depth": "off",
    "react/jsx-no-useless-fragment": "warn",

    "react/no-children-prop": "warn",
    "react/no-danger-with-children": "warn",
    "react/no-direct-mutation-state": "warn",
    "react/no-find-dom-node": "warn",
    "react/no-is-mounted": "warn",
    "react/no-render-return-value": "warn",
    "react/no-string-refs": "warn",
    "react/no-unescaped-entities": "warn",
    "react/no-unknown-property": "warn",
    "react/require-render-return": "warn",
    "react/react-in-jsx-scope": "off",
    "react/only-export-components": "error",
    "react/display-name": "warn",
    "react/exhaustive-deps": ["error", { "additionalHooks": "(useAsyncFn|useToggle|useDeepCompareEffect)" }],
    "react/rules-of-hooks": "error",

    "react-hooks-js/preserve-manual-memoization": "error",
    "react-hooks-js/unsupported-syntax": "error",
    "react-hooks-js/static-components": "error",
    "react-hooks-js/use-memo": "error",
    "react-hooks-js/void-use-memo": "error",
    "react-hooks-js/component-hook-factories": "error",
    "react-hooks-js/incompatible-library": "warn",
    "react-hooks-js/immutability": "error",
    "react-hooks-js/globals": "error",
    "react-hooks-js/refs": "error",
    "react-hooks-js/set-state-in-effect": "error",
    "react-hooks-js/error-boundaries": "error",
    "react-hooks-js/purity": "error",
    "react-hooks-js/set-state-in-render": "error",
    "react-hooks-js/config": "error",
    "react-hooks-js/gating": "error",

    "jsx-boolean-value": ["warn", "always"],
    "jsx-curly-brace-presence": ["warn", { "props": "always" }],

    "yoda": ["warn", "never"],

    "import/no-unassigned-import": "off",
    "import/no-named-export": "off",
    "import/group-exports": "off",
    "import/exports-last": "off",
    "import/prefer-default-export": "off",
    "import/no-named-as-default-member": "off",

    "promise/prefer-await-to-then": "off",
    "promise/always-return": "off",

    "@tanstack/query/exhaustive-deps": "error",
    "@tanstack/query/no-rest-destructuring": "warn",
    "@tanstack/query/stable-query-client": "error",
    "@tanstack/query/no-unstable-deps": "error",
    "@tanstack/query/infinite-query-property-order": "error",
    "@tanstack/query/no-void-query-fn": "error",
    "@tanstack/query/mutation-property-order": "error"
  },
  "overrides": [
    {
      "files": ["**/*.js", "**/*.cjs"],
      "rules": {
        "@typescript-eslint/no-require-imports": "off",
        "import/no-nodejs-modules": "off"
      }
    },
    {
      "files": ["src/api/**/*"],
      "rules": {
        "explicit-function-return-type": "off",
        "no-nested-ternary": "off",
        "no-explicit-any": "off",
        "consistent-indexed-object-style": "off",
        "array-type": "off"
      }
    },
    {
      "files": ["**/__tests__/**/*"],
      "plugins": ["vitest"]
    },
    {
      "files": ["**/*.stories.tsx"],
      "rules": {
        "react-hooks/rules-of-hooks": "off",
        "import-x/no-anonymous-default-export": "off",
        "storybook/await-interactions": "error",
        "storybook/context-in-play-function": "error",
        "storybook/default-exports": "error",
        "storybook/hierarchy-separator": "warn",
        "storybook/no-redundant-story-name": "warn",
        "storybook/no-renderer-packages": "error",
        "storybook/prefer-pascal-case": "warn",
        "storybook/story-exports": "error",
        "storybook/use-storybook-expect": "error",
        "storybook/use-storybook-testing-library": "error"
      }
    }
  ]
}

What happened?

I added Oxlint to my vite-plugin-checker config, which runs the linter on every file change, and after some time, the memory consumption gets so big that it basically crashes my whole system. Multiple applications close due to out-of-memory errors. This behavior stops when I remove the JS plugins from the Oxlint config.

System:
Windows 11 25H2 (26200.7840)
64GB RAM

Metadata

Metadata

Assignees

Labels

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions