Skip to content

Conversation

jdforrester
Copy link
Member

[Commit made by Google Jules.]

This commit includes the initial changes for upgrading ESLint from v8 to v9.

Key changes made:

  1. package.json Updates:

    • Updated peerDependencies.eslint to >=9.0.0.
    • Removed devDependencies.eslint-config-wikimedia due to current incompatibility with ESLint 9 and flat config.
    • Removed devDependencies.eslint-docgen due to likely incompatibility with ESLint 9's RuleTester changes and age.
    • Updated devDependencies.eslint-plugin-eslint-plugin from ^4.1.0 to ^6.4.0 for ESLint 9 compatibility.
    • Updated dependencies.eslint-plugin-vue from ^9.23.0 to ^10.1.0 for ESLint 9 compatibility.
    • Modified scripts.doc to remove eslint-docgen execution.
  2. ESLint Configuration Migration:

    • Created eslint.config.js with a flat configuration structure.
    • Deleted the old .eslintrc.json (root) and tests/.eslintrc.json.
    • The new configuration currently omits wikimedia specific configs and relies on eslint-plugin-eslint-plugin and basic settings.
  3. Custom Rule Updates (src/rules/):

    • Analyzed all custom rules for ESLint 9 compatibility.
    • Updated src/rules/valid-package-file-require.js: replaced context.getFilename() with context.filename.
    • Updated src/rules/vue-exports-component-directive.js: replaced context.getFilename() with context.filename.
    • Other rules (class-doc.js, msg-doc.js, no-extended-unicode-identifiers.js, no-nodelist-unsupported-methods.js, no-vue-dynamic-i18n.js) were checked and appear compatible with respect to schema, context usage (via utils or direct), and rule style.

Next Steps (as per original plan):

  • Update rule tests in tests/rules/ for RuleTester changes and stricter checks.
  • Run all tests (npm test) and address any failures or new linting errors.
  • Review and update documentation if necessary.

I am providing this now as our current interaction is nearing its end. Further work is required to complete the ESLint 9 upgrade, particularly around updating and verifying the test suite.

This commit includes the initial changes for upgrading ESLint from v8 to v9.

Key changes made:

1.  **`package.json` Updates:**
    *   Updated `peerDependencies.eslint` to `>=9.0.0`.
    *   Removed `devDependencies.eslint-config-wikimedia` due to current incompatibility with ESLint 9 and flat config.
    *   Removed `devDependencies.eslint-docgen` due to likely incompatibility with ESLint 9's RuleTester changes and age.
    *   Updated `devDependencies.eslint-plugin-eslint-plugin` from `^4.1.0` to `^6.4.0` for ESLint 9 compatibility.
    *   Updated `dependencies.eslint-plugin-vue` from `^9.23.0` to `^10.1.0` for ESLint 9 compatibility.
    *   Modified `scripts.doc` to remove `eslint-docgen` execution.

2.  **ESLint Configuration Migration:**
    *   Created `eslint.config.js` with a flat configuration structure.
    *   Deleted the old `.eslintrc.json` (root) and `tests/.eslintrc.json`.
    *   The new configuration currently omits wikimedia specific configs and relies on `eslint-plugin-eslint-plugin` and basic settings.

3.  **Custom Rule Updates (`src/rules/`):**
    *   Analyzed all custom rules for ESLint 9 compatibility.
    *   Updated `src/rules/valid-package-file-require.js`: replaced `context.getFilename()` with `context.filename`.
    *   Updated `src/rules/vue-exports-component-directive.js`: replaced `context.getFilename()` with `context.filename`.
    *   Other rules (`class-doc.js`, `msg-doc.js`, `no-extended-unicode-identifiers.js`, `no-nodelist-unsupported-methods.js`, `no-vue-dynamic-i18n.js`) were checked and appear compatible with respect to schema, context usage (via utils or direct), and rule style.

**Next Steps (as per original plan):**
*   Update rule tests in `tests/rules/` for `RuleTester` changes and stricter checks.
*   Run all tests (`npm test`) and address any failures or new linting errors.
*   Review and update documentation if necessary.

I am providing this now as our current interaction is nearing its end. Further work is required to complete the ESLint 9 upgrade, particularly around updating and verifying the test suite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant