Skip to content

Drop eslint-config-airbnb-base and cherry-pick rules#51627

Open
loganrosen wants to merge 1 commit intohome-assistant:devfrom
loganrosen:drop-airbnb-base
Open

Drop eslint-config-airbnb-base and cherry-pick rules#51627
loganrosen wants to merge 1 commit intohome-assistant:devfrom
loganrosen:drop-airbnb-base

Conversation

@loganrosen
Copy link
Copy Markdown
Contributor

@loganrosen loganrosen commented Apr 20, 2026

Proposed change

Drop the unmaintained eslint-config-airbnb-base dependency (last updated Nov 2021, no flat config support) and its FlatCompat shim infrastructure.

What this PR does:

  • Replace airbnb-base with js.configs.recommended as the base config
  • Cherry-pick ~40 high-value safety and style rules from airbnb-base that are not already covered by other configs in the repo
  • Remove 27 rule disables that only existed to suppress airbnb opinions (no longer needed)
  • Remove 5 dead TypeScript rule disables for rules no longer in the config
  • Remove 3 devDependencies: @eslint/eslintrc, eslint-config-airbnb-base, eslint-plugin-import
  • Fix 4 real bugs caught by the newly enabled no-constant-binary-expression rule, where template literal expressions like `${value}px` are always truthy strings, making || fallback unreachable
  • Add no-useless-assignment as "off" with a TODO (43 existing violations — separate cleanup PR)

Type of change

  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to backend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

To help with the load of incoming pull requests:

@github-actions github-actions bot added Demo Related to frontend demo content Design Related to Home Assistant design gallery labels Apr 20, 2026
Remove the unmaintained eslint-config-airbnb-base dependency (last
updated Nov 2021, no flat config support) along with its FlatCompat
shim infrastructure.

Replace with js.configs.recommended as the base config and explicitly
cherry-pick ~40 high-value safety and style rules from airbnb-base
that aren't already covered by other configs.

Remove 27 rule disables that only existed to suppress airbnb opinions,
and 5 dead TypeScript rule disables for rules no longer in the config.

Fix 4 real bugs caught by the newly added no-constant-binary-expression
rule where template literals were always truthy, making fallback values
unreachable.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@MindFreeze MindFreeze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this but since changes the linting slightly, the other from the team need to agree as well

Comment thread eslint.config.mjs
Comment on lines +102 to +104
// TODO: Enable once violations are fixed (43 instances as of 2026-04)
// "no-useless-assignment": "error",
"no-useless-assignment": "off",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well fix them in this PR, I think

Comment thread eslint.config.mjs
"no-underscore-dangle": "off",
strict: "off",
"no-plusplus": "off",
// Cherry-picked safety rules (previously provided by airbnb-base)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Cherry-picked safety rules (previously provided by airbnb-base)

It's good for this PR to know that, but I think we don't need such comments in the codebase.

@wendevlin
Copy link
Copy Markdown
Member

I like this but since changes the linting slightly, the other from the team need to agree as well

I agree with this change, it brings more transparency to our linting rules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed Demo Related to frontend demo content Design Related to Home Assistant design gallery

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants