-
Notifications
You must be signed in to change notification settings - Fork 2
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 linting #2
Comments
Upon further research, it appears PHP_CodeSniffer uses CSSLint for CSS Linting and JSHint for JavaScript which are both Node modules and we want to avoid having to install Node on websites. Both of those modules support Mozilla Rhino which PHP_CodeSniffer also supports (For JSHint, I'm not 100% sure if you can use CSSLint through PHP_CodeSniffer using Rhino) but then that involves installing Java as well as Rhino which I'm not really a fan of. We could possibly have JSHint, CSSLint, and Rhino downloaded as dependencies (probably in I'm not sure, just writing my thoughts down to reference later. |
Another option would be to simply require Node be installed on your machine as well as the CSSLint and JSHint packages be installed globally in order to take advantage of CSS and JavaScript linting and just use PHP_CodeSniffer for PHP. So these would be optional features. But if we go that route, maybe it would be worth using eslint again. |
Something else worth noting, CSSLint doesn't support SCSS so that's not going to work. We would probably have to use something like stylelint which I think would also require stylelint-scss. |
In our original boilerplate we used the eslint Node module for code linting however, it was only for JavaScript. Then we switched all of our compiling tools to PHP and no longer had any sort of linting. My first plan was to implement linting in our Front End Compiler tool but then I decided it was best if that was kept separate.
So here we are. I'd like to implement linting in this boilerplate and the PHP_CodeSniffer tool seems like it's exactly what we want. It provides linting for PHP, JavaScript, and CSS which is awesome. So I'm just adding this to the to-do list.
The text was updated successfully, but these errors were encountered: