Add ESLint flat config with CI enforcement#922
Draft
loganrosen wants to merge 3 commits intohacs:mainfrom
Draft
Conversation
There was a problem hiding this comment.
Pull request overview
This PR upgrades the frontend’s linting toolchain to ESLint v10 using the new flat config format, and adds a CI job to enforce linting to keep the codebase consistently formatted and error-free.
Changes:
- Upgrade ESLint + related plugins/configs and migrate from
.eslintrc.yamltoeslint.config.mjs(flat config). - Add
yarn lintand a dedicated CI lint job (Node 22), while keeping the build job on Node 18. - Apply targeted lint-driven code fixes (console usage, reload behavior, optional chaining, a11y
alt, regex escapes, and TS type cleanup).
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
yarn.lock |
Updates dependency graph for ESLint v10 + plugin upgrades/removals. |
package.json |
Adds lint script and updates ESLint-related devDependencies. |
eslint.config.mjs |
Introduces ESLint v10 flat config and project lint rules/ignores. |
.github/workflows/test.yml |
Adds lint job in CI and splits Node versions for lint vs build. |
.eslintrc.yaml |
Removes legacy ESLint config. |
src/tools/markdown.ts |
Regex escape cleanups aligned with lint rules. |
src/tools/hacs-logger.ts |
File-level no-console disable for logger implementation. |
src/extra.ts |
Uses location.reload() and suppresses no-console for a single error log. |
src/dashboards/hacs-repository-dashboard.ts |
Replaces unused-expression pattern with optional chaining invocation. |
src/dashboards/hacs-dashboard.ts |
Same optional chaining fix + adds alt for integration icon image. |
src/components/dialogs/show-hacs-dialog.ts |
Replaces empty interface with a type alias. |
src/components/dialogs/hacs-form-dialog.ts |
Removes stray debug console.log. |
src/components/dialogs/hacs-custom-repositories-dialog.ts |
Removes stray debug console.log. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
ludeeus
requested changes
Mar 16, 2026
Updates the HA frontend submodule from 20250109.0 to 20260312.0, bringing in upstream dependency updates including gulp 5.0.1 which fixes Node 20+ compatibility (gulp-cli 3.1.0 handles async ESM). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adapt to upstream component renames and removals: - ha-circular-progress → ha-spinner - ha-menu/ha-md-menu-item → ha-dropdown/ha-dropdown-item - ha-button-menu → ha-dropdown - createCloseHeading() → ha-dialog header-title attribute - resources/compatibility and @polymer/polymer removed - resources/ha-style → resources/append-ha-style Build system fixes: - polymer_dir → root_dir in paths.cjs and rspack.cjs - Remove isHassioBuild (removed upstream) - Write dummy iconMetadata.json for rspack resolution Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace broken .eslintrc.yaml with eslint.config.mjs (flat config). Add lint script and CI job. Fix all lint errors: - Remove debug console.log calls - Empty interface → type alias - location.href self-assign → location.reload() - Unnecessary regex escapes - Add alt attr to decorative img - eslint-disable for logger utility Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
a4b78a2 to
013f5e3
Compare
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.
Replaces the broken
.eslintrc.yamlwith a moderneslint.config.mjsflat config and adds lint enforcement to CI.Depends on #923 (submodule update).
Changes
.eslintrc.yaml(was non-functional — referenced missing plugins)eslint.config.mjsflat config using plugins already in the submodule's dependency treeyarn lintscript and CI lint jobsrc/Lint fixes
console.logcalls in dialog error handlers@typescript-eslint/no-empty-object-type)location.href = location.href→location.reload()(no-self-assign)no-useless-escape)alt=""to decorative integration icon img (lit-a11y/alt-text)eslint-disable no-consolefor logger utility