草庐IT

cli-plugin-eslint

全部标签

javascript - CKEditor 4 : How to add CSS stylesheet from plugin?

暂时试过了,但是没有成功editor.addCss(this.path+'tabber.css');editor.document.appendStyleSheet(this.path+'tabber.css');完整代码(function(){CKEDITOR.plugins.add('tabber',{init:function(editor){editor.ui.addButton('addTab',{command:'addTab',icon:this.path+'icons/tabber.png',label:Drupal.t('Inserttabs')});editor.a

javascript - 服务后和更新时 Angular 4 CLI 太慢

我在运行ngserve后粘贴了截图。它在34946毫秒。它非常慢,并且正在损害我们团队的表现。当我们也更新我们的代码时,重新加载页面的时间太长了。我的angular版本是AngularCLI版本(1.2.7)这在AngularCLI中是一个问题还是正常现象?我们的项目已经有大约40个组件,但我不确定它是否会影响加载性能。这是我电脑的规范,以防万一。 最佳答案 我解决了我的问题。发生的事情是我们的组件和其他资源都导入到app.module.ts中。正因为如此,页面每次加载时都会加载所有资源。我的解决方案是应用延迟加载以仅加载那些特定于

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 - 在 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 - IONIC 1 项目的 ionic 服务,不适用于 ionic 4 cli

今天在IONIC4Beta发布后,我将IONICCLI更新到4.0.1。在我尝试使用为我的IONICv1项目之一提供服务之后ionicservecommanditwasshowingbelowerrorandwarningstomeionicserveionic-v1serve--host0.0.0.0--port8100--lr-port35729--dev-port53703[v1]'ionic-v1'isnotrecognizedasaninternalorexternalcommand,[v1]operableprogramorbatchfile.[INFO]看起来@ionic

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 - 如何使用 ember-cli 安装 fastclick?

我有一个ember-cli项目。我已经使用bower安装fastclick并将其添加到我的brocfile。现在我正在尝试初始化它。在我的app.js文件中,我添加了:importFastClickfrom'bower_components/fastclick/lib/fastclick';但这在控制台中给我一个错误:“未捕获的类型错误:无法读取未定义的属性‘默认’”。检查器显示以下生成的代码:["ember","ember/resolver","ember/load-initializers","bower_components/fastclick/lib/fastclick","e

javascript - 在 Windows 10 上安装 Angular-CLI

我在Windows10系统上安装angular-cli时遇到问题。这些错误与Python依赖项和node-gyp有关。如下所示:>execSync@1.0.2installC:\Users\UserName\AppData\Roaming\npm\node_modules\angular-cli\node_modules\execSyncnodeinstall.js[execsyncv1.0.2]Attemptingtocompilenativeextensions.{Error:spawnnode-gypENOENTatexports._errnoException(util.js:

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