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
Add third, no-op option accepted in places where only "always" and "never" are accepted #10906
Comments
See eslint#10906 Where "always" enforces space and "never" enforces no-space, "off" does not enforce any space preference. It may be useful to add a similar "off" option to other enums only allowing "always" and "never", too, but that is outside the scope of this PR. TODO: Why do two tests fail? (what the heck???) TODO: The documentation will need to describe this addition in more detail.
See eslint#10906 Where "always" enforces space and "never" enforces no-space, "off" does not enforce any space preference. It may be useful to add a similar "off" option to other enums only allowing "always" and "never", too, but that is outside the scope of this PR. TODO: Why do two tests fail? (what the heck???) TODO: The documentation will need to describe this addition in more detail.
See eslint#10906 Where "always" enforces space and "never" enforces no-space, "off" does not enforce any space preference. It may be useful to add a similar "off" option to other enums only allowing "always" and "never", too, but that is outside the scope of this PR. TODO: Why do two tests fail? (what the heck???) TODO: The documentation will need to describe this addition in more detail.
Thanks for the issue. It sounds like you are proposing a change to |
@nzakas I did not feel that the template was a good fit because I am proposing a change that might affect any rules which currently accept only "always" and "never" values, though the rule where not having any third no-op option is affecting me right now is in fact |
Thanks for explaining. We typically do not accept changes that span
multiple rules at once because it requires a lot of coordination and
research. As it is, this request isn’t specific enough for us to consider.
If you are willing to do the research to determine which rules would fall
under your proposal and how a change would affect each rule’s behavior,
then we can certainly consider it.
Otherwise, you are welcome to suggest a change to just one rule for us to
consider.
…On Tue, Oct 2, 2018 at 12:53 AM Sophie Kirschner ***@***.***> wrote:
@nzakas <https://github.com/nzakas> I did not feel that the template was
a good fit because I am proposing a change that might affect any rules
which currently accept only "always" and "never" values, though the rule
where not having any third no-op option is affecting me right now is in
fact space-before-blocks. Unfortunately, I do not have a thorough enough
knowledge of eslint and its rules to enumerate all of the rules that would
benefit from such a change.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10906 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACWkiSUpg0DS-YaOW55LHgCMklaIHYWks5ugxtpgaJpZM4XB_Kt>
.
|
Ok, I understand. Note that I do currently have a PR open for adding this functionality to |
* Update: "off" options for "space-before-blocks" (refs #10906) See #10906 Where "always" enforces space and "never" enforces no-space, "off" does not enforce any space preference. It may be useful to add a similar "off" option to other enums only allowing "always" and "never", too, but that is outside the scope of this PR.
Unfortunately, it looks like there wasn't enough interest from the team Thanks for contributing to ESLint and we appreciate your understanding. |
I believe that there would be value in adding a third, "off" or similar option to places that currently accept only "always" and "never". Where "always" requires that a condition always be met, and "never" requires that it never be met, "off" (or a similar setting) would ignore that condition and not enforce the condition either way.
The
space-before-blocks
rule is what prompts me to post this. I and another dev have been discussing code style and enforcing this with eslint, and while we both agree that there should be spaces before function and class blocks we feel less decisive regarding spaces between other blocks, such asif
andfor
code blocks. At least for the time being, we want to use the formatter to enforce space before function and class blocks only. We do not want eslint to produce warnings for either style (space or no-space) for other blocks.I expected to be able to write this:
Which did not work as I hoped.
I also tried omitting the "keywords" property, but in this case eslint behaves as though I wrote "always".
This is an example of the behavior I would expect given the aforementioned
space-before-blocks
rule.The text was updated successfully, but these errors were encountered: