Skip to content

Comments

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

Closed
ityuany wants to merge 6 commits intooxc-project:mainfrom
sheinsight:pretty-log
Closed

feat(linter): support allowable method diagnostic for eslint/no-console#9350
ityuany wants to merge 6 commits intooxc-project:mainfrom
sheinsight:pretty-log

Conversation

@ityuany
Copy link
Contributor

@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.

@graphite-app
Copy link
Contributor

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
@codspeed-hq
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