简体   繁体   English

在我的 angular 项目中设置规则 'max-classes-per-file'。 ESLint 触发的错误是“文件有太多类”

[英]Setting rules 'max-classes-per-file' in my angular project. Error trigger by ESLint is '"File has too many classes"

A bit new to linting, I'm trying to set a global rule "max-classes-per-file" in eslintrc.json file to turn off eslint error "File has to many classes".对 linting 有点陌生,我正在尝试在eslintrc.json文件中设置全局规则“max-classes-per-file”以关闭 eslint 错误“文件有很多类”。 Trying to define the rule directly in the file works fine, but I'm really trying to set it globally.尝试直接在文件中定义规则工作正常,但我真的想全局设置它。

I might be defining that rules incorrectly because it does not impact my file.我可能错误地定义了该规则,因为它不会影响我的文件。

My definition:我的定义:

...
rules: {
'max-classes-per-file': 'off',
}

Any help would be greatly appreciated.任何帮助将不胜感激。

Thank you in advance.先感谢您。

Mea culpa, I simply didn't pay attention.过失,我根本没有注意。 After closing the file and reopening it, the linting rule applied accordingly关闭文件并重新打开它后,linting 规则相应地应用

error in " instead of ' and false instead of off"而不是'false而不是off中出现错误

  "rules": {
    "max-classes-per-file": false    
  },

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么在我的angular 2项目中收到太多rxjs文件调用? (似乎都是他们) - Why do i get too many rxjs file calls in my angular 2 project? (seems to be all of them) 许多 Tailwind CSS 类不适用于我的 Angular 12 项目 - Many Tailwind CSS classes doesn´t work on my Angular 12 project 尝试使用单个文件导入TS类时出现Angular 2错误 - Angular 2 Error when trying to use a single file to import TS classes 在我的 angular-cli 项目中创建了 debug.log 文件。 它是如何创建的以及它的用途是什么? - There is debug.log file created in my angular-cli project. How is it created and what's its use? Angular2加载的文件请求过多 - Angular2 too many file requests on load 许多课程是否会减慢我的 Angular 应用程序的速度 - Do many classes slow down my Angular application 有没有办法在 Angular 项目中列出所有活动的 ESLint / Prettier 规则? - Is there a way to list all active ESLint / Prettier rules in an Angular project? 某些Bootstrap 4类在我的Angular 8项目中不起作用 - Some Bootstrap 4 classes don't work in my Angular 8 project 在 Angular 项目中测试辅助类 - Testing auxiliary classes in an Angular project 我的 Angular 应用程序在 app.component.ts 文件中出现错误 - My Angular App Has An Error In app.component.ts File
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM