[英]eslint not ignoring node_modules and getting error when try to lint
I'm trying to implement eslint
in a Next.js
project.The file structure look like below我正在尝试在
Next.js
项目中实现eslint
。文件结构如下所示
.eslintignore
.eslintrc.js
.next
.prettierrc
.stylelintrc.js
components
forms
modals
modules
node_modules
And I have node_modules/*
in my .eslintignore
file.我的
.eslintignore
文件中有node_modules/*
。 When I try to lint these by eslint --fix /sources/**/*.js
I am getting below error当我尝试通过
eslint --fix /sources/**/*.js
对这些进行 lint 时,我遇到了错误
You are linting "/sources/node_modules/ally.js", but all of the files matching the glob pattern "/sources/node_modules/ally.js" are ignored.
Anyone can help me to solve this?任何人都可以帮我解决这个问题吗? Thanks
谢谢
If .eslintignore
located in the same directory as node_modules
you can specify it as node_modules
.如果
.eslintignore
与 node_modules 位于同一目录中, node_modules
node_modules
# .eslintignore
node_modules
**/.next/**
**/_next/**
**/dist/**
.eslintignore
follows .gitignore
syntax. .eslintignore
遵循.gitignore
语法。 See .gitignore specs for more details.有关更多详细信息,请参阅.gitignore 规范。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.