草庐IT

gulp-eslint

全部标签

javascript - 错误 : Cannot find module 'wrench' , 当我运行 gulp 命令时出现此错误

我已经在本地和全局安装了npm、bower和gulp。当我在该文件夹中运行gulp时,仍然出现此错误。Error:Cannotfindmodule'wrench'atFunction.Module._resolveFilename(module.js:325:15)atFunction.Module._load(module.js:276:25)atModule.require(module.js:353:17)atrequire(internal/module.js:12:17)atObject.(/home/myPC/documents/workspace/frontend/gul

javascript - 如何在 gulp 任务中仅排除 .min.js 文件,同时保持在同一目录中?

虽然我遇到了一个问题,它一遍又一遍地循环处理文件,但我正在尝试为我的前端工作设置一个构建系统。这是我的js处理的问题,因为我不确定如何仅排除以.min作为后缀的文件。任务如下returngulp.src(["!dev/js/*.min.js","dev/js/*.js"]).pipe(plumber()).pipe(browserify()).pipe(smaps.init()).pipe(uglyify({preserveComments:"license"})).pipe(smaps.write()).pipe(rename({suffix:".min"})).pipe(gulp.

javascript - gulp main-bower-files 正则表达式过滤器不起作用

为什么第二个数组bowerFiles没有过滤成仅javascript文件。vargulp=require('gulp');varmainBowerFiles=require('main-bower-files');gulp.task('default',function(){varunfiltered=mainBowerFiles();console.log('unfilteredfiles:',unfiltered);//11FILES//varjsRegEx=/js$/i;//triedthiswaytoo...varjsRegEx=newRegExp('js$','i');var

javascript - 如何使用具有多个入口点的 Webpack 和 Gulp 来转换应用程序和测试目录?

我正在构建一个基本的博客项目来练习使用React、ES6和Mocha测试框架。在我的defaultGulp任务中转换我的ES6测试和应用程序代码时遇到问题。当我运行default任务并将./test/posts.js的内容更改为watch时出现此错误生效:[11:17:29]Usinggulpfile~/WebstormProjects/blog/gulpfile.js[11:17:29]Starting'default'...[11:17:29]Finished'default'after8.54msstream.js:75thrower;//Unhandledstreamerror

javascript - Eslint - 脚本和模块的 SourceType 混合体

我们开始混入一些es6模块,当您在不使用sourceType:脚本的情况下使用import/export时,eslint会公正地提示Parsingerror:'import'and'export'mayappearonlywith'sourceType:module'atline1col1但是,如果我将sourceType更改为模块,那么每个具有“usestrict”的文件;在顶部被标记为模块中不需要usestrict。模块是我的jsx文件,我的js文件是POJ,所以我需要两个sourceTypes才能运行。关于如何强制eslint与模块和脚本一起工作有什么想法吗?我想避免运行两个单独

javascript - 部署到 heroku(gulp 未找到错误)

我已经克隆了meanjs存储库并部署到heroku,但应用程序无法运行并显示以下错误:应用程序错误应用程序发生错误,无法提供您的页面。如果您是应用程序所有者,请查看您的日志以了解详细信息。检查日志,它说:17-04-18T03:16:50.720375+00:00app[web.1]:2017-04-18T03:16:50.730925+00:00app[web.1]:sh:1:gulp:notfound2017-04-18T03:16:50.742737+00:00app[web.1]:npmERR!filesh2017-04-18T03:16:50.743150+00:00app[

javascript - 在 React 中使用 htmlFor 传递 eslint html-has-for

我有一个无状态的React组件,如下所示:constpropTypes=exact({fieldId:PropTypes.string.isRequired,text:PropTypes.string.isRequired,});functionLabel({fieldId,text}){return({text});}Label.propTypes=propTypes;我正在使用通过airbnb配置扩展的eslint。我的eslint看起来像这样:{"extends":"airbnb"}我的React代码抛出这个错误:errorFormlabelmusthaveassociatedc

javascript - 在 Firebase 云函数中包含异步函数 (eslint "Parsing error: Unexpected token function")

问题如何将async辅助方法添加到CloudFunctionsindex.js文件中?在将fs.writefile转换为Promise时,需要一个async函数才能使用await,如本文所述StackOverflow帖子:fs.writeFileinapromise,asynchronous-synchronousstuff.但是,lint不赞成在exports函数之外向index.js文件添加额外的方法。错误第84行引用辅助函数asyncfunctionwriteFile。Users/adamhurwitz/coinverse/coinverse-cloud-functions/fu

javascript - ESLint:let 的第一个实例导致 "unexpected token"错误

这个问题在这里已经有了答案:Eslint,howtoacceptconstandarrowfunctioninJavascript?(1个回答)关闭6年前。我的javascript:letfoo='bar'为什么ESLint响应如下?~/index.js1:5errorParsingerror:Unexpectedtokenfoo✖1problem(1error,0warnings)似乎无论在脚本的哪个位置,使用let设置变量的第一个实例都会出现此错误。为什么??我的.eslintrc文件:module.exports={"env":{"node":true},"extends":"e

javascript - 为什么eslint检测不到目录下的所有文件,却能检测到单个文件?

这是我的目录结构。我想配置一些eslint规则来检测我的代码。在.eslintrc中,我写了这些配置项。{"extends":"airbnb","rules":{"valid-jsdoc":2,//DisableuntilFlowsupportsletandconst"no-var":0,"react/jsx-uses-react":1,"react/jsx-no-undef":2,"react/wrap-multilines":2,"func-names":0,"new-cap":0,"no-undef":0,},"plugins":["react"]}我已经使用npm脚本来运行es