Tag: eslint

没有eslint输出

这可能是一个愚蠢的问题,所以提前抱歉。 当我在我的文件上运行eslint时,我得到了这个结果。 /home/ubuntu/workspace/node_modules/.bin/eslint 0:0 warning File ignored by default. Use "–ignore-pattern '!node_modules/*'" to override ✖ 1 problem (0 errors, 1 warning) 所以我包括–ignore模式来摆脱那个警告,但是我没有回应。 这是否意味着我的文件没有皮棉警告或错误? jafar70:~/workspace (master) $ eslint –ignore-pattern ./node_modules/.bin/eslint index.js jafar70:~/workspace (master) $

eslint for redundant double如何更改为有效

我尝试提交下面的代码 if(!!obj){ … } 多余的双重错误,我该如何解决? 为什么我现在得到它…

eslint报告依赖configuration的eslintrcconfiguration问题

运行以下lint命令时,我收到了弃用警告 eslint src/js/**/*.js src/js/**/*.jsx webpack.config.js –quiet 警告: DeprecationWarning:[eslint]“ecmaFeatures”configuration文件属性已被弃用,不起作用。 (位于/Users/me/Documents/my-project/node_modules/eslint-config-airbnb/rules/react.js 这似乎是抱怨在eslint-config-airbnb列出的文件在react-a11y.js和react.js 。 这些文件的确包含顶层configuration ecmaFeatures: { jsx: true } 这似乎是不正确的: github问题 , 文档 。 但是,似乎( 文档 ) node_modules应该被node_modules忽略,无论如何,只是为了明确,我已经添加了以下内容到我的.eslintignore node_modules/**/*.* node_modules 为什么我得到node_modules中的问题的警告? 我唯一能想到的是,忽略列表不包含eslint本身的configuration,但是这似乎相当复杂,它可能会警告我node_modules中的每个eslintrc文件的每个过时或错误configuration? 如果是相关的,我的.eslintrc.json { "env": { "es6": true, "browser": true, "node": true, "jest": true }, "extends": ["airbnb", "prettier", "prettier/react"], "parserOptions": { "ecmaVersion": 2016, "sourceType": "module", "ecmaFeatures": { […]

Webpack在浏览器控制台上抑制eslint警告

我已经完成了configuration我的eslint规则,并根据我的规则重构项目文件。 事情是我有一些警告,我可能想离开那里一段时间。 但我的问题是,浏览器控制台上显示警告,是什么使发展不可能。 下面,我的webpackconfiguration: const path = require('path'); const webpack = require('webpack'); const ExtractTextPlugin = require("extract-text-webpack-plugin"); const context = path.resolve('.'); module.exports = { context: context, entry: './src/client.js', output: { path: path.join(context, 'build/client'), publicPath: '/static/', filename: '[name]-[hash].js' }, module: { preLoaders: [ { test: /\.js$/, exclude: /node_modules/, loader: 'eslint-loader' }, ], loaders: [{ test: /(?:node_modules).+\.css$/, loader: […]

如何在Atom中显示整个项目的所有eslint警告?

目前我的客户端项目是由webpack构build的。 Linting项目是构build过程的一部分。 项目中的所有lint警告/错误都显示在控制台中。 当我在Atom中打开文件时,会显示该文件中的警告。 但是只能显示所有打开的文件的警告。 我想在整个项目中看到所有的警告,所以我可以点击它们并迅速解决。 我想知道在Atom中是否有这样的解决scheme。 有什么build议么? 我正在使用以下Atom包: 棉绒 ,版本:1.11.18 linter-eslint ,版本:8.0.0 和下面的npm包: eslint ,版本3.12.2 谢谢!

ESLint ES6 Redux全局必需意外的require();

嗨,大家好,是的,我有ESLint这个问题,不能灵魂靠我自己,这些商店是分开的每个环境,你可以看到截图,我怎么可以修复,使ESLint高兴,我要学习新事物? 🙁

eslint并使用NODE_PATH env var来导入模块

我收到本地模块的错误。 使用以下来启动我的应用程序: "start": "NODE_PATH=\"$(pwd)\" node -r babel-register -r babel-polyfill src/index.js", 通过将NODE_PATH设置为package.json所在的根目录,使我能够从根写入导入: import config from 'src/utils/config'; 这是恼人的import/no-extraneous-dependencies规则。 如果我写的相对path,它不会抱怨。 有没有办法eslint认识到根目录作为模块导入path的开始path?

如何让本地eslint插件与本地安装的eslint一起工作

根据文档插件应该工作,如果他们是npm模块名为“eslint-plugin-” 这是一个遵循这种模式的插件 。 来源在这里 。 所以,我们做一个新的项目 md foo cd foo npm init … answer questions .. npm install –save-dev eslint npm install –save-dev eslint-plugin-require echo "define(function(){});" > test.js echo "{\"rules\":{\"require\": 2}}" > conf.json node node_modules/eslint/bin/eslint.js -c conf.json –plugin eslint-plugin-require test.js 产生 ~/node_modules/eslint/lib/eslint.js:569 throw new Error("Definition for rule '" + key + "' was not ^ […]

如何用gulp-eslint修复文件?

我正在用eslint喝酒 。 没有eslint ./src –fix ,我只是运行eslint ./src –fix 。 我不知道如何做到这一点吞咽。 我在下面尝试,设置修复是真实的,但它不修复任何文件: gulp.task('lint', ['./src/**.js'], () => { return gulp.src() .pipe($.eslint({fix:true})) .pipe($.eslint.format()) .pipe($.eslint.failAfterError()); }); 我想要修复./src下的所有文件。 我如何做到这一点?

从命令行安装ESlint错误

我遇到以下错误安装eslint: npm ERR! Darwin 15.4.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "eslint" npm ERR! node v5.5.0 npm ERR! npm v3.8.8 npm ERR! path /usr/local/lib/node_modules npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules' npm ERR! at Error (native) npm ERR! { [Error: EACCES: […]