Skip to content

Comments

UHF-X: Add no console rule#1453

Merged
jeremysteerio merged 2 commits intomainfrom
UHF-X-add-no-console-rule
Dec 5, 2025
Merged

UHF-X: Add no console rule#1453
jeremysteerio merged 2 commits intomainfrom
UHF-X-add-no-console-rule

Conversation

@jeremysteerio
Copy link
Contributor

UHF-0000

What was done

  • Add no console rule (as we had with ESLint ruleset)

How to install

  • Make sure your instance is up and running on latest dev-branch
    • git checkout dev && git pull origin dev
    • make fresh
  • Update the HDBT theme
    • composer require drupal/hdbt:dev-UHF-X-add-no-console-rule
  • Run code updates
    • make drush-locale-update drush-cr

How to test

  • Try adding console.log to any js file that gets linted. This should trigger an error when running npm run lint:js or npm run build
  • Other console methods should be still available for use

Copilot AI review requested due to automatic review settings December 5, 2025 12:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a noConsole rule to the Biome linter configuration to restrict the use of console.log in JavaScript files, while still allowing other console methods like assert, error, info, and warn. This brings the Biome configuration in line with the previous ESLint ruleset.

Key Changes:

  • Added noConsole rule with warning level to the suspicious rules section
  • Configured allowed console methods (assert, error, info, warn) while blocking console.log
  • Reformatted the suspicious rules object for better readability

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

]
}
},
"noGlobalIsFinite":"off"
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

Missing space after colon in "noGlobalIsFinite":"off". For consistency with the rest of the file's formatting style (e.g., line 15), this should be "noGlobalIsFinite": "off" with a space after the colon.

Suggested change
"noGlobalIsFinite":"off"
"noGlobalIsFinite": "off"

Copilot uses AI. Check for mistakes.
@jeremysteerio jeremysteerio merged commit 5c911ff into main Dec 5, 2025
5 checks passed
@jeremysteerio jeremysteerio deleted the UHF-X-add-no-console-rule branch December 5, 2025 13:00
@github-actions
Copy link

github-actions bot commented Dec 5, 2025

✅ Tests passed! You can check the output here: https://city-of-helsinki.github.io/drupal-hdbt-visual-regression/pull/1453/html_report/

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.

2 participants