adobe / adobe/react-spectrum

Add ESLint plugin for `use-monopackages` and `use-subpaths` codemods

Open
#9,986 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
15.9k
Forks
1.6k
Avg merge
3d 9m
Merged PRs (30d)
59

Description

### Provide a general summary of the feature here

Hello!

I think https://github.com/adobe/react-spectrum/pull/9839 is super cool, but after running the codemod, there is nothing to enforce that whatever of `use-monopackages` and `use-subpaths` is picked is followed for new code.

I'd like to see an ESLint plugin that does this with an autofix in addition to the codemod (or instead of the codemod, but presumably the codemod is quicker on larger code bases (and the code is already written)).

### 🤔 Expected Behavior?

Running `eslint` should warn if the monopackages are not used (and potentially if subpaths aren't used) and provide the relevant autofix

### 😯 Current Behavior

There is no way to statically catch "regressions" back to individual packages or no subpaths.

### 💁 Possible Solution

One could run the codemod on CI and error on diffs, but that iteration loop is way worse than haaving ESLint fix it when saving in the idea (or AI agent runs eslint - whatever the workflow is)

### 🔦 Context

Making sure we don't start importing from the individual packages or not use subpaths

### 💻 Examples

_No response_

### 🧢 Your Company/Team

_No response_

### 🕷 Tracking Issue

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.