bmish / eslint-doc-generator

Automatic documentation generator for ESLint plugins and rules.
92 stars 7 forks source link

Migrate to ESLint flat config for CI tests #529

Open MikeMcC399 opened 4 weeks ago

MikeMcC399 commented 4 weeks ago

What would you like?

Migrate tests running in .github/workflows/ci.yml to use ESLint flat configuration.

Why is this needed?

  1. The script lint, used in CI, relies on running eslint.
  2. The configuration for ESLint is contained in .eslintrc.cjs which is a standard configuration for ESLint v8.
  3. ESLint configuration .eslintrc is deprecated in ESLint v9 and is planned to be removed in ESLint v10.
  4. ESLint v8 support ceased on Oct 5, 2024.
  5. ESLint flat configuration is the standard for ESLint v9 and later.
  6. To ensure future support for internal linting of this repo, the deprecated .eslintrc.cjs configuration needs to be replaced by a flat configuration.

Other

Module Original Flat prerequisite Current
eslint 8.33.0 8.57.1 8.57.1
eslint-plugin-square 24.0.0 unavailable removed
eslint-plugin-node 11.1.0 unmaintained eslint-plugin-n@17.11.1
eslint-plugin-unicorn 45.0.2 >= 50.0.0 56.0.0
eslint-plugin-jest 27.2.1 >= 27.9.0 27.9.0
@typescript-eslint/eslint-plugin 5.52.0 >= 7.0.0
@typescript-eslint/parser 5.52.0 >= 7.0.0
@typescript-eslint/utils 5.52.0 >= 7.0.0

Comments

  1. eslint should be updated to the latest 8.* version to avoid any resolved issues supporting flat configurations in ESLint v8. Edit: done with PR #530
  2. eslint-plugin-square says "It is generally not recommended for public usage outside of Square." and this plugin offers no support for flat configurations. Edit: done with PR #539
  3. eslint-plugin-node states "This project has been no longer maintained. Please consider to use https://github.com/eslint-community/eslint-plugin-n." Edit: done with PR #540
MikeMcC399 commented 3 weeks ago

Partial resolution through:

ddzz commented 3 weeks ago

I would recommend removing eslint-plugin-square entirely. Per its README, it's not meant for use in projects outside of Square's organization.

MikeMcC399 commented 3 weeks ago

@ddzz

I would recommend removing eslint-plugin-square entirely. Per its README, it's not meant for use in projects outside of Square's organization.

Thank you for your guidance!

I guess it's no coincidence that eslint-plugin-square@24.0.0 currently used in this repo was released by @bmish, who was apparently working at Square at that time. I assume that this was done for convenience.

There are two issues mentioned in the original post supporting the removal:

Removing eslint-plugin-square, whilst preserving the linting functioning it was providing, requires adding back some other ESLint plugins it uses.

MikeMcC399 commented 3 weeks ago

@ddzz

I would recommend removing eslint-plugin-square entirely. Per its README, it's not meant for use in projects outside of Square's organization.

MikeMcC399 commented 2 weeks ago