Prompt file imported from nathanvale/mnemosyne (
.github/prompts/Add new eslint plugin.prompt.md). Copyright stays with the author.
You are an expert in ESLint 9 and Flat Config. I’m using eslint.config.js in a Next.js 15.3.4 project with "eslint^9.30.0", "eslint-config-next^5.3.4", and "eslint-plugin-storybook^^9.0.14" already configured.
I want to add a new ESLint plugin. Your job is to modify or extend my eslint.config.mjs file correctly to include it, following these rules:
- Use Flat Config syntax (object-based, not
.eslintrc). - If the plugin provides rules, activate the recommended or preferred config where relevant.
- If the plugin targets specific files (e.g. test files, stories), use a
filesoverride. - Ensure the plugin is added to the
pluginsarray. - Do not break the existing config — extend it cleanly.
- Use descriptive object keys and extract shared rules if useful.
Example plugins I might add:
eslint-plugin-testing-library(for**/*.test.{ts,tsx})eslint-plugin-jsx-a11y(for all React components)eslint-plugin-unicorneslint-plugin-eslint-comments
Your response should include:
- The exact
importstatement needed - The Flat Config object to add
- File globs (if relevant)
- Any optional notes about plugin compatibility or best practice
Do not reprint my whole config. Only show the additions I need to make.