Skip to content

Conversation

@BridgeAR
Copy link
Member

This adds the quote-props rule and uses the consistent style. I personally would like to change that to consistent-as-needed but this would create quite some churn and therefore using consistent right now is probably best.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

benchmark,test,tools

@nodejs-github-botnodejs-github-bot added the tools Issues and PRs related to the tools directory. label Jul 3, 2017
@tniessen
Copy link
Member

@BridgeARBridgeAR changed the title eslint: add quote propstools: add quote-props eslint rule Jul 3, 2017
tniessen
tniessen previously approved these changes Jul 3, 2017
@tniessentniessen self-assigned this Jul 3, 2017
@refack
Copy link
Contributor

refack commented Jul 3, 2017

I personally would like to change that to consistent-as-needed but this would create quite some churn and therefore using consistent right now is probably best.

Personally I'd rather have as-needed if we're going to churn (392 problems in 71 files)
(for reference consistent-as-needed has 317 problems in 55 files)

@refack
Copy link
Contributor

I think I'm -1 on this.
I'm not blocking but would like a discussion. Is consistently better than "parsimony"?

@tniessen
Copy link
Member

I think this is a design decision, do we prefer consistent style or do we want to leave out all quotation marks that are not strictly required?

@tniessentniessen dismissed their stale reviewJuly 3, 2017 16:54

Ongoing design decision - do not land!

@fhinkelfhinkel added the discuss Issues opened for discussions and feedbacks. label Jul 3, 2017
@lpinca
Copy link
Member

-0, I prefer to not use quotes unless it is really needed.

@BridgeAR
Copy link
MemberAuthor

I don't mind using as-needed. I think that most people prefer not to use quotes, that's the main point about this PR.
Using consistent is meant as a small step towards that since most objects don't need quotes at all. I tried not to churn to much and now things could be changed over time or is churning justified and I should just change this to either consistent-as-needed or to as-needed?

@refack
Copy link
Contributor

refack commented Jul 4, 2017

I don't mind using as-needed. I think that most people prefer not to use quotes, that's the main point about this PR.
Using consistent is meant as a small step towards that since most objects don't need quotes at all. I tried not to churn to much and now things could be changed over time or is churning justified and I should just change this to either consistent-as-needed or to as-needed?

I think we have precedence for churning in order to activate an eslint rule ( @vsemozhetbyt is the king of those 👑 #12563, #13835, etc. )

IMHO as-needed is best, but up for a quick vote:

  • ❤️ — do nothing
  • 👍 — consistent (current state of PR)
  • 😄 — as-needed
  • 🎉 — consistent-as-needed

/cc @nodejs/collaborators

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented Jul 4, 2017

I am really not sure what to prefer. I like clear minimization (as-needed), but I recall a discussion about object shorthand: some collaborators said they considered this confusing:

constfoo='foo';constobj={ foo,bar: 'abc'}

vs

constobj={foo: foo,bar: 'abc'}

as a mind tunes in for on style and then stumbles over a different one and that hampers reading. For me, the first example is OK, but I would not want to torture those who see this differently, i.e. who possibly prefer consistent-as-needed)

@refack
Copy link
Contributor

For me, the first example is OK, but I would not want to torture those who see this differently)

Since quote-props only check prop names, I think the better example would be:

constfoo='foo';constobj={'foo': foo,bar: 'abc'}

@vsemozhetbyt
Copy link
Contributor

Yes, I meant we already had a discussion on a similar style issue)

@BridgeAR
Copy link
MemberAuthor

Can we get some further opinions here?

@evanlucas
Copy link
Contributor

IMO, we should only quote properties that must be quoted. Rule changes tend to make cherry-picking for releases more difficult...

@mcollina
Copy link
Member

I think this just creates churn for no particular benefit: -1. It also complicates cherry-picking.

@cjihrig
Copy link
Contributor

Also -1 for the reasons listed.

@gibfahn
Copy link
Member

I'd prefer as-needed, but I'm not sure there's enough benefit here for it to be worthwhile.

Copy link
Member

@benjamingrbenjamingr left a comment

Choose a reason for hiding this comment

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

I'm also -1 for both the reasons stated above (churn) and stylistic preference. I'm making my -1 explicit - I'm fine with "as needed" as a config or not changing the config.

@refack
Copy link
Contributor

@mcollina@cjihrig Just to be clear would you be Ok with as-needed (and fixing 392 problems in 71 files)?

@jasnell
Copy link
Member

I'm -1 on this too. I much prefer omitting the prop name quotes when possible to do so.

@refack
Copy link
Contributor

refack commented Jul 10, 2017

@mcollina@cjihrig Just to be clear would you be Ok with as-needed (and fixing 392 problems in 71 files)?

Also we could set quote-props: [warning, as-needed] for a transition period

@mcollina
Copy link
Member

I'm -1 as as-needed and as well.

@refack
Copy link
Contributor

Closing for lack of consensus

@refackrefack closed this Jul 10, 2017
@BridgeARBridgeAR added the invalid Issues and PRs that are invalid. label Sep 14, 2017
@BridgeARBridgeAR deleted the add-quote-props branch April 1, 2019 23:36
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discussIssues opened for discussions and feedbacks.invalidIssues and PRs that are invalid.toolsIssues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

13 participants

@BridgeAR@tniessen@refack@lpinca@vsemozhetbyt@evanlucas@mcollina@cjihrig@gibfahn@jasnell@benjamingr@fhinkel@nodejs-github-bot