Repository navigation
chore: migrate to eslint 10 flat config - #244
Merged
Merged
Conversation
eslint-config-athom@4 peer-requires eslint >=8.57.1 <9, and its eslint-plugin-node@11 dependency crashes on eslint 9+ even through FlatCompat, so the config cannot come along. Replace it with the setup node-zigbee uses: @eslint/js recommended, globals, curly and an underscore prefix for intentionally unused bindings. typescript-eslint is left out, this repo is plain JavaScript. Drops the eslint-disable directives for rules that no longer apply, and prefixes the bindings the stricter no-unused-vars now flags.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The configuration fits the CommonJS/Mocha setup and Node 24 CI environment, and the remaining edits preserve runtime behavior with no blocking issues identified.
No open issues 🎉
What changed in this PR
Migrates the Zigbee Cluster Library from ESLint 6 to ESLint 10 using a CommonJS flat configuration, replacing the incompatible Athom preset and superseding #222.
Changes:
- Adds recommended ESLint rules, Node/Mocha globals, and underscore-prefixed unused-binding exemptions.
- Removes obsolete lint directives and updates unused bindings without changing runtime behavior.
- Drops legacy style enforcement, with formatting checks deferred to the planned Prettier follow-up.
| File | Description |
|---|---|
test/testZCLError.js |
Removes obsolete lint directives. |
test/testTrxSequenceNumber.js |
Removes obsolete lint directive. |
test/testNode.js |
Removes lint directive and unused catch bindings. |
test/testMfgSpecificCommands.js |
Removes obsolete lint directive. |
test/testClusterResponseTimeout.js |
Removes obsolete lint directives. |
test/ota.js |
Removes obsolete lint directive. |
test/onOff.js |
Removes obsolete lint directive. |
test/manual/xiaomiHacks.js |
Prefixes unused parameters and removes lint directives. |
test/levelControl.js |
Removes obsolete lint directive. |
test/iasZone.js |
Removes obsolete lint directive. |
test/doorLock.js |
Removes obsolete lint directive. |
test/colorControl.js |
Removes obsolete lint directives. |
test/boundClusterAttributeStatus.js |
Removes obsolete lint directive. |
package.json |
Updates ESLint dependencies and removes Athom preset. |
lib/zclTypes.js |
Removes blanket lint suppression. |
lib/zclFrames.js |
Removes obsolete lint directive. |
lib/util/index.js |
Removes obsolete lint directive. |
lib/Node.js |
Removes obsolete lint directive. |
lib/Endpoint.js |
Removes unused catch binding. |
lib/Cluster.js |
Removes obsolete lint directives. |
lib/BoundCluster.js |
Prefixes unused bindings and removes lint directives. |
eslint.config.js |
Adds CommonJS flat configuration and test globals. |
.eslintrc.json |
Removes legacy configuration. |
.eslintignore |
Removes legacy ignore file; build exclusion moves into flat config. |
Review effort: Balanced
This was referenced Oct 23, 2026
The underscore prefixes added here say the parameters are unused, but not that the behavior is wrong. discoverAttributes and discoverAttributesExtended ignore startValue and maxResults and always answer with every attribute and lastResponse true, so a device asking for attributes from an offset gets the full list from zero. Recording it rather than fixing it: the fix is a behavior change on a ZCL command and does not belong in a lint migration.
RobinBol
added a commit
that referenced
this pull request
Oct 23, 2026
The generated docs are a static site that works straight from disk: no fetch, no XHR, no module scripts, only relative classic script tags. Checked over file:// in Chrome and Safari, with stylesheets, the sidebar filter, dark mode, syntax highlighting and deep links all working, and console output identical to serving it over http. So serve, watch and concurrently go without a replacement, along with build:clean and build:watch. Together they pulled in 148 transitive dependencies and 5 audit findings for a preview that never runs in CI; concurrently@5 is from 2020 and watch@1.0.2 from 2016. npm run docs builds and opens build/index.html with macOS open. AGENTS.md says how to view the docs elsewhere, and its lint line no longer refers to the eslint-config-athom setup that #244 removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
eslint 6 -> 10 with a flat config.
.eslintrc.jsonand.eslintignorebecomeeslint.config.js, andeslint-config-athomis dropped. Supersedes #222.Why
eslint-config-athom@4.0.2is still a legacy eslintrc config with a peer ofeslint >=8.57.1 <9.0.0, so it cannot be installed next to eslint 10.FlatCompatdoes not rescue it either: it pullseslint-plugin-node@11, unmaintained since 2021, which callscontext.getFilename, removed in eslint 9.both failures
So the config has to go. This follows the setup our other Node projects already run:
@eslint/jsrecommended,globals,curly: ['error', 'multi-line'], andno-unused-varswith an^_prefix for intentionally unused bindings. Notypescript-eslint, this repo is plain JavaScript.How
Also in the diff: 35
eslint-disabledirectives for rules that no longer exist, and 19 bindings the stricterno-unused-varsflags, prefixed with_or changed to an optional catch binding.A last commit adds a TODO on
discoverAttributesanddiscoverAttributesExtended. The_prefixes say those parameters are unused but not that the behavior is wrong: both ignorestartValueandmaxResultsand always answer with every attribute andlastResponse: true. Recorded, not fixed, since that is a behavior change on a ZCL command.Trade-off: every airbnb-base style rule goes with it (
indent,quotes,semi,max-len). Only correctness rules remain. #245 wires up prettier to put style enforcement back, so merge the two close together.Testing
npm test114 passing,npm run lintexit 0,npm run buildok,generate-typesleavesindex.d.tsunchanged,tsc --noEmitexit 0.npm audit19 -> 9, lockfile 584 -> 390 entries.