import-js / import-js/eslint-plugin-import

no-internal-modules: configuration to opt in/out to enable/disable exports linting

Open
#1,920 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

Some time ago `no-internal-modules` rule added ES modules exports linting as a "fix" -> minor version bump (which was a breaking change btw).

From my experience, linting exports with this rule doesn't make much sense, as barrel/public-api files, can re-export from any nested path.
> for example angular public api patterns, nx patterns (with React as well)

**For better imagination I'm adding showcase of scaffold/public API**

![2020-10-05 at 2 20 PM](https://user-images.githubusercontent.com/1223799/95078812-05a05280-0716-11eb-959b-62c227c20876.png)

**feature proposal**

- to mitigate these kind of discussions, I'd like to propose to add configuration API to this rule to opt out/in for linting exports

```
rules: {
'import/no-internal-modules': ['error',{lintExports:false}],
}
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the implementation and tests for the `no-internal-modules` rule, then inspect how its current ES module export linting is configured. The change is done when the rule supports the proposed `lintExports` option for opting in or out and tests cover both settings.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.