eslint 设置目录_ESLint 使用指南

eslint [options] file.js [file.js] [dir]

Basic configuration:--no-eslintrc Disable use of configuration from .eslintrc.*

-c, --config path::String Use this configuration, overriding .eslintrc.* config options ifpresent--env [String] Specify environments--ext [String] Specify JavaScript file extensions - default: .js--global [String] Define global variables--parser String Specify the parser to be used--parser-options Object Specify parser options--resolve-plugins-relative-to path::String A folder where plugins should be resolved from, CWD by defaultSpecifying rules and plugins:--rulesdir [path::String] Use additional rules from thisdirectory--plugin [String] Specify plugins--rule Object Specify rules

Fixing problems:--fix Automatically fix problems--fix-dry-run Automatically fix problems without saving the changes to the file system--fix-type Array Specify the types of fixes to apply (problem, suggestion, layout)

Ignoring files:--ignore-path path::String Specify path of ignore file--no-ignore Disable use of ignore files and patterns--ignore-pattern [String] Pattern of files to ignore (in addition to those in.eslintignore)

Using stdin:--stdin Lint code provided on - default: false

--stdin-filename String Specify filename to process STDIN as

Handling warnings:--quiet Report errors only - default: false

--max-warnings Int Number of warnings to trigger nonzero exit code - default: -1Output:-o, --output-file path::String Specify file to write report to-f, --format String Use a specific output format - default: stylish--color, --no-color Force enabling/disabling of color

Inline configuration comments:--no-inline-config Prevent comments from changing config or rules--report-unused-disable-directives Adds reported errors for unused eslint-disable directives

Caching:--cache Only check changed files - default: false

--cache-file path::String Path to the cache file. Deprecated: use --cache-location - default: .eslintcache--cache-location path::String Path to the cache file or directory

Miscellaneous:--init Run config initialization wizard - default: false

--debug Output debugging information-h, --help Show help-v, --version Output the version number--print-config path::String Print the configuration for the given file

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
升级eslint版本可能会导致一些问题,特别是在使用@vue/eslint-config-standard包时。最近eslint-plugin-import包的作者升级了版本,可能会导致项目build时报错。\[1\]在过去,由于一个bug,.eslintignore文件的路径名模板是从进程的当前工作目录解析,而不是.eslintignore文件的位置。但是从ESLint 4.0开始,.eslintignore文件的路径名模板将从.eslintignore文件的位置解析。\[2\]如果您使用.eslintignore文件,并且经常从项目根目录以外的地方运行ESLint,则可能会以不同的模式匹配路径名。您应该更新.eslintignore文件中的匹配模式,以确保它们与该文件相关,而不是与工作目录相关。此外,默认情况下,padded-blocks规则将更严格。\[3\]因此,在升级eslint版本之前,您应该仔细检查您的项目配置和.eslintignore文件,确保它们与新版本的eslint兼容。 #### 引用[.reference_title] - *1* [eslint-plugin-import升级问题](https://blog.csdn.net/pangliwang/article/details/128663120)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [[译] ESLint v4.0.0 升级指南](https://blog.csdn.net/weixin_33724570/article/details/87952841)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值