Skip to content

Add check for outdated ESLint versions (W0063)#552

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-8ca0d662-78a6-4c48-ba5c-c3271ef3b4ca
Draft

Add check for outdated ESLint versions (W0063)#552
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-8ca0d662-78a6-4c48-ba5c-c3271ef3b4ca

Conversation

Copy link
Contributor

Copilot AI commented Sep 30, 2025

This PR adds a new warning check to detect when adapters are using outdated ESLint versions in their devDependencies.

Problem

ESLint 9.0.0 introduced significant improvements and breaking changes. Adapters still using older versions (especially 8.x and below) should be notified to update to benefit from the latest features and fixes.

Solution

Added warning W0063 that triggers when an adapter has eslint in its devDependencies with a version less than 9.0.0.

The check:

  • Extracts the ESLint version from devDependencies
  • Handles version prefixes (^, ~) correctly
  • Compares against the 9.0.0 threshold using the existing compareVersions library
  • Issues a user-friendly warning recommending the update
  • Only checks when ESLint is actually present (doesn't require ESLint to be used)

Example Warning

[W0063] eslint 8.57.0 is outdated. eslint 9.0.0 or newer is recommended. Please update devDependencies at package.json

Testing

Verified with multiple version scenarios:

  • ESLint 8.57.0, 8.0.0, 7.32.0 → correctly triggers warning
  • ESLint 9.0.0, 9.15.0, 10.0.0 → no warning (up-to-date)
  • No ESLint dependency → no warning (skipped)

Changes

  • lib/M0000_PackageJson.js: Added version check logic after devDependencies validation (15 lines)
  • README.md: Added changelog entry

Related to #[issue_number]

Original prompt

This section details on the original issue you should resolve

<issue_title>Check outdated eslint</issue_title>
<issue_description>If adapter is using eslint < 9.0.0 log a warning stating that eslint is outdated and an update to @eslint-config should be considered.

If adapter is using eslint >= 9.0.0 log a suggestion stating that using @eslint-config is recommended.

If @iobroker/eslint-config is listed as devDependency no more local eslint / prettier packages should be installed. So please check whether @iobroker/eslint-config is listed as devDependency. if it is listed log a warning suggesting to remove any other eslint or prettier packages which are installed.

Please add a remark to changelog at README.md
</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #500

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: mcm1957 <28575778+mcm1957@users.noreply.github.com>
Copilot AI changed the title [WIP] Check outdated eslint Add check for outdated ESLint versions (W0063) Sep 30, 2025
Copilot AI requested a review from mcm1957 September 30, 2025 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check outdated eslint

2 participants