在windows中,我使用fountain.js生成了webpack + angular.js应用程序,并在webpack配置文件eslint
中用作javascript文件的预加载器:
preLoaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint'
}
],
但是我遇到了一些错误,如以下控制台日志所示:
$ gulp
[13:21:38] Starting 'default'...
[13:21:38] Starting 'clean'...
[13:21:39] Finished 'clean' after 11 ms
[13:21:39] Starting 'build'...
[13:21:39] Starting 'partials'...
[13:21:39] Finished 'partials' after 38 ms
[13:21:39] Starting 'other'...
[13:21:39] Starting 'webpack:dist'...
[13:21:39] Finished 'other' after 96 ms
[13:21:45] Time: 6661ms
Asset Size Chunks Chunk Names
vendor-aefef07e2fb51ce95272.js 170 kB 0 vendor
main-aefef07e2fb51ce95272.js 167 bytes 1 main
ERROR in ./src/scripts/app.js
M:\Learning Angular.js\Ultimate AngularJS Build a Real-World App from Scratch\fj
s_ngClassfieds_app\src\scripts\app.js
1:31 error Trailing spaces not allowed no-trailing-spac
es
1:32 error Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style
2:2 error Newline required at end of file but not found eol-last
2:7 error 'ngModule' is defined but never used no-unused-vars
2:54 error Trailing spaces not allowed no-trailing-spac
es
? 5 problems (5 errors, 0 warnings)
Child html-webpack-plugin for "index.html":
Asset Size Chunks Chunk Names
index.html 547 kB 0
[13:21:45] Finished 'webpack:dist' after 6.73 s
[13:21:45] Finished 'build' after 6.77 s
[13:21:45] Finished 'default' after 6.79 s
并且当这些错误发生时,gulp / webpack任务系列会失败,并且不会按预期生成任何文件。当我评论eslint webpack预加载器的行时,我没有遇到任何问题,并且生成了应用程序并且它被提供了。
我已尝试按here中的说明添加\r\n
,但我仍然遇到这些错误,并且没有与webpack关联的.eslintrc文件,以便在其中设置任何特定参数以避免此问题发生。