Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate the need for an internal & public ESLint package #24251

Open
jaffrepaul opened this issue Oct 13, 2022 · 3 comments
Open

Eliminate the need for an internal & public ESLint package #24251

jaffrepaul opened this issue Oct 13, 2022 · 3 comments
Labels
npm: @cypress/eslint-plugin-dev @cypress/eslint-plugin-dev package issues process: dependencies Related to internal dependencies type: enhancement Requested enhancement of existing feature

Comments

@jaffrepaul
Copy link
Contributor

jaffrepaul commented Oct 13, 2022

What would you like?

  1. Move Cypess ESLint Dev rules into the Cypress root and eliminate the need to maintain an internal & public package.
  2. Add scripts to repo root and lint rules to individual packages
  3. Update dependencies and stale issues

Why is this needed?

There are a few things that can be addressed:

  1. There is an internal ESLint plugin with rules shared across different entities. However it's published on npm (3,783 weekly DLs 🤔) in addition to the public version (2,378,591 weekly DLs).
  2. The internal version is a dependency and its rules are extended in the public version with additional custom rules.
  3. Some lint rules seem to be run at the root level across the Cypress repo, where adding scripts at the root to run lint rules in each lib could be more optimal.
  4. We could move the rules from the internal dev plugin into the rules at the repo root, remove the dev package and move the public version into the monorepo's npm packages to not be maintaining two and minimize confusion about which to use.

Also...

  1. Users have begun forking the public version to update & make improvements because the current package has gone stale.
  2. ESLint and supporting tooling is very outdated in the dev version, making authoring new rules with modern .js incompatible in the public version.
  3. There are dependencies in the public version that aren't being used and could use general cleanup and maintenance by way of Dependebot or Renovate so the outdated dependency issue is automated away.

Other

No response

@jaffrepaul jaffrepaul added type: enhancement Requested enhancement of existing feature process: dependencies Related to internal dependencies npm: @cypress/eslint-plugin-dev @cypress/eslint-plugin-dev package issues labels Oct 13, 2022
@jaffrepaul jaffrepaul changed the title Eliminate the need for a internal & public ESLint package Eliminate the need for an internal & public ESLint package Oct 14, 2022
@flotwig
Copy link
Contributor

flotwig commented Dec 29, 2022

@jordanpowell88 @jaffrepaul Can this also entail removing lib/scripts from eslint-plugin-dev entirely? As of #25308, I don't see where any of these scripts are used in any repo in the cypress-io org. Also, they appear to be broken, I cannot get them to run, even though the tests are passing.

@jaffrepaul
Copy link
Contributor Author

Makes sense to me!

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Apr 15, 2024

@jennifer-shehane

Regarding your comment in cypress-io/eslint-plugin-cypress#114 (comment)

Yes, we don't intend to move this repo to the cypress repo. We'd prefer to keep it here.

npm/eslint-plugin-dev is not compatible with ESLint 8 due to a deprecation in this version (see The /lib entrypoint has been removed).

Beginning in v8.0.0, ESLint is strictly defining its public API. Previously, you could reach into individual files such as require("eslint/lib/rules/semi") and this is no longer allowed. There are a limited number of existing APIs that are now available through the /use-at-your-own-risk entrypoint for backwards compatibility, but these APIs are not formally supported and may break or disappear at any point in time.

So it's questionable whether this architecture should be carried forward or whether the eslint-plugin-dev should be withdrawn from use. The ESLint 8 release was announced in Oct 2021 and the latest announcement was for the ESLint 9 release on Apr 5, 2024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
npm: @cypress/eslint-plugin-dev @cypress/eslint-plugin-dev package issues process: dependencies Related to internal dependencies type: enhancement Requested enhancement of existing feature
Projects
None yet
Development

No branches or pull requests

4 participants