Closed (won't fix)
Project:
Coder
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 May 2012 at 15:38 UTC
Updated:
25 Jun 2016 at 14:34 UTC
Jump to comment: Most recent
I have two min.js files within my theme and have multiple of the following errors reported.
3 | ERROR | Inline control structures are not allowed
3 | ERROR | Expected 1 space after first semicolon of FOR loop; 0 found
Comments
Comment #1
klausiCurrently drupalcs cannot detect minified javascript files, so you can just ignore those errors.
We should investigate if we can hook into phpcs somehow to prevent minified javascript files from being checked. A javascript file that contains only one line can be considered minified.
Comment #2
klausiAnother possibility would be to introduce a naming convention for minified JS files. We could define that minified JS file names have to follow the pattern *.min.js. Then it would be very easy to add an exclusion pattern to ruleset.xml so that those files are ignored.
I could not find any documentation resources on JS minification, at least not in the javascript coding standards http://drupal.org/node/172169 . Do we have anything on that?
Comment #3
fluxsauce commentedI haven't seen anything relating to standards on minified JS files; I don't think there is a strict standard. Anecdotally, the generally accepted standard is
*.min.js.For whatever it's worth, in D7 and D8 core, the minified files are named with *.min.js:
Comment #4
klausiDrupal Code Sniffer has been merged into Coder 7.x-2.x. Please move this issue to the Coder queue and reopen it if the problem still exists.
Comment #5
xiukun.zhou commentedThe problem still persists http://ventral.org/pareview/httpgitdrupalorgprojectnicemenusgit-7x-2x
see: jquery.bgiframe.min.js
Comment #6
xiukun.zhou commentedAs per #4, moving issue to coder-7.x-2.x project queue.
I am still having this issue, please take a look at #5.
Any help would be greatly appreciated.
Thanks in advance.
Comment #7
klausiJavascript support has been removed from Coder. To check and fix Javascript files please use ESLint and see the Drupal ESLint documentation.