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

fix(linter): fix plugin name parsing when reading config file #1972

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

haocheng6
Copy link
Contributor

@haocheng6 haocheng6 commented Jan 9, 2024

This PR fixes the plugin parsing logic when reading a config file.

Specifically, the plugin names defined in RuleEnums use snake-case ("jsx_a11y") while in the config file they are written as "jsx-a11y". This inconsistency causes some rules to be filtered out.

I tested the change with the config json file provided in #1969.

  • Before the change: Finished in 21ms on 1 file with 157 rules using 8 threads.
  • After the change: Finished in 23ms on 1 file with 178 rules using 8 threads.

Related issue: #1969

@github-actions github-actions bot added the A-linter Area - Linter label Jan 9, 2024
Copy link

codspeed-hq bot commented Jan 10, 2024

CodSpeed Performance Report

Merging #1972 will degrade performances by 6.36%

Comparing haocheng6:1969-fix-plugin-name-parsing (ef1e4bf) with main (7891670)

Summary

❌ 1 (👁 1) regressions
✅ 13 untouched benchmarks

Benchmarks breakdown

Benchmark main haocheng6:1969-fix-plugin-name-parsing Change
👁 semantic[pdf.mjs] 113.2 ms 120.8 ms -6.36%

@Boshen Boshen merged commit b5f4f1e into oxc-project:main Jan 10, 2024
16 checks passed
@Boshen
Copy link
Member

Boshen commented Jan 10, 2024

Thank you!

@haocheng6 haocheng6 deleted the 1969-fix-plugin-name-parsing branch January 11, 2024 23:13
IWANABETHATGUY pushed a commit to IWANABETHATGUY/oxc that referenced this pull request May 29, 2024
…oject#1972)

This PR fixes the plugin parsing logic when reading a config file.

Specifically, the plugin names defined in `RuleEnum`s use snake-case
("jsx_a11y") while in the config file they are written as "jsx-a11y".
This inconsistency causes some rules to be filtered out.

I tested the change with the config json file provided in oxc-project#1969.
- Before the change: `Finished in 21ms on 1 file with 157 rules using 8
threads.`
- After the change: `Finished in 23ms on 1 file with 178 rules using 8
threads.`

Related issue: oxc-project#1969
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants