Skip to content

Add note(s) to docs about flat configs and/or no-unused-modules' unusedExports not being supported in flat configsΒ #2964

Closed
@nnmrts

Description

@nnmrts

I think for most users of this plugin it's not immediately obvious that flat configs are not or only partially supported. See for example the mentions of this issue in various commits, PRs and issues: #2556.

If I understand correctly after going through some of the issues here, the flat config format in general is not "officially" supported by this plugin, however it's not clear to me what exactly breaks and what not. I only found this (which aims to add support but doesn't have a lot of information) and this comment here:

@keijokapp going from "we do not support flat config" to "we support it except for one rule which is horrible broken" isn't an improvement imo, since it will discourage people from using the rule in a way that will last long after it's eventually made to work.
-- @ljharb

In my opinion it should be made clear somewhere in the readme what "we do not support flat config" actually means. For me personally at least everything except for setting unusedExports to true in no-unused-modules "works" though.

Which brings me to the main point of this issue: Can we document this fact in https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unused-modules.md? Especially because both the "In the future, these options will be enabled by default (see #1324)" and the example below might encourage readers to set unusedExports to true. Maybe a link to #2907 should be included.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions