草庐IT

gulp-eslint

全部标签

javascript - eslint:错误解析错误:关键字 'const'被保留

我从ESLint收到此错误:errorParsingerror:Thekeyword'const'isreserved从此代码:constexpress=require('express');constapp=express();const_=require('underscore');我尝试删除node_modules并重新安装所有npm包(如建议的here),但无济于事。 最佳答案 ESLint默认使用ES5语法检查。您需要覆盖到最新的受良好支持的JavaScript版本。尝试将.eslintrc.json文件添加到您的项目中。

javascript - Gulps gulp.watch 不会为新文件或已删除文件触发?

在全局匹配中编辑文件时,以下Gulpjs任务可以正常工作://watchtask.gulp.task('watch',['build'],function(){gulp.watch(src+'/js/**/*.js',['scripts']);gulp.watch(src+'/img//**/*.{jpg,jpeg,png,gif}',['copy:images']);gulp.watch(src+'/less/*.less',['styles']);gulp.watch(src+'/templates/**/*.{swig,json}',['html']);});//buildtas

javascript - Gulps gulp.watch 不会为新文件或已删除文件触发?

在全局匹配中编辑文件时,以下Gulpjs任务可以正常工作://watchtask.gulp.task('watch',['build'],function(){gulp.watch(src+'/js/**/*.js',['scripts']);gulp.watch(src+'/img//**/*.{jpg,jpeg,png,gif}',['copy:images']);gulp.watch(src+'/less/*.less',['styles']);gulp.watch(src+'/templates/**/*.{swig,json}',['html']);});//buildtas

javascript - 如何在 Jest 中使用 ESLint

我正在尝试将ESLintlinter与Jest测试框架一起使用。Jest测试使用像jest这样的全局变量运行,我需要告诉linter;但棘手的是目录结构,使用Jest,测试嵌入在__tests__文件夹中的源代码中,因此目录结构类似于:srcfoofoo.js__tests__fooTest.jsbarbar.js__tests__barTest.js通常,我会将所有测试都放在一个目录下,我可以在其中添加一个.eslintrc文件来添加全局变量...但我当然不想添加.eslintrc文件到每个单独的__test__目录。目前,我刚刚将测试全局变量添加到全局.eslintrc文件中,但这

javascript - 如何在 Jest 中使用 ESLint

我正在尝试将ESLintlinter与Jest测试框架一起使用。Jest测试使用像jest这样的全局变量运行,我需要告诉linter;但棘手的是目录结构,使用Jest,测试嵌入在__tests__文件夹中的源代码中,因此目录结构类似于:srcfoofoo.js__tests__fooTest.jsbarbar.js__tests__barTest.js通常,我会将所有测试都放在一个目录下,我可以在其中添加一个.eslintrc文件来添加全局变量...但我当然不想添加.eslintrc文件到每个单独的__test__目录。目前,我刚刚将测试全局变量添加到全局.eslintrc文件中,但这

javascript - 安装 Gulp : “no command ' gulp' found” 后

安装后gulp.js通过npm,我在从安装目录运行gulp命令时收到nocommand'gulp'found错误。在node_modules/.bin/目录下查看时,我可以在其中看到gulp可执行文件。我的npm安装有问题吗? 最佳答案 这很正常。如果你想让gulp-cli在命令行中可用,你需要全局安装它。npminstall--globalgulp-cli见theinstallinstruction.另外,node_modules/.bin/不在您的$PATH中。但它是在运行npm脚本时由npm自动添加的(参见thisblogpo

javascript - 安装 Gulp : “no command ' gulp' found” 后

安装后gulp.js通过npm,我在从安装目录运行gulp命令时收到nocommand'gulp'found错误。在node_modules/.bin/目录下查看时,我可以在其中看到gulp可执行文件。我的npm安装有问题吗? 最佳答案 这很正常。如果你想让gulp-cli在命令行中可用,你需要全局安装它。npminstall--globalgulp-cli见theinstallinstruction.另外,node_modules/.bin/不在您的$PATH中。但它是在运行npm脚本时由npm自动添加的(参见thisblogpo

linux - 即使在安装 npm install -g gulp 后也找不到本地 gulp 安装

我尝试通过安装gulpnpminstall-ggulp输出似乎是这样的。(我跳过了一些日志)npmhttp304https://registry.npmjs.org/string_decodernpmhttp304https://registry.npmjs.org/lodash._htmlescapes/usr/bin/gulp->/usr/lib/node_modules/gulp/bin/gulp.jsgulp@3.6.2/usr/lib/node_modules/gulp├──tildify@0.2.0├──pretty-hrtime@0.2.1├──deprecated@0.

linux - 即使在安装 npm install -g gulp 后也找不到本地 gulp 安装

我尝试通过安装gulpnpminstall-ggulp输出似乎是这样的。(我跳过了一些日志)npmhttp304https://registry.npmjs.org/string_decodernpmhttp304https://registry.npmjs.org/lodash._htmlescapes/usr/bin/gulp->/usr/lib/node_modules/gulp/bin/gulp.jsgulp@3.6.2/usr/lib/node_modules/gulp├──tildify@0.2.0├──pretty-hrtime@0.2.1├──deprecated@0.

build - Gulp-Inject 不起作用

我有一个简单的Gulp构建过程设置用于测试。我已经多次阅读文档,但似乎无法让Gulp-inject将我想要的脚本注入(inject)index.html文件。我的Gulp文件如下所示:gulp.task('inject1',function(){returngulp.src('app/index.html').pipe(inject(gulp.src('./app/scripts/app.js',{read:false})))//Notnecessarytoreadthefiles(willspeedupthings),we'reonlyaftertheirpaths.pipe(gul