Skip to content

Comments

refactor(linter)!: overhaul config and options#5333

Closed
DonIsaac wants to merge 1 commit intodon/08-29-feat_linter_implement_serialize_for_oxlintconfig_from
don/08-29-refactor_linter_overhaul_config_and_options
Closed

refactor(linter)!: overhaul config and options#5333
DonIsaac wants to merge 1 commit intodon/08-29-feat_linter_implement_serialize_for_oxlintconfig_from
don/08-29-refactor_linter_overhaul_config_and_options

Conversation

@DonIsaac
Copy link
Contributor

@DonIsaac DonIsaac commented Aug 30, 2024

Apologies for how large this is, I couldn't split it up any further...

What This PR Does

Removes OxlintConfig and OxlintOptions in favor of LinterBuilder and Oxlintrc. Also adds support for plugins in config files. This should be the last preparation PR needed before I can finally tackle monorepo configs.

Tl;Dr

  • OxlintConfig has been replaced with Oxlintrc. This gets transformed by LinterBuilder into internal LinterConfig and LinterOptions objects, which the rules and LintContext consume.
  • Replaces OxlintOptions with LinterBuilder. Most fields in options are now in Oxlintrc. Those that aren't (e.g. --fix) are settable via builder methods.
  • Removes LintPluginOptions in favor of LintPlugins. This makes the API much more succinct.
  • Changes how CLI flags are merged with .oxlintrc.json files. The process is now:
    1. Read in the config file provided to the CLI to create a LinterBuilder. A default one is made when there's no file.
    2. Apply filters/plugins/etc set via CLI args on top of what's initially set from the config file.

@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 30, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

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

@DonIsaac DonIsaac marked this pull request as ready for review August 30, 2024 03:08
@DonIsaac DonIsaac force-pushed the don/08-29-refactor_linter_overhaul_config_and_options branch from cf32d0a to dc45cdb Compare August 30, 2024 03:20
@DonIsaac DonIsaac changed the title refactor(linter): overhaul config and options refactor(linter)!: overhaul config and options Aug 30, 2024
@DonIsaac DonIsaac linked an issue Aug 30, 2024 that may be closed by this pull request
@DonIsaac DonIsaac marked this pull request as draft August 30, 2024 03:23
@codspeed-hq
Copy link

codspeed-hq bot commented Aug 30, 2024

CodSpeed Performance Report

Merging #5333 will not alter performance

Comparing don/08-29-refactor_linter_overhaul_config_and_options (dc45cdb) with don/08-29-feat_linter_implement_serialize_for_oxlintconfig_ (3909377)

Summary

✅ 29 untouched benchmarks

@DonIsaac DonIsaac closed this Oct 7, 2024
@Boshen Boshen deleted the don/08-29-refactor_linter_overhaul_config_and_options branch December 13, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(linter): Support plugins array in config

1 participant