Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(linter): support allowable method diagnostic for eslint/no-console #9350

Closed
wants to merge 6 commits into from

Conversation

ityuany
Copy link

@ityuany ityuany commented Feb 25, 2025

  • Modified no_console_diagnostic function to add a list of allowed methods argument
  • Include the list of allowed console methods in the prompt message.
  • Updated diagnostic calls to support passing information about allowed methods.

Copy link

graphite-app bot commented Feb 25, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added A-linter Area - Linter C-enhancement Category - New feature or request labels Feb 25, 2025
Copy link

codspeed-hq bot commented Feb 25, 2025

CodSpeed Performance Report

Merging #9350 will not alter performance

Comparing sheinsight:pretty-log (20c4d62) with main (e51d563)

Summary

✅ 33 untouched benchmarks

@shulaoda shulaoda changed the title feat(eslint): improve the no-console rule to support allowable method… feat(linter): support allowable method diagnostic for eslint/no-console Feb 25, 2025
… configuration

- Modified `no_console_diagnostic` function to add a list of allowed methods argument
- Include the list of allowed console methods in the prompt message.
- Updated diagnostic calls to support passing information about allowed methods.
…rules

Refactored warning message construction logic in no_console rules to optimize message formatting when the allow list is empty.
- Replacing `Vec` references with slices to improve performance
- Replace `to_string` with `String::new` to optimize empty string creation.
- Apply formatted strings to improve readability
- Modify the string concatenation logic in the `no_console.rs` file to uniformly use the `join(",")` method.

- Update the corresponding snapshot tests to reflect these changes, ensuring no extra spaces are included.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants