如何配置项目忽略Eslint文件校验?

2026-06-09 04:050阅读0评论SEO教程
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计135个文字,预计阅读时间需要1分钟。

如何配置项目忽略Eslint文件校验?

打开 ESLint 的配置文件 `.eslintrc.js`,设置如下:

javascript{ rules: { allowasync-await: off, allowdebugger: off, generator-star-spacing: off, no-console: off }}

打开eslint的配置文件.eslintrc.jsrules:{allowasync-awaitgenerator-star-spacing:off,allowdebuggerdu

打开eslint的配置文件.eslintrc.js

rules: {// allow async-awaitgenerator-star-spacing: off,// allow debugger during developmentno-console: off, // 在这里禁止掉console报错检查no-debugger: process.env.NODE_ENV production ? error : off,indent: off,no-irregular-whitespace: off, // 这里禁止掉 空格报错检查"space-before-function-paren": off, // 方法名和刮号之间需要有一格空格object-curly-spacing: off, }

在rules最后添加’indent’并设置为off或0

indent是eslint的一个检查规则eslint常用的有十几个规则不想用那个规则检查就设置该规则为off就可以了。

阅读全文
标签:配置

本文共计135个文字,预计阅读时间需要1分钟。

如何配置项目忽略Eslint文件校验?

打开 ESLint 的配置文件 `.eslintrc.js`,设置如下:

javascript{ rules: { allowasync-await: off, allowdebugger: off, generator-star-spacing: off, no-console: off }}

打开eslint的配置文件.eslintrc.jsrules:{allowasync-awaitgenerator-star-spacing:off,allowdebuggerdu

打开eslint的配置文件.eslintrc.js

rules: {// allow async-awaitgenerator-star-spacing: off,// allow debugger during developmentno-console: off, // 在这里禁止掉console报错检查no-debugger: process.env.NODE_ENV production ? error : off,indent: off,no-irregular-whitespace: off, // 这里禁止掉 空格报错检查"space-before-function-paren": off, // 方法名和刮号之间需要有一格空格object-curly-spacing: off, }

在rules最后添加’indent’并设置为off或0

indent是eslint的一个检查规则eslint常用的有十几个规则不想用那个规则检查就设置该规则为off就可以了。

阅读全文
标签:配置