Code Monkey home page Code Monkey logo

Comments (5)

ta2edchimp avatar ta2edchimp commented on September 28, 2024 2

Uh, that's a nice idea 👍

The rules' meta property exposes all the required information about the schema of a rule:

eslint.linter.getRules().get('indent').meta.schema

from eslint-find-rules.

preco21 avatar preco21 commented on September 28, 2024

Hi, I'm now analyzing the code for this feature, but I just stuck because I have no idea what is the proper way to display such unused options as an output. For example, you have only specified the first argument (off, error, ...) in a rule which can accept bunch of additional and also nested options.

In this case, what would be the best to show on the output? I guess only first level of the options would be sufficient for everyone:

NOTE: The user may need to provide a value to rest of the options to clear the output.

unused options (only first level of full options shown)

indent: [0] -> 'tab' | number, [1] -> {SwitchCase, FooBar, ...} // ['error', 'tab', {SwitchCase, ...}]
padding-line-between-statements: [] -> {blankLine, prev, next} // ['error', {blankLine,prev,next}, ...]

from eslint-find-rules.

ljharb avatar ljharb commented on September 28, 2024

Just the names of the options and the rule, and the link to the rule docs, would be sufficient for me.

from eslint-find-rules.

preco21 avatar preco21 commented on September 28, 2024

Is there an example of what “names of the options and the rule” would look like?

For example: https://eslint.org/docs/rules/indent

In a rule like “indent”, it may not only accept an object as a options, but also accept primitive values like “tab” or 8 along with other options. What would be the best way to deal with this case? Since a primitive value cannot describe its name unlike a key of an object, I guess showing its value type would be okay.

And there may be nested options where some object can contain another object, what would be the output in this case?

from eslint-find-rules.

ljharb avatar ljharb commented on September 28, 2024

I’d be interested in the kinds of options unset, but not their potential values unless it’s an enum or a boolean. In the case of indent, the object option keys is what I’m most interested in.

from eslint-find-rules.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.