简体   繁体   中英

Stop Webstorm of Displaying Error on hbs! Plugin for require.js

There are two files in my project:

  • index.js where the following code is

    define([ 'exports', 'hbs!./general'], function (exports, generalTemplate) { });

  • general.handlebars which is correctly taken by require.js and the hbs! plug-in.

I'm basically using Require.js with Handlebars.js and the https://github.com/SlexAxton/require-handlebars-plugin for automating the creation of templates from files.

It works correctly, but Webstorm 8 (and also 7 before it) doesn't understand the file is correct so it always complains with: Cannot resolve file 'general' . It is the same with every file using that plugin prefix.

I coudln't find where (if it exists) to turn that notification off, because it underlines the entire file, and its parent directories as having errors.

How can I remove this error of being reported?

This notification can't be turned off unfortunately - annotator-level inspections can't be suppressed. The issue with relative paths resolving when loading plugins for non-js extensions is tracked as WEB-1167 , please vote

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM