Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Autogenerate many rule options list with eslint-doc-generator#2917

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
bmish wants to merge1 commit intoimport-js:main
base:main
Choose a base branch
Loading
frombmish:edg-options-lists

Conversation

bmish
Copy link
Contributor

@bmishbmish commentedNov 4, 2023
edited
Loading

I'm trying out this new feature I implemented that generates the lists of rule options from the rule schemas. More info:

This requires quite a bit of cleanup including:

  • Moving option info into the schema as much as possible
  • Reorganizing rule docs so that the options list can fit nicely

I noticed that many rules do not even mention their options in their docs today, or do so incompletely.

Since there are so many rules with options, I haven't quite fully filled out and perfected all the schemas/docs yet, but it's a start.

Note that I avoided adding the auto-generated lists to rules with complex option formats which aren't all supported yet by eslint-doc-generator.

@bmishbmish marked this pull request as draftNovember 4, 2023 22:24
Copy link
Member

@ljharbljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks like a great start :-)

bmish reacted with hooray emoji
Comment on lines +18 to +19
| `importFunctions` | String[] |
| `webpackChunknameFormat` | String |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

string should be lowercase, i think

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do you know of any related example / precedent for displaying variable/data types one way or the other, or have any other reasoning behind your preference? I'm open to considering a change.

The current reasoning is that arbitrary, user-defined values like the name of an option are displayed in backticks, whereas values from a fixed set like variable types are simply capitalized.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Here's a comprehensive example that shows how we format different kinds of values:https://github.com/bmish/eslint-doc-generator/blob/main/docs/examples/eslint-plugin-test/docs/rules/no-foo.md#options

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

String means an object - the constructor - andstring means a primitive. It's whattypeof produces for primitives as well.

TypeScript follows this convention as well.

Comment on lines +17 to +18
| `ignoreTypeImports` | Boolean | `false` |
| `max` | Number | `10` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

same with all the primitive types

@ljharbljharb added the docs labelNov 12, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ljharbljharbljharb left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@bmish@ljharb

[8]ページ先頭

©2009-2025 Movatter.jp