oxc icon indicating copy to clipboard operation
oxc copied to clipboard

feat(linter): generate schemas for rules (with documentation)

Open DonIsaac opened this issue 1 year ago • 7 comments

Re-creation of #4151.

@Boshen I'm not sure what we want to do about configuration_schema.json, should we add a prepublish task to create it within oxlint?

DonIsaac avatar Jul 10 '24 21:07 DonIsaac

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.

graphite-app[bot] avatar Jul 10 '24 21:07 graphite-app[bot]

CodSpeed Performance Report

Merging #4174 will not alter performance

Comparing don/linter/feat/rule-schemas (c1fc18c) with main (3d40528)

Summary

✅ 29 untouched benchmarks

codspeed-hq[bot] avatar Jul 10 '24 21:07 codspeed-hq[bot]

I'm not sure what we want to do about configuration_schema.json, should we add a prepublish task to create it within oxlint?

I'll take a look at this today.

Boshen avatar Jul 11 '24 01:07 Boshen

Do you think it's reasonable to only generate the minimum?

        "comma-dangle": {
          "$ref": "#/definitions/rule",
          "description": "Require or disallow trailing commas"
        },

https://github.com/SchemaStore/schemastore/blob/314c1867bd5db7d139804fa40b18d454132921af/src/schemas/json/eslintrc.json#L39-L42

Boshen avatar Jul 11 '24 02:07 Boshen

Do you think it's reasonable to only generate the minimum?


        "comma-dangle": {

          "$ref": "#/definitions/rule",

          "description": "Require or disallow trailing commas"

        },

https://github.com/SchemaStore/schemastore/blob/314c1867bd5db7d139804fa40b18d454132921af/src/schemas/json/eslintrc.json#L39-L42

Unfortunately, I'm not sure how to get that... rules only have documentation, not a summary.

DonIsaac avatar Jul 19 '24 13:07 DonIsaac

@Boshen what would you like to do with this PR?

DonIsaac avatar Aug 07 '24 05:08 DonIsaac

I'll allocate some time later this week to go over all the bigger linter changes.

Boshen avatar Aug 07 '24 05:08 Boshen

Shall we try and clean up the schema incrementally? It's difficult to review and merge this PR.

Boshen avatar Aug 12 '24 05:08 Boshen