Skip to content

linter: @eslint-react/eslint-plugin does not work jsPlugins #14503

@DreierF

Description

@DreierF

What version of Oxlint are you using?

1.22.0

What command did you run?

oxlint

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

{
	"$schema": "./node_modules/oxlint/configuration_schema.json",
	"jsPlugins": ["@eslint-react/eslint-plugin"],
	"categories": {
		"correctness": "off"
	},
	"rules": {
		"@eslint-react/jsx-no-comment-textnodes": ["error"],
		"@eslint-react/dom/no-dangerously-set-innerhtml": ["error"],
		"@eslint-react/naming-convention/context-name": ["error"]
	}
}

What happened?

When trying out jsPlugins with @eslint-react/eslint-plugin I ran into multiple issues:
At first it fails with

  × Failed to load JS plugin: @eslint-react/eslint-plugin
  │   Package subpath '.' is not defined by "exports" in .../node_modules/@eslint-react/eslint-plugin/package.json

The conditional exports in the package.json does not seem to be correctly resolved

  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.js"
    },
  },

Patching the exports to

  "exports": {
    ".": "./dist/index.js"
  },

fixes the issue.

Then it fails with

  × Plugin '@eslint-react' not found

This seem to be because the plugin exposes itself as meta: { name: '@eslint-react/eslint-plugin', version: '2.0.6' }, however the error persists when changing the rule names to @eslint-react/eslint-plugin/<local rule name>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions