Search code examples
webstormyeoman-generator

Yeoman generator code highlight for webstorm


I am creating yeoman generator and i came accross problem with code inspection in webstorm. Here is my code:

module.exports = function(grunt) {
  grunt.initConfig({
      // Process main less file to css file in build folder
      less: {
      <% if (includeBootstrap) { %>

i get syntax error near <% and the whole file highlighting is ruined. How to make it ok. I suppose i should use ESJ highlighting but I can't set it.


Solution

  • Please try the following:

    • in Settings | Editor | File Types, add 'Gruntfile.js' (or whatever your file is named) to 'EJS' registered patterns (actual name for EJS file type there is 'EJS combines data...')
    • click on the added pattern, press Edit, in Template data language dropdown choose 'JavaScript'