- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在按照本教程创建一个项目:Full Stack Web App using Vue.js & Express.js: Part 1 - Intro
我运行了下一个命令:“npm start”,它在我的 package.json 中配置如下:
"scripts": {
"start": "./node_modules/nodemon/bin/nodemon.js src/app.js --exec 'npm run lint && node'",
"lint": "./node_modules/.bin/eslint **/*.js"
},
但是 ESLint 抛出下一个错误:
Oops! Something went wrong! :(
ESLint: 5.0.1. No files matching the pattern "node_modules/ipaddr.js" were found. Please check for typing mistakes in the pattern.
npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! server@1.0.0 lint: `eslint **/*.js` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the server@1.0.0 lint script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! /home/ironman/.npm/_logs/2018-06-26T13_45_13_295Z-debug.log [nodemon] process failed, unhandled exit code (2) [nodemon] Error
at Bus.utils.bus.on (/home/ironman/Documentos/Sandbox/Vuexpress/server/node_modules/nodemon/lib/nodemon.js:148:25)
at Bus.emit (events.js:187:15)
at ChildProcess.<anonymous> (/home/ironman/Documentos/Sandbox/Vuexpress/server/node_modules/nodemon/lib/monitor/run.js:164:11)
at ChildProcess.emit (events.js:182:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
我知道有 another thread昨天问,但除非我有 50 的声誉,否则我不能对此发表评论。另外,joknawe指出也许 eslint 正在尝试检查我的 node_modules 目录,但我不知道如何忽略它。
有什么办法可以解决这个问题吗?
最佳答案
以下工作:
// Pass on both Windows & Ubuntu.
// Note the slash & double quotes
// File: package.json:
"scripts": {
"lint": "eslint \"./**/*.js\"",
}
以下在其中一个操作系统上不起作用:
// Windows - Fail - "Oops! Something went wrong! :("
// Note the single quotes
"lint": "eslint './**/*.js'",
// Ubuntu - Fail
// Note no quotes
"lint": "eslint ./**/*.js",
希望对您有所帮助。
关于javascript - ESLint:5.0.1 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51044624/
我遵循文档中的说明 https://www.gatsbyjs.org/docs/eslint/ ,并想覆盖其中一条规则,但不影响其他规则,我所做的是创建一个 .eslintrc.js 文件。 这是文件
是否可以覆盖 TSLINT (tslint.json) 中特定文件的规则,就像沿着这些行的配置一样: "overrides": [{ "files": [ "*.spec.js" ], "ru
我一直试图让 ESLint 在 VS Code 中处理一个新的 Angular 项目,但它无法加载“@typescript-eslint/eslint-plugin”。在过去的 3 个小时里,我一直在
我在某个文件夹中有一些文件,而这些文件来自供应商,因此我无法控制它们。我想为该目录和所有子文件夹中的所有文件禁用 eslint。 最佳答案 您可以添加 .eslintignore在项目根目录下,和.g
我第一次尝试使用汇总,但我不明白为什么会出现此错误: TypeError: eslint is not a function 我之前安装了 rollup (v1.1.0) 然后 eslint npm
我正在尝试使用预提交 Hook 在提交发生之前检测 eslint 错误。我正在使用 husky 和 lint-staged。但它对 src 中的所有文件运行 lint 命令,而不是仅对暂存文件运行
我不确定我正在使用的东西是否存在错误,或者我是否只是在这里设置了错误,但是我在运行 eslint src --fix 关于“eslint-plugin-@typescript-eslint” 我已经指
我正在按照说明从 here 设置 ESLint . ESLint 失败并显示以下消息: $ npm run lint > IACS@1.0.0 lint /some/path/sscce-typesc
我正在使用 airbnb-eslint 和 babel-plugin-module-resolver。我在使用别名导入的每个 js 文件中都收到此错误。 { "extends": ["plugi
我正在将我的项目从 tslint 重新配置为 eslint。我可以手动运行 eslint,但 webpack 无法运行并显示以下错误消息: Module build failed (from /pat
我正在尝试使用 svelte 制作一个应用程序来试用它。 我想设置 prettier 和 eslint,我安装了这些依赖项和 Svelte for VS Code 的扩展。 "dependenci
我正在寻找一个规则来对齐所有 =在任务上。 像这样的事情将是积极的: var foo = 12; var barfoo = 21; var barfoobar = 22; 像这样的事
设置后eslint并在忽略列表中添加一些文件,每次运行 eslint 时,它都会生成有关被忽略文件的警告: /path/to/file/name.min.js 0:0 warning Fil
是否可以将 ESLint 配置为仅将规则应用于名称与特定模式匹配的文件?我知道在目录中可以有单独的规则表,但如果结构如下: app | |- module1 | |- module1.js |
有没有办法禁用文件夹的特定规则?例如,我不希望 test 文件夹中的所有测试文件都包含必需的 JSDoc 注释。有办法做到这一点吗? 最佳答案 要从 eslint 规则中忽略某些文件夹,我们可以在根目
缩进规则似乎无法禁用;如何(在配置设置中)禁用此规则?谢谢。 最佳答案 将规则设置为 "off"在你的配置中是这样的: "rules": { "indent": "off" } 您可以在 the
ESLint 有 dot-location允许决定您是否愿意的规则 object. property 或者 object .property 当打破点时(我更喜欢后者)。 但是,我找不到确保点与对象具
这些库之间有什么区别? babel-eslint [ github.com/babel/babel-eslint ] eslint-plugin-babel [github.com/babel/esl
我想把 Prettier 和 ESLint 一起用,但是一个接一个用就遇到了一些冲突。我看到有这三个包似乎允许它们串联使用: prettier-eslint eslint-plugin-prettie
我正在尝试使用React.js和TypeScrip在ASP.NET核心MVC项目中启用eslint linting,并且正在努力修复上面的错误。。我使用的是Visual Studio2022社区版17
我是一名优秀的程序员,十分优秀!