-
Notifications
You must be signed in to change notification settings - Fork 396
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
Javascript files being checked by phpcs #2861
Comments
PHPCS does also sniff/lint JS, so passing those files through PHPCS isn't a problem. There is another issue open where it's been noted that the linting isn't respecting the .eslintrc rules coming form core (#2845). Sounds like maybe that's the root of the issue you're seeing? If you really want to disable js files checking, you could add the js extension to phpcs.xml as described in the docs for Extending BLT |
I have dug into this further and found what I think is the problem, which relates to consistency between doing a So generally with phpcs and Drupal we use 1 or both of the rulesets Drupal or DrupalPractice which have a list of extensions associated with each ruleset. For Drupal it uses the extensions so when just calling This is all well and good, but maybe blt should default to adding javascript as an extension to check so there is consistency between checking all files and checking particular files (like what the git hooks are doing). This will mean you will get the same results from The secondary problem is that when using yarn to convert .es6.js to .js files, the resultant .js file doesn't pass the phpcs checks and in reality you do not wait phpcs to check these generated files. https://www.drupal.org/project/drupal/issues/2975201 resolves this issue by adding |
Sounds like a dupe of #3448 |
My system information:
With the blt git hooks enable, blt is running phpcs over javascript files which:-
Part of the problem is that blt is passing a list of all files which are being committed, so this can include javascript files and other which are not php.
initially I had problems with this and a generated javascript file which came from a es6.js. I got around this problem by fixing the configuration for building the code in core https://www.drupal.org/project/drupal/issues/2975201 but it is not really a core issue.
The text was updated successfully, but these errors were encountered: