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

Various improvements to rule option lists #491

Open
bmish opened this issue Oct 15, 2023 · 4 comments
Open

Various improvements to rule option lists #491

bmish opened this issue Oct 15, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@bmish
Copy link
Owner

bmish commented Oct 15, 2023

E.g.

  • Support more fields from JSONSchema
  • Handle different kinds/nesting of JSONSchemas besides just plain objects
  • Can we accommodate other sources of rule options defaults as discussed in feat: Support for meta.defaultOptions on rules eslint/rfcs#113?
  • Show a useful value if someone uses a default like Number.MAX_VALUE instead of 1.7976931348623157e+308
  • Extract this logic into a separate library

Improvements so far:

Follow-up to:

@bmish bmish added the enhancement New feature or request label Oct 15, 2023
@TheSonOfThomp
Copy link

Unless I'm missing something, options defined as type: "string" will also not show up in the docs automatically

@bmish
Copy link
Owner Author

bmish commented Oct 27, 2023

@TheSonOfThomp I assume you mean a rule like quotes that is configured with a string value instead of an object: quotes: ["error", "double"]. Yes, we haven't supported that type of rule config yet.

@TheSonOfThomp
Copy link

Exactly, yeah. Something defined in the schema as:

schema: [{
  type: "string",
  description: "..."
}]

I'm able to use an object property for now (which may be a better api for my case)

@bmish
Copy link
Owner Author

bmish commented Oct 27, 2023

An object API for rules is almost always a better choice as it allows you to add additional options later (much more future-proof). However, it would still be good for us to support the basic string scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants