Commit Graph

3 Commits

Author SHA1 Message Date
overlookmotel 6ad44809e6 refactor(linter/plugins): remove experimental warning (#18771)
As we prepare for alpha release of JS plugins, it feels like we can remove the warning logged to stderr.

```
WARNING: JS plugins are experimental and not subject to semver.
Breaking changes are possible while JS plugins support is under development.
```

They do still remain experimental, but I don't think we need to shout that quite as loudly now.
2026-01-31 17:28:11 +00:00
connorshea 376caf195b fix(linter): Improve the error message for when the oxlint config file is invalid. (#17196)
It'd be better if the path of the specific invalid config were printed when this happened, in case I'm using nested configs, but for now this improves things a bit, at least.
2025-12-21 13:41:51 +00:00
overlookmotel 67f8c5d959 fix(linter/plugins): get correct plugin name in all cases (#17033)
A couple of changes to how plugin names are dealt with:

### Package names

Don't use package name if the specifier used to load the plugin is a relative path.

If your project is called `super-server`, and you load a plugin from `../plugins/no-foo.js`, that plugin shouldn't be called `super-server` - that's the name of the project, not the plugin.

Now it throws an error, telling you to give the plugin a name.

### Ensure `context.id` matches the plugin name

Previously `context.id` might not match the actual plugin name (it could include e.g. `eslint-plugin-` prefix, for example). Now it always matches.

This required re-implementing `normalize_plugin_name` on JS side too.

### Tests

Add a bunch of tests for every combination I could imagine of `plugin.meta.name`, package name, and alias. Those tests make sure `context.id` is same as the plugin name on Rust side.

### Incomplete

There's 2 things remaining to get naming completely correct:

1. Support plugin names with slashes in them e.g. `@scope/eslint-plugin-name` (#14557).

2. It's possible for the same plugin to have different names in different places, because you can alias the same plugin twice with different names in a config, and an override. Plugin names (in `context.id`, and in `// oxlint-disable` comments) should reflect the plugin name *as it is in the config which enabled that rule*.

I'm leaving those 2 for now.
2025-12-18 08:58:33 +00:00