Open Zamiell opened 2 months ago
Agree. The plugin itself should also be exported, which it isn't today: https://github.com/eslint-community/eslint-plugin-eslint-comments/blob/main/configs.js
For now, VoxPelli helped me work around the issue with this code:
// @ts-expect-error https://github.com/eslint-community/eslint-plugin-eslint-comments/issues/214
import ESLintPluginESLintCommentsConfigs from "@eslint-community/eslint-plugin-eslint-comments/configs";
import tseslint from "typescript-eslint";
// The plugin is not currently exported from the root, so we have to get the plugin from the config.
// https://github.com/eslint-community/eslint-plugin-eslint-comments/issues/215
const ESLintPluginESLintComments =
ESLintPluginESLintCommentsConfigs.recommended.plugins[
"@eslint-community/eslint-comments"
];
export const configFoo = tseslint.config({
plugins: {
"@eslint-community/eslint-comments": ESLintPluginESLintComments,
},
});
But this is really confusing and weird so hopefully it is exported from the root in the next version of the plugin.
The getting started page shows how to import the
recommended
config into a flat config. But I don't want to use therecommended
config. I just want to import the plugin and then choose for myself what rules to turn on. The documentation does not cover this. Is this possible?I did some digging and it looks like the
index.js
file does not even export the plugin (??), so I am very confused.