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

Add support for JavaScript coding standards #23

Open
stevegrunwell opened this issue Dec 9, 2015 · 4 comments
Open

Add support for JavaScript coding standards #23

stevegrunwell opened this issue Dec 9, 2015 · 4 comments

Comments

@stevegrunwell
Copy link
Owner

WordPress has an official .jshintrc file and PHP_CodeSniffer can be configured to run it automatically, we just need to put those pieces together so JavaScript can automatically be linted/hinted/otherwise checked.

@dana-ross
Copy link
Contributor

One of my projects uses JSCS. It would be great to be able to choose JSHint or JSCS.

@ghost
Copy link

ghost commented May 20, 2017

One of my projects uses JSCS. It would be great to be able to choose JSHint or JSCS.

No one should be using JSCS or JSHint these days. Those tools are dead, and have been replaced by ESLint and JavaScript Standard Style.

The Linux philosophy is that a tool should be good at one thing and one thing only. Adding JS linting to enforcer will only conflate the usefulness of other existing tools which already do this handily.

@stevegrunwell
Copy link
Owner Author

No one should be using JSCS or JSHint these days. Those tools are dead, and have been replaced by ESLint and JavaScript Standard Style.

While it's great to be able to use ESLint or JavaScript Standard Style on new builds, that's not always an option (especially with existing projects and/or in agencies). This is compounded by the fact that WordPress has its own JavaScript coding standards and, as WP Enforcer is meant to be a tool to aid in writing to the WordPress coding standards, the checks that it uses must adhere to what's set forth by the WordPress project.

@JHabdas raises a good point about the conflation of responsibilities, but I'd counter with the thought that WP Enforcer's goal is to automatically install git hooks to prevent non-standards-compliant code from being committed to a WordPress project; PHP was a logical starting point, but both JavaScript and HTML feel very much in the scope of this project.

@ghost
Copy link

ghost commented May 28, 2017

Thankfully WordPress has core issues out to move to ESlint. They wouldn't bite on JavaScript Stamdard when I proposed it on Trac, citing technical debt and a desire to make JS look like their PHP as the rationale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants