Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#40828 closed feature request (wontfix)

JavaScript Standard Style

Reported by: jhabdas's profile jhabdas Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.8
Component: Build/Test Tools Keywords: close
Focuses: javascript Cc:

Description

https://standardjs.com/

ESLint adds a lot of complexity and causes an incredible amount of churn in projects managing JavaScript. Moving towards a Standard JS ESLint configuration will help you port away from bike shedding and enjoy the simple life many of us try to do.

Change History (6)

#1 @jdgrimes
7 years ago

Standard is probably great for many JS projects, but I'm not sure that it is right for WordPress. WordPress is not a single-language project, it uses PHP in addition to JS. We try to keep many of the code style rules fairly similar across languages to simplify things. Standard uses some rules that are very different from our long-established PHP standards, and as such it would create a disunity of code styles throughout the project (since I don't see any chance of changing our PHP styles to match).

I think that the bike shed has been painted, and we'll probably want to keep it the same color that it already is for now.

#2 @jdgrimes
7 years ago

  • Focuses javascript added

#3 @azaozz
7 years ago

  • Keywords close added

Agree with @jdgrimes. The WordPress coding standards are fairly well established and have been around for quite some time, about three times longer than Standardjs :)

There is no compelling reason to change them, and making the JS standards different from the PHP standards (where they overlap) is unthinkable. Another reason is that the most important function of coding standards, especially for a big open source project, is readability. The WordPress standards were created with that in mind. Changing some of these rules wouldn't be good.

#4 @netweb
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

#5 @jhabdas
7 years ago

If anyone is interested in a constructive debate, I'm willing to put in some research and justification I feel may help adjust your opinions. Status quo as a rationale falls flat as an argument, and though there's something to be said of consistency within a codebase we are talking about two different programming languages with two converging movements towards procedural programming.

To quote Rob Pike, father of Go, “Object-oriented design is the roman numerals of computing.”

#6 @adamsilverstein
7 years ago

@jhabdas - Thanks for your feedback and effort to contribute to the WordPress coding standards.

I tend to agree that the WordPress JavaScript coding standards are well established, were carefully decided and work well for the project. They are of course open to evolving and we have discussed them as recently as our last JavaScript chat. Please also note the WordPress ESLint config.

Note: See TracTickets for help on using tickets.