命令行接口
ESLint 命令行界面 (CLI) 允许您从终端执行 linting。CLI 有多种选项,您可以传递这些选项来配置 ESLint。
运行 CLI
ESLint 需要 Node.js 来安装。按照 入门指南 中的说明安装 ESLint。
大多数用户使用 npx
在命令行上运行 ESLint,如下所示:
npx eslint [options] [file|dir|glob]*
如:
# Run on two files
npx eslint file1.js file2.js
# Run on multiple files
npx eslint lib/**
请注意,当传递一个 glob 作为参数时,它会被你的 shell 扩展。扩展的结果可能因您的 shell 及其配置而异。如果要使用 node glob
语法,则必须引用参数(如果需要在 Windows 中运行,请使用双引号),如下所示:
npx eslint "lib/**"
5uoY3thLQnfZMHDKW/Awlu5uSBKE6NrsjBv0i/68sMR4C36QBa9RxkmwNGbxSw94W+aBT6vMz9mv2lE8MQ43E3AjIVjIL/L6eMvszOfjCHHI+8fBmpZ2Kx5nftuISyWMsKNin1scj35Zs2KKxkNMl8tmlLKMZTK2Ol3Wpw4p+RD6VjA8qb9J40hqnLpWJ47c1I2V2tsu1qmEjMZ66pYOQ4QPwtrAiKlzHHSwvyxj6Gp8ALyNLbN4VEC43/R9y0GOH8LVRtIMzvEcwuSClOVs/gkyupqnBitu7dYy+1rz5KgZXxsJzbfAO0qgGeTLPSn6KO78w1OAcK0GKs5Q1w0LWKk8M9YE+zJGBMUKZhoEdEc=
将多个值传递给一个选项
sssC8zD4RXKZM/DZ+voP/Nr6dNxU8ay4LVv1LrA6kLPk8vVrVdhFmxeDYb9yDNWl3brHjGuCjR0lpgnfVOLNTPagDvFdHp+FKbT/oASAn86Zvw8YEEefJA0MCosrKSUxEW4eNlyhykez+efjHUhSfEkQFE/kJfzQIvlerdza41P5F0EAHbr/oiuz6z8j/QsHj5NasG+0QRgsurcGU3wi1pk3ZGkVe6/0GbzJh6u2Hd2rYFELeK32QIv1URriV5yGFK8FsgOLIs6JMWtiXMO7gCNj2CDnuEhmqsIXZ6QXZdk=
sssC8zD4RXKZM/DZ+voP/F/M20jHRsgfNlOODEs2R7a5RLBVfQKGkjl1x5u/hwGs
npx eslint --ext .jsx --ext .js lib/
# OR
npx eslint --ext .jsx,.js lib/
选项
fb80Pq8KNAhzXkX/C42MowMna6i7FFKThqZWxF941aw+MGpIQM/3BYdSmpLE0qCldEpMsbH6OC0FeeYdIwETIoKfFc27iB8HVWX7sFeMcYw=
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 if present
--env [String] Specify environments
--ext [String] Specify JavaScript file extensions
--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 default
Specify rules and plugins:
--plugin [String] Specify plugins
--rule Object Specify rules
--rulesdir [path::String] Load additional rules from this directory. Deprecated: Use rules from plugins
Fix 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 (directive, problem, suggestion, layout)
Ignore 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)
Use stdin:
--stdin Lint code provided on <STDIN> - default: false
--stdin-filename String Specify filename to process STDIN as
Handle warnings:
--quiet Report errors only - default: false
--max-warnings Int Number of warnings to trigger nonzero exit code - default: -1
Output:
-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
--cache-strategy String Strategy to use for detecting changed files in the cache - either: metadata or content - default: metadata
Miscellaneous:
--init Run config initialization wizard - default: false
--env-info Output execution environment information - default: false
--no-error-on-unmatched-pattern Prevent errors when pattern is unmatched
--exit-on-fatal-error Exit with exit code 2 in case of fatal error - 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
基本配置
--no-eslintrc
ydfSUuOoj9A6Icsp6XCc/7DghCqtVXAh4PaUpwFx7mH8olDtZV79Yzle3cC1FwMfyEzkmgvkhdjsCaxEvYU+zk70Xs03wdqNRD6c6ar1EUTtXcYEYfCfrLaLiXEIo9aZ
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5XGlZg0i3lkPPOGATuJ+Wnaq7eo2AUkmHHBy5l8lAclmA==
--no-eslintrc 示例
npx eslint --no-eslintrc file.js
-c、--config
2/EEJ7MxhCB3/s6iqVbqvOT56qKAAgoqh9pkj6TVNK1xPxD+FPPpgR5MebuPVvOGZXGAqzInJSa4RGJH0x2G93UphMiObMyYwW61KVV6bff9u1I0U94iFTQ8TnirTz+fu0PIhYkiu8b2E0llkXvE/kW52gedX6dCO05fV+A9BISTOnIo/a0wrdc00BNOYUFN6/W6Awrhz6MykDzat+BPlg==
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5X5KqqHWbxplsW7zTZEl7ui/YsiPh4nCOdjxXdsiuTAMkdH2JG2aG5WbONyKBqJ4aDkZCGNvcpiNaqXlAaCvMKIj94TQGtQnPayhMU9Fi6GBX9WesloTNLQKGwVcNhXpN8=
-c、--config 示例
npx eslint -c ~/my-eslint.json file.js
K53JClqoyv0YJ47CNLRarRmWqNpCHb2QUP9qoMBm2RQ8m+QMuRjpm3+fEv06r3AmkHzNZzi75ajUu6TrR7JNAg==
8WazDx4qHfkBRCSf2yqWF5m/hM7KT7JyPSkxs7FBrnktpMp3W1Kpf/Z3o591SdZjzZGXtACgbK5Nfjt9I8+gqaetVRigZCmf3+rXvDEqz95kriGArG4Gr9hiVmiteWAz5/NfeBXaG4rqF0sk+oBrfyiwHciFCtHDiNFnufHwbLnUjMNJlqHAfM2xdABx96xhagSpQG6RqWYfSagYy6imokkuOks+Kzfd94FjMgQ/bYIEQWUJ3pOezHi0q2v1TflLQhfIgUcKWVvcN8unbPhAith0dH7Hq5qIbm2NgmL7uhLzYnylXySzlmxxqdy5nxkX7vlX6hcIx1mNZVanWTQSoCpEU2wyglC9VC5Fzm6nrjQ=
--env
uCbZVhWD99rl7EsFjLB/rNKH4TmE6b+hZWCT7uEUs6c=
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5X5KqqHWbxplsW7zTZEl7uiXKD+dePSUuPL8pJd5utPcsG07czWBaT9J8wRgh7HuCNoTNLlPkaaHxWhZo3Lp4+bw/ofA0gfY8wN7M9z1sXUnHWwwCSuSiZqoZXna0kGuV0=
5CNA0/RocAJ7NkoRh70j61T9MleP/8NgwKttQQprVO5EOz7HOEj8vmE/L18f1hg0xROkhKhEPoTp/vgH/is9bwj46k0xklmy3UYX4R1RM7k983qzR10Quu5ALxCY5IWXM+kAQS1L+AYpAxgT71wfZHOrLacsiApMm/b+QiIbfCsKS4gCH6zV6OrMRP3KIQUCYmXRFgC0ZDqmfjfHP7urMkw92cnT7SvkKhKCKIBXH40Kq8HPR6Hlh/ZMROjtcFb+X2fjL9v96HT8zEiwG2PDtS6EdE77t3j3YVa3pUiV9G5RdqDpHYUxrCsxaAS4wpC18rQK6zgeQC0af1ydS37+v1dSLoSXasIxJEDPxS4cyjDMqGeETGHBAbgVXUizru6Tai86D1toiT+6xY5BsP6iaw==
--env 示例
npx eslint --env browser,node file.js
npx eslint --env browser --env node file.js
--ext
t51vrgt8CTBsfA+oLRq1KJ9p5+EVqsy3ufwE3OTnFodsKXui5OMXzPOpXw3pvhzpykbtTCh2HINBs6bK5L0krGCJzcE/mUucPEzgWmwgoxEgGwvkaY363IRtAwog9qfmTdDw9Q4Vap4rzhySSP7tPg==
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5X5KqqHWbxplsW7zTZEl7ui2xM7bj7RnTOxccwtVxqY0C5fpTvn0Ip5LVIGR/3ZogOv7j0kPPCf0TmGPXJQRbPNN8LiSWYTWqgJ7No+eiSEYU4Bcg7WPLEW+UDAqqwESNVt98bI/YXwAZHf8vzDqGR6U6PSVqk9gbGcM+rkxHGe3YSX+qFJ4f8VEhBKhPOuun/0+mzSihnQ6SEX6re4t4iDA+AjGlrc4NIz20Um512EUpRVe7NFp/Or+qHiOlcpj6MORY6Rip+cjuJ7N8E42Vr3pp3fH+KVC3ZSZ/MXl56KhQ==
lwBK2X4g74ZeZJ0X93nHk6/d24K38zeM/cCNxWV8T7QLYQR+57rrRCG3i1t0Vz5kLbeWR0uQFYGQfgIf4L/cR2e4a4kcyfHl1ea1pET149yA/ApNUoE5UDhOrwap2AOraVwFfuVabGSLQ91Bk64GFSb1Z6ldUHGNdI9I+0e/mByNdY0upxYsqpQdom1/fz9TBMSZyaNjdQxp12Bentgtl37qCiaQ6t+Dez+EwvcxJbqd80+Emum5LDwtS5UFy1Wc5xtvrbdNNwWkRWCNp2MwIhOUE1rOzc8B8IBwhA+pLgkMoXMgVqFdjXMULy9wmD3pZanXd7e7cTgbcE4jpmRu/KSEg8z8wGOvdd8kG0hF8XU=
--ext 示例
# Use only .ts extension
npx eslint . --ext .ts
# Use both .js and .ts
npx eslint . --ext .js --ext .ts
# Also use both .js and .ts
npx eslint . --ext .js,.ts
--global
DtCDcw3sUu2gYhfzfW6QATm4QGc5BmEg3Sxt6AtPM0neHHxtgAvqF3ZxDRGwxgHPhZLYARoJ0u6O/uZNUsOwZWDnBRz4NUUTHCQwlJm+do/FHKkWo/LyEMyZRvjpTt6N5dDSCpJuQ6vv0MwycvWuig4o/K8wFWA9G37cVe7GnMIN/JvXh8JMMtfyoUY3Dp1Chui+7c59AY0BHuYtISe+2w==
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5X5KqqHWbxplsW7zTZEl7uiXajiT03YXaxNjqPWJmmDAEmiGqHCsNm9KVDJBjkiHiK9b5icvTXywS/wjHVZQCs8ct3jeLnlsOQrO5Ii2R2kZr3JR/XGpy8HnNmQ81AopmfmmWYneltWkcDbFIEVqdxXI2XNUrmwEPMCoFplPvb3WANtDRikysigFOw+u1ONx9XAnquWbwhg4yUwZb5Qsh9sO94DqWRhUaJXgGhK7v38jipIXr5kV9OSoEsE4qbY6SO+znJW2jP73WNjE/jG5naVc6/kfVl+obOXl7LZqVxMQe+fydX89AcRMAj0JB9AkHQIOclVENMmksiNvYSQogtWUPhycMF93wOhsFCvM9/6UQ==
--global 示例
npx eslint --global require,exports:true file.js
npx eslint --global require --global exports:true
--parser
t51vrgt8CTBsfA+oLRq1KJ9p5+EVqsy3ufwE3OTnFof+NTlPMUbbURgcI8RWVsGTyxWhxjKQPd1+VsscjaysIw==
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5X5KqqHWbxplsW7zTZEl7uipACygaGozkmE3i7pAbpDZFmdRNo9kQ6Cww0ZKyM18fav/VYpQbrZdpuOXO8W5YN2tQMO9sykcf/NJwD2w0F1EtudxH8vUNdrEdFm8YHPr+GvpY7NV7Elfq/RSIOlyZqtqaQfJbh6y3wMyJaKEL5qigLr1mB9lHxkosPSKR0pRWVWWFiRVXgKajX47Fywl7ZG
--parser 示例
# Use TypeScript ESLint parser
npx eslint --parser @typescript-eslint/parser file.ts
--parser-options
t51vrgt8CTBsfA+oLRq1KJ9p5+EVqsy3ufwE3OTnFof+NTlPMUbbURgcI8RWVsGT1zv8HbE3xww82gwaSD8cdgCbYFjYoG9MfKtiIWUy5l6WQEdXbsbWKMevpKuOy7B8hA+W6rQs2BVjibcceM2FjzY8HEyiT4Rfxar0HxlbGws=
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5WMtUuPzQLVjqmRuSwAcLBCD9niEedhGl0nKJQ1AbVGXU4dKMrRpy5oQ+F6xQKdNPv48W03njO8+pd9uNYUxIMbZgGWE3qHqMxiPaO8CQvkLR7N1a7ZCWVL0fETLA8QHR4fGXJoG1SiLh3qsi2giUJ+
--parser-options 示例
echo '3 ** 4' | npx eslint --stdin --parser-options ecmaVersion:6 # fails with a parsing error
echo '3 ** 4' | npx eslint --stdin --parser-options ecmaVersion:7 # succeeds, yay!
--resolve-plugins-relative-to
qKGbQCZahDv9ORHd9o9Pl5kyrckExy7pZy6OvS96NWI=
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5X5KqqHWbxplsW7zTZEl7uiPdr8VxyYYOOhCTfI+o5uBzlYAGu6hFnHjJwrAeGABip+hzk4UYHKaGve6sSI2/0/uxhJ/CmvycF4WKoAaoShJm91/x+9sjEFGPutwXwtJstFUKEPV1Xb70AqM/3qfiok1ma4SgrrSH0vL0PvTRfcZW22u1gTTQoGTjd83u3fMfa5B2noenuvR+jtE+7QGOI5Bv3OW+5LA/p4j63aYrCxXtF3qY0LRmiFboaqZJQ1aME=
wF89oxnihGYj0wCnB/6WPNHnfEKnR9gWj/5io/SHeJLptX4UHi6rzeTZQthp/z7/Yt1YrTcc7W4mg4kVxyg7nDvnIUlcr0TAaVxwJ16f6+zsMhKJWmE2GW1lWgQMiMHfJFfMp+BLA0XUQFx/59TIElolwEFyOsrGg0VWdKBKd0F3LMa6T99tS3RMf7JJZuCV
L7HG+V0JMEyy2jT1/HCh2A==
- mafxxvPtMuWjxD8+F1ASlkICmN/4OCZFxfWZ0tCvzUPPDXwnQcxQzUAKRlJwdPq+Hr6pKnhWC8eiE8Km9bZ7QaJekT7x2GQlzTlKPjcl6Emoe852iCNFTSsJwobQrc+AUeoLw35xGUwusAVnWdyhTzIVo1hjJAB+oKAr61lUNVrdYxlneJyfh0yO4FIv5HffOZdOWbkywTGtelNU8bsyn/1WEhUrXPzp551Lduu1hvkSRxmKBJWKAVegL6q+vgmTcGaz0lUOZc0Vn3tRTib3meSww6hzAp7YHaQqX9cQ5hNO9FeM8NUPF8l88SOmQSb0i2WZ0R3EbDkDYaYG03ahIPuf8T5kkiF7lp6dCiS2RM9LMEhN+vpFBZa/I1jIwo9ZW2DdtNjOyn7oqh/13Xje0p7IqmCQYMbh3b+T94dBLnwEgMC38c46HnZqB0J0rDzDoxwteBZjlsauw5SQUHhA++A6gaTsmw1fjhlmMuoamWEOyfAFKYN+NsgljaBXLncU5QSkOn9UsXfzMO3n72vektJGz87mZvNzM2YyrMwp67BapkNF3Jn7Ttzbg9YNwuijiPUd92E+Aol/F0Mw2LnJ4wePT4Ndhe9qN5ri0P46ou0=
--resolve-plugins-relative-to 示例
npx eslint --config ~/personal-eslintrc.js \
--resolve-plugins-relative-to /usr/local/lib/
指定规则和插件
--plugin
khmytvVzP1SC2zRTVz2NfZzokQvqHtBeY431RuD+4UvGDapNjYL1vM7axLzvPQt+
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5X5KqqHWbxplsW7zTZEl7ui4+OzAUkmNezJ3ntwbjqLbTRwqSFpzy6Df3BL7wtdwiuOJT0ZOrbPGbXXDTOwB9ODtEqjBXtIZvJWyFyUXo6dV/er44QJzSbW0f0htmrmxkzrKbcS+DKoAPbJU9M/q16EKJ5Ix/nr0q13NxmBXpB+w8eGVYGoe0hKgDapn0IzAfGxY580zquIScVrb4R0JWFX5tTVOhVH4PTBLXxSoOlQoA==
Qd1PgkB9G+DQr5O/dWUSxetc/jje/TO93H94ODZ0CAdnmYpFn+hqlgGzFHYeSokGwPX5RsAyXAPfz9M2Ky/41A==
--plugin 示例
npx eslint --plugin jquery file.js
npx eslint --plugin eslint-plugin-mocha file.js
--rule
khmytvVzP1SC2zRTVz2NfQHUObaIX+2HJLav0jL6lIRii8C6SOsN5tTkWfCeWZAR
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5Uz08NqRp2KbHD/8ll2JqTvBvMrYcnt94X6NbvkloLg11NQW6NkB0E4t8YJfcJvbfpFOqdGHsyKE1IXMdF34vWM1nrHgJdHXwjXFvTyGLVmCxF0wP3dmF9A4NyKvsUHzuIBSa53rXAYjWwMMcazfCZdUsO0z9M/fc0N2SzkYehi2Fa+tm9pMDoyRB1KQny0WuiChD5iuL8Jvda6unV7E5MI
YLYVDIDg6ZiLQKSrUhBCxjF+rNKoBkGvjOc2qaOpkNUBLns4G9pG3EFVI7b5g+r2NgBy2ks6YUDOpQAneYnuynruKZNU0A3XYL9iNbhCOciH1c+0hGJGXTrrXAkGEfXJK8p3c8g6Kt+reuflcV2qpINJjwlunSgxuQp9IRZbP4NYcVuIK+8d6PrtXIAESwX0R+QsLhy5i6z9DugoZAzMpYbct1OW8G5LylkOmUxcQTY=
1r1paWrYnYXYypbHiO3XyJMdwVj0tX/G9mCYLJDaDU6EZpYTCtEZwIJqvg/CRgEMRJ+Vpw5QhjqbbvK/SQlhLch8k9BuNqOidEwABouAX70lIo/aJsQ9PY9kX5jTHRQuJirVygKqknC4Qa4Lunqsp5tOodm+M4D61iJzynm0nP194XFsF0fZmVVRMkHdLkNstlxyR9188GHbMq1AIQ9rw2dkvW/lMpdAdDLQ9YwJPryjPH4pOy8JOLVU2s+ft3qCz/cuMapFIIQhXtujJMKBgOANJfqq2Q/nyxU3c4HbwI4bQbk2wKfoaIBJMVADsFd2
--rule 示例
# Apply single rule
npx eslint --rule 'quotes: [error, double]'
# Apply multiple rules
npx eslint --rule 'guard-for-in: error' --rule 'brace-style: [error, 1tbs]'
# Apply rule from jquery plugin
npx eslint --rule 'jquery/dollar-sign: error'
# Only apply rule from the command line
npx eslint --rule 'quotes: [error, double]' --no-eslintrc
--rulesdir
h3t70vQS2gbDdBDa/PI48iy3e9I22jZYG4l4GeVFnJT4qTLhFeF8qVKHtuyQH03fexFs47O3muk4yx+7omRg0Q==
t51vrgt8CTBsfA+oLRq1KA59SpLCerioXPvU5DGemIKhEKQ1HGerkEmAMApMRFI485xYrzpuWNAwmXN8rw8/lQDN/tQOftnVWPPHiGlSPSmdBtm/TFxr7a0cRj+B2uTG/2UIw9MMFsldWYBCFaAhfe1/wKMRCpFF1+HwuFODVYF7tvZI/Cay2K2m7erSRcNoh4UPmj3ye3ad15h1ww7jl/ge8btY4/6/+WOwIyDhxzAy2veLVTzQ0DuBq8b1YO9K
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5X5KqqHWbxplsW7zTZEl7uiPdr8VxyYYOOhCTfI+o5uB6CmVPQNu7B0UL4rEMmQsIi0J4r+hfJiJGQn2hsHIeVzXlDFDewwHF2Bc92bqAaAStiwXpdBI7wTtPEfqSukbqAo9PEHgnzfVkuf19sZQY/RBCinbz2+hrjBOxiq/BDoGbM85BpJJ/rC5kle3xpwQYPY6DKwsb5Cz06Uq7YW1kAmJLhoZ2ogc1yrWyTPL0sAz7FzrCg/C7oH0OUOVyyDEWg=
6dakdIOiqwPbJ9QgP6KhFxfZf9XvB1/5OtprOJHbilfIdsSciLapDXYZH315dhXKX2ixv6It0Vbv7Vv85ZScHQUxGDCaC9jonJZW2ILTT5YA6xmWlhR6lQHu3IQvDkwJQiIJU3MZSooGWaCy/61OIZX3rR0/d6bNlF5JwyanGVdO7gm00BoVw+fH77LZU9nKxYVN1XZoAoE/CyrNvQBsqCtp6aGs38keWEkGR16VUHv3zROyUHUmkOEIgwNIZa3n/bLt1K8vhlOdJQyGp5yO1Wp2jkwQwvH/MY4hjfbXbG8qmzAdzYx58qLp0cnlpKtw3FpXFK8b7Vtts54yv/rTHtRETJSuO2BXZHC6rlbflslmSHM49Hy2h6foM4FCbOSl
--rulesdir 示例
npx eslint --rulesdir my-rules/ file.js
npx eslint --rulesdir my-rules/ --rulesdir my-other-rules/ file.js
修复问题
--fix
Rs0LQJpSE20ff7eom1WH7oX7ndcOUJJo66GXX82IiVKTC65SYDlOWMjxiHG/uD9jHkuePMHvFSoiZeKrmE284XcIhfrz9qoS/fJg+OIWGAy80FaILPsFOsgcHUHD4m6ZEyX+WY6GaSYXpnp7hfmAN4If0Yzi6MR7dLlT7dP0zEudSjJ7Q1ujkGeLNe9IRD+m
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5XGlZg0i3lkPPOGATuJ+Wnaq7eo2AUkmHHBy5l8lAclmA==
HmGxKTisceTstxZAfeeszUGVCRYRAUK5w3yp9khj8jKu8faCBUXbNVpbh/jilxSYbC8f56M7QZPcNbxpfLi+9PZ8dYaUIHuNlol9NHy+eJ+DIe1J6y33egaKBSO9TJZM04GM/GJKE16U+I0L0l+8aA==
- 当代码通过管道传输到 ESLint 时,此选项会引发错误。
- 此选项对使用处理器的代码没有影响,除非处理器选择允许自动修复。
m1yvuUQIQlPJx+WisAhN3/xg8KFb6lB5B0KcKHZ5KT3ZMoRsnzdMoD7ZXBo4Yb08sh03Fspc8SCblCNNi59bwsE6PNhtW+lTeHRo8ygr19mVBEosDL+MhFtuqo5yCEWKYRa31IyCFKtJyyTWnJ0aX88lAb3f7HX6+nvrg2/9IciCr82aypSqZ8NNlRCH3KW+iZIVQTsdj1vMFYHYxejH0+JRScWlPOGFdYpMQhZRb+Xp4fLr2nSvBCE4Ee+fvxvZen7Mspi4g+uAPAr381JTT1OPWvttwsQU28hZnszpaMM=
--fix 示例
npx eslint --fix file.js
--fix-dry-run
zksdlAoyK3ziv+g9Qdl0Ly/Ye6tJFIhVHbVl8Iix7ZZ1kAmY6DwOdfCUqIrBgiKxw+CZB8WvF6q0ccjvDO6n989AqE7ML/fWAgBt7kgfSbo2W8MR9bHdcbPrbNUu+k8eFHocYgnlyI9RyT1qrpUX7PhIMTJPTQKLlJZEiKLJp6mi9lO/sMOmhQSACSMDRZC0o3FQsCxe9bPXiwDLOyxao6qS74CWaHI9HenrOa/YDQMCy9+xMm7HSi5ANAH0hFJ7EmZrItWkXG9eyPdJxFRAt0IuR+93pCICOB3QWGK60UWGKokRKD03ZT5Bha8428KgXc/1i69aR1ktqAet2/CcSuYxu44mftK10nV5Aq15tVU=
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5XGlZg0i3lkPPOGATuJ+Wnaq7eo2AUkmHHBy5l8lAclmA==
aF8FRtb1hKCwUn3/YCzqwG5PpptnW//mB3CGmnAGY9mxAZ2pLXClp8tzYuorbg2sodWvsZuRi9Inv1CN+dy+A0BdoVkAB2VlAiW1zNkJxgZNg33mNeL6wnOFyroao2HbA6+lWYosvXMVlPZAzwj/zw==
OqJInfhelgSzt2kY31rbW0ly19NfgD0DpjhLifmk2NQpyVu28el1a9HZLhZwAlXsl7K9p788f2dLSO8SOMiLHa+zRSaBmbuZaLsbfRuwvu4/bX7bx5slGqYWsW0+jbSCGAfMi5bKIAQUyQ78OFvPRcJnWSjA0WM+mos504JDHC+yyz90bdmusN8z8IKPxqnN
--fix-dry-run 示例
getSomeText | npx eslint --stdin --fix-dry-run --format json
--fix-type
t51vrgt8CTBsfA+oLRq1KIRQZ1CSP1+WQPyh+kRCB8ZLFpE6kX8/ivzJSXOE9NAaycJU8gdWAU4n5G5Ukfbs0ktmwPMw6ZHmTieHPYNnSlsoCFQS+hLHXk/glthiJjnui7VO6UaweIQlgOwWx4YdDQ==
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5X5KqqHWbxplsW7zTZEl7uiO+UQzvjunTL+peZ9rr3o2NwaMGSMsqY31li3LKzRyyPHlKaytdla/nApZi7v/ahfafGZxyrLF/4axPOGo3n2K6aoBYF2YvbTFxGq8fWR1P5+i/UHRwLw5bvBPrwLnCr6TFaNDnDahmhsoR88MsqSB14Fzw3Nwrw0a8poO8vwxA2e66pnGSgT06AR1zmDXRPI9GsRZbRBgz8TkldDyb22q+pXuHJwGExNgpaVDTQGqif61yzmR55OOIknANcPlGfEfZ1IEPOWVhUrMPzdlTcp0NMj+tZAKgx1z+opemLaM6lYn5aXrUWSP9BlprOS+Oh5VUM7Wf7CaLZmLU9Df0Ya0DuDtKaeST0ek/NPqk55TdLa3eGDmQhxmRnyBV7FFtK7pE/AwSV4N55seBF9oIelnaI0Y5zOJJKGAxHf8nSU1MJit9O97lqD7Y5Y4Iwo1KqEeSKn+OTGo0EZez8Yw0zOOjT4lTSjVG6DCFEplEGsSjbNxPd3p6OxkBDJK19yk95ZrpMczcybg5+i30cT8VXBVyp0VHC0FP47BTj9MsCzglc=
gCEVbm9dxFIzOr/kkc++gM50MnF/zW8IR7wgpSIGzXfj1zHs6fOEHMN48LzVrzX7b/YRIrn7ZKNf3TlHY/NYi8s6TRLWc4Py5lLMFMZcTXL91C3EItvXA2Y3kW04iNljfrEnGycLLzGwAwdSXF5iBA723TTnBlqNjq/DHVT9Hs4TE00IrQH8QcC3QhgSqlHR
--fix-type 示例
npx eslint --fix --fix-type suggestion .
npx eslint --fix --fix-type suggestion --fix-type problem .
npx eslint --fix --fix-type suggestion,layout .
忽略文件
--ignore-path
t51vrgt8CTBsfA+oLRq1KImoy12KyAtZ0rBXQ6E7dNpzdAfqDeSrROag/Q9aURF06bnajmpaSLp0w2KksFhLhLCuU7pNyS8k8RmkUmWwiCk=
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5X5KqqHWbxplsW7zTZEl7ui/YsiPh4nCOdjxXdsiuTAMkdH2JG2aG5WbONyKBqJ4aDkZCGNvcpiNaqXlAaCvMKIj94TQGtQnPayhMU9Fi6GBVomVx7GDHT9LONCW8U1hvaCL1ASis1qF5HaKTyjCz/xpywMR5ys5ee7qp1Ytf1dVQtkl2MwX8B7bAD89qJIVCRC9sQF90hanl4zb9fSHtcaFSF+3v0oKLukmdD1AzRK5ibI/OSHxh9TuErfKK60F9kd6srPr+qg6PUftphyw/Hz
5uoY3thLQnfZMHDKW/AwljKutydXvQzDqFDA4lYxlhk5HGdE7GLh+5Ph2/xpwDfGpiXOaIHIlSenClfXJKCiVfyAph1r//QkuYb26iVq7m89Skw6m0FKV5Z346kZ4QUa74SERBQPOwXsDUxFfsbbdN9yE/ojcHpBqxUJUB7Fbqr3OBpf4slEe17GEz39gv8Ne7rmwrjItTx7cyh7VIZklRB0mzJqABICPWpl53hmVpQ=
--ignore-path 示例
npx eslint --ignore-path tmp/.eslintignore file.js
npx eslint --ignore-path .gitignore file.js
--no-ignore
0tnU2R3Cw7Yu3lYwyXErgy+pf8AA8O3YOzUWG5KDK7Z9cuGX9sPVky12rf2hejODSeOXUhoPnhtxyPrb2i3WETzY/ovIe7W/jt6xGQAyrfvGOkQFYicFCfl5FlNRw078Dn0twMCciU06OLlNp6onIcLnNUeWscEWlQX+jdpJUloFO6WxkTkFxwLDWZAJuE1lJy6at87X65lMZo3BmF+i1WN8jFxAQAlXRgbCI7dyg9a5vqY9WemNvfCtUYCoUi/G+Gb2gRcKK2DYuM7ec+jpgg==
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5XGlZg0i3lkPPOGATuJ+Wnaq7eo2AUkmHHBy5l8lAclmA==
--no-ignore 示例
npx eslint --no-ignore file.js
--ignore-pattern
t51vrgt8CTBsfA+oLRq1KCuyA4MuEyI3CX7q0bYcmgno7ST1X6SieHKAo/fdRnwRlkodWIHEfl7f0MSeIkG3ExGIy0Wp7Vif13ZoqT+zXClWHOkFr4hxrIZt4ONpjKpCWVmCSJ2vSnfVNsa0K/65nA==
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5X5KqqHWbxplsW7zTZEl7uizoKXSnIdxneuaAW05SgTjWCXNCPHrOCMf0sIGI9/QcdCvx1dTdUvQgtu3MH0i39gqxv+aBLzHh7SyCAR54jNTxTyQU671rSDFj1JDykYFEgQ38lfb2SEJugEXYZouEfSb/DwKHHFXGf0FnhwHKVQz8tOkgzeFf0grzSUsxEGX6Eyrh/6CoaOcuMKmiOQrPFzV/Q1nGF2VwnjkNR0eR9A41U+IkzLbPD35HxYSDqW7pcfPG5R1BT214u4WjpYOPmyEfPFZpwkvLQrz0/plsrT7t7VoCpbifWdBlhz2kXDy2zSlZE4xAYHrveh7u4Y7f9A4wDWPNQntdjVpeVcCcpRd6tfhpSXJkQ8idpYOgReOYTAd7v9HFLr16aK9PqIKd5HxI1b+lIFC9aHd4NFBIT3Ku3um5oNGfjstAGVpGPoyuBiZUgttv8VOGeKUaJjQMvB3amPfy2hrLhk1a1+oEuLYA==
--ignore-pattern 示例
npx eslint --ignore-pattern "/lib/" --ignore-pattern "/src/vendor/*" .
使用标准输入
--stdin
owh8GZ6O6dRGqLpxwYs6Ar7pQCzuiEdvZXi9/oQzndK3ioUtn1uwRtjd7aMyFrZvdDqOPPFfGGRICauVJxCylhvW7o6SfOx4ppBdxgPOKAfjlo/AgicEuqFm2fhwOEPSpNCIOQzuJnrteLfpGRCTwcFhGLwmmXHSIUF0Jm8SXn3LF0jYQF2UCRvKaWt3PNrw
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5XGlZg0i3lkPPOGATuJ+Wnaq7eo2AUkmHHBy5l8lAclmA==
--stdin 示例
cat myfile.js | npx eslint --stdin
--stdin-filename
t51vrgt8CTBsfA+oLRq1KBteuq6SSwMGW0INyJh0fSGlT+Ka0H4uvXUk+NSvIicyfL6odgAHZX6wgcADQ1XsKA==
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5X5KqqHWbxplsW7zTZEl7ui/YsiPh4nCOdjxXdsiuTAMkdH2JG2aG5WbONyKBqJ4aDkZCGNvcpiNaqXlAaCvMKIj94TQGtQnPayhMU9Fi6GBX9WesloTNLQKGwVcNhXpN8=
drUN2kQV1Y9jGD6nsF9V1cNPwUgZBvuVLVTjVxjwapWxgQAD5V3sDF060MNBHPGi+KWCjIxTGvcdLH6C3OrAoxXNOZtnPokgBQIk46m0ggYib6V+8+ke6lLBWZ2cCDyS
--stdin-filename 示例
cat myfile.js | npx eslint --stdin --stdin-filename myfile.js
处理警告
--quiet
t51vrgt8CTBsfA+oLRq1KEpI8XAY9y6BqIoCg7TA7i75cuaq0poIM6t2up5JTRsKuhAS+FB3zWSQYd5aYOZgJCwANXlo6xzOhZysPR1Ctuykb1OTSgveoQEVg4W2sHYA
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5XGlZg0i3lkPPOGATuJ+Wnaq7eo2AUkmHHBy5l8lAclmA==
--quiet 示例
npx eslint --quiet file.js
--max-warnings
t51vrgt8CTBsfA+oLRq1KELGehPi4mTNJpx8KMOKLSl0Fm5HYJhCExOcXty8rY4blsx6B8dY/cS2xfZ7zMwFZAnKA6PaQFcK+rOMJBclnWFtS16RjOBMLrlHPSvDWkFXIIGVvs12y0iDXN0zJStVjlH36CilFJi6wsFngRBuAqClH3kKDvLFDLxCFLL8Io9PRgDs28Z5q4Z2bx3iotZdTA==
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5US6kS29Uu5ko3FthbUXEyV7YV0a8xXe+1m2FNwQjQDn+lmi93Qb47rbqbL+bTTPEzsItL00nX0eJ6/YB0yBcqIWXJZ9hczq9hodnxnm+4le1jigzIo2gSoBYTC06d+5pSPudIuV6chjRkZ53m20gyIQu29yHXPDGQfo8J0DfJxYXXcRlSAYioQ8p5zHoYnqry1cPWyYSSBmHI2S21EUt2w8LF0nPqw5bwklnlD3yyDMoLlm0HAKtNEL/KLuw7GIQY=
YSVo/1Mo7pgILj4AW6NuZMBdq9nVUFvwUTYiODkLOrv+Kbvt18asqtL0g5JphrIiUOxT0oEAOcuwN3ieCQS790wHxkmRavXnqNRYFWBl4m9yTtlPbq/uhz7JGX54u8m6GdzJoskYdAYuTlt0qtPtdMS8q2Xkl5mhH+eeFUczYiuDkz1FOTajIcM7c7EmRDcuutJEojFK1ySECb58gwMBe4FV1FixewofvdEHyhrPE/oNtqLTFHy8ycp2OsC58BTpCZB3z2OmWbWcyFgMIaLswETcFPdNbahKifIJp/3ACgtJEBCHFs/YiBELTnIOC34X
--max-warnings 示例
npx eslint --max-warnings 10 file.js
输出
-o、--output-file
DtbwBeB8uWQklk7RGymNkcRTv0h0qKc72pwXyLFcblGr5AGXsJtDNjcyQ1UfLM7v+ljhaeS7Ff8dbVkg9QrPcQ==
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5X5KqqHWbxplsW7zTZEl7ui/YsiPh4nCOdjxXdsiuTAMkdH2JG2aG5WbONyKBqJ4aDkZCGNvcpiNaqXlAaCvMKIj94TQGtQnPayhMU9Fi6GBX9WesloTNLQKGwVcNhXpN8=
-o、--output-file 示例
npx eslint -o ./test/test.html
-f、--format
8/pzLhuoAqwcRt//mgJxEWcwCTZAwYg0Rqq9zsjtYnptya6jxe9oC0v4KvHHNLzZ
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5X5KqqHWbxplsW7zTZEl7ui+N640NiX+a/fkKPF9aNnC8hjYKOsbzlewp5dyBSE3vjP9syCcTU0RztW6a6G8JHIGb5ny3M71mxgJoCpl3gQAhzZSBFnioFA1Y6RqulaD3HG0UavB7+5+qoQ5Gj0v3MREu7jLTRaFa10S2muDQ3EwBLEc8t5ZfapqY2u4zhAz09pZyLVlLChPyXWP2tHgdRTnz03eTO9HfrpsooAxQBa2CpwzHBXu7Kb9mJur5s/f6IDm5O19PRhoOzRq1RZ6Qpkc5+xGQkll/qgWz1gQ0Zpri8rJnxr8CGyIeR2d8YmxOfETSkAtI75frcvIrGvtfue9z6EEbzi3A86Pa5gHqBxu1pjyA9jw3fThlz1u33UOoA=
6qPF3pTh+vzTO4hP2ASeGaodeL23NPZuNUi9niPLrpJLoaFSVA0okG/1IQfRVL6tW/NaMudx2PcDQ3M/rQnrCxiwHOP81xzbX0yxK+UryA8JKCTzlZu0CFpS8rLf+OdfrqV51j+ZVoL3NCOk8XLAYVzDRfiM/3+jQw2eI86r21LXHHFkTvOeaj9sJjQRT1Ub
V6JhoCHhNwy2cfIVWbhO5JjoA+0gJtzsz1wugTraLimdhoCXdOqVmiBDxOIGi8BJGOdAHwVLRuHgpYC4FUDQ05aYah+KrroqIPSJf0Qnang/3tJ7RtdO0EiJZnDXRGcB
RkTdmzoQkUTlXPVBednH77jBidnypnqjX6vNeqMQa/nhpx1omsZR3SMUJ+xEGEUvU5RAHCNuH2DfV9m7/oNjVq6rV3kyWGnFrIShjnB7SsETiBljFEIexmztB0mz2hpZ80kizT1QBqdApyOJ/y+11oBRJkBAdHaekHbsn6aNjR/IVw+LRaNlT6y3iqYpqrzTzWRj7pe1h+J5h234xu7TmA==
# Saves the output into the `results.txt` file.
npx eslint -f compact file.js > results.txt
-f、--format 示例
huBGQ2ukVFqLJJTuwidmuzdbb6vwxDYMxAGi4U+A+1/IAKs4CkGLnuMawaNwYsTDoJKG/0mWQpvz0GvAiVHoBg==
npx eslint --format compact file.js
lKviySt9aX2f/jeJrSiqJPdXfJc/sFe4rPisgYdxom5TkP801FwA89z8LFQSMBLs
npx eslint -f ./customformat.js file.js
4vwMz+rD8xnM1amoNLpkE7/H0ziBQvFbT3/Y9aMx7287fJQV2Dldy/boUtkof9Rp
npm install eslint-formatter-pretty
# Then run one of the following commands
npx eslint -f pretty file.js
# or alternatively
npx eslint -f eslint-formatter-pretty file.js
--color 和 --no-color
yLDSOAb2qiThqDB5mCGgCzzxwqD4Y92CV4BXMny38A1yOxkKWKeFTQU2xZo8ePAx
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5XGlZg0i3lkPPOGATuJ+Wnaq7eo2AUkmHHBy5l8lAclmA==
xea9FmYjXwppWZ0Ssj0W50m+a2Q3BySu0KqNfmERmOeMKHSOc5BoRgh9Ysv6cpzWun9RWSpf//NESuCrpJm2s5vKUgC37XMlq2x7O9EL8tcaYn9ky/xSJ1TA/swn4qtYoj0tWrOI9zD8+FABJts+fRXEwry0LlWI4B8ZFYHIi+gGM6CY20d5D4uHQEJ93Ez8TU7rqQTntu4IMuWafd+iaxyywJPWL4kNoCp7guHXzcDSbPWX8C74QIiZf26c0Ap/
--color 和 --no-color 示例
npx eslint --color file.js | cat
npx eslint --no-color file.js
内联配置注释
--no-inline-config
chn6s2nG6oWL7uTCwJyxnSecno3Db5sPSI75/bJJajO1iuRJ34xgunm8lsPhD3oYHZDUylz11sA7NxaplDKFDgGvBNWBDyBC/M7rj/RjwFWgsOqGLnQaZSYxjy6LjvfM0ps2WPIG6aqaI8e0yPXwoz2N7Bcte7zi4SkcJEyYDlQ=
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5XGlZg0i3lkPPOGATuJ+Wnaq7eo2AUkmHHBy5l8lAclmA==
Z3rpw/TJyI7TqsD7Oden5geWW+DLlHfODocgQ+862CEBPRQ7Q5RL7SlGjq5Uhv4iH/zwGKVmEclJJkuGn2PSr50rqoAQCkHpnAcAn54gejGUUNfR0aQBDCtrQgcOFN0oZS2cETOMilbdcoK6I09++ae9qXYvNACq/1bPoSmOTIg=
- snMqv5HNfETjzpgWgcZQbPdObAmcqOQ6Bzia8dNT3oRauNWtADT7xZ5kKo7YvKNlkpvfMu3myge/gPNLDTkvFBDyeG1nXIh7DE/L411z4D4ECIbBs6qVnB134VjHJQFAFY0xfosEFLMT3eT4JSjxBvOoOihW4gnvvDJ083jsOSQthSp4rPTRIVucKsrQZSC7+/vR/1jtfLl7+TFGSAUC8giKEqkQLbz5tgwrI1bBfyPnKk+3OzQBjGfPLYOIXOuZhZpjKmpLBa3T9QDZgD53BVdHbtgpNnTPqOGKsHO38LsQPCqCOpttcspSqAadPxY+idpqHTmcK0IXfteHHgIInSle7XZfj9A1XO9XOr+bUP5Rqixd382nQNQJDhP/5cyF
--no-inline-config 示例
npx eslint --no-inline-config file.js
--report-unused-disable-directives
I0AqyZFNg+F4SCGAdESwjnUgHe/N5QcSSm6ioIz/N4Cj+Pi1H98Sr8lvrBs6mqPXuZaDB5vhzVCU8Tndj5VCzF+JIQtpdK7Vk4cM4RFiPgLjCp6vJP7mxSuB4skVwpLy5V4AgbTt8t/bH7+ZwC1TBaTSvPwnR/u2wowRWYpWDj1hVVzugLRdjfo4w5w2CPC3
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5XGlZg0i3lkPPOGATuJ+Wnaq7eo2AUkmHHBy5l8lAclmA==
sPXRSKyi9+fsbiDRXIyoKrKeVzzzlkBEBrWvVZPv0+sAVgLWiLmCOMo6qlFDzOWK1cY6eSOTFJLIswuo7rLhboQA4ps9Tk/7X28KU/7G7dh9bBqJBMOmXB4sHJz01E16re16Usam1OIcm9xXTfjr6TMAbyzrYBrnRmxcpSBJBmE=
7NMhyfB0nBVE8AKFCqo/ag==
kHwo3he8INDNCw78Uzos9FjjiPYgD+nSVR1BDLgOPfRK98tTCkvVuECCPn5NkZLPuPiTPsgw/N8jUxQNnv5EheG8GU1hRWy3AqPsp5iqEcmRfyMWPFZAM6aXaiuq1w8Akzo4ilF5sq/dSYY43ftfiQ==
IDN4ANdkc71RN++qcmfQsg6rJChkpvf0Ktu80F+fNWwAxTnum4J5yFgDc9HvQWzBzfFjxtwLaJO3uAhLAG21G3p3RVPDzgPOb0leyW/vA5WmxEi13iMVbDCJNGgh22wSiWCh0MTIQjvex7XR8V3PEWaxZ4jFf0l2MF4qsEuf1+I8o8uUE5wb0XCjHbhIBgdcenkjpnQvXwu1qcociFLQcreT5QM9t8NOc9hC2wZbnF60mC2akRHImjcgLVp9+EeLzGf3OTtn+prHeBKYo+LgUj4qTfh4S2LrymYZcDys4e/Uf0X+qkrN4eg/Dh4fKBKhUxENdvj0VZAqFsMFEIc3xUeOY4wSwRFwV6yollcTJ48MlI0/Tg5oowKOzDTpEnLKmZGDGQRR7V+E5LBVLjXHXWbZ58h8aoGBO/M9zhXvlVGaqAZQSHkG27H2TKg3AavLzFsn/Qr1uxaDWI6HYXoVW3PwU4QieqdRJx5wEEqjPWD2uwP3spNyqiAZUyYNElkvPRbAX83XehzvdUWcleE35+qLKDI7+cHWnLDK7nvLRRBfsAZvWbhCJkfWea7wUWJK
--report-unused-disable-directives 示例
npx eslint --report-unused-disable-directives file.js
缓存
--cache
NAB0Apn6Q19JkSvhhAEuLx46Se2si0kd1ib6VHffK74elop3MMfhOdn2WsriOLrLv9J7HvQZ2JlX3u7irwuXlwwQVYOUQeSoYiV9C0K14ht+7RAAFSG3OuRGEz8eL87XAu9raH7eYRmgR3fkg5yasPru/FMyUjTicoOLwYzfGHIJsiSSHBOR3mHcPHuDvEgmWvEBGN6VEiGitcQxkufYdvQ0tNALT3vkFl+w6j/+GsYHu3iMNh9EYbHZ5P157ZBNYbirqGpwxsNQQABz0IxHB6TnDJYodn7TmmQUxn4b/MoBMIiB5p8UyurBOmiLfisx
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5XGlZg0i3lkPPOGATuJ+Wnaq7eo2AUkmHHBy5l8lAclmA==
pGkETXeCWCd9N46OaFh6atAixtj8KwMl0KQXvqnvGuuY8xvCcjDr68WDlrt80ZTk8ii+C/PbcF0tATzvuzyaJUus/mwt+pBSOQmRkwNy1mL7r2yrA7edY+raaqAnyPbc81ybQs1y+kAd6KM7VEFq4GKZYcb3STWLn2Z7VIvquj9Uen/IkN+GZ/50He7eCNyCqlcMNSH95ViRtARlGEVYAStBKMvfT99Q3TWMTBVRRL7l56Mz83Jj/KD+kcc3KzKGnRjqjh+vBTUBX2Yr3C/eNQcGvp63Qo3WEWEk3bL+olTsvQe85rJ6UPWjRV7m8NWaUFHA635M21WiN4bALN/g//RK5B1HypTmzm3X0oiT8sNpyA5p7WsKfEftW5y0OeDMgQ5YbUY7yT2aSoatU46KGHG2SpHGRM5StEEXNazj0rXGjN1C8/m/r/Z9sXBjXPRgPF6xy3uZZFZZ69hz6AH3VbTWilwVSTEOEA9lBaqbwShauFgDjK7Q/kjap1/J/T4G
OMrvSAgTRd7QeY0gp6Ph/TSbUha5Q11lR28ejbIpfR4QVhMicut2rf8ZsQx3D53fTfra7xLzwKmnBtU7ElSjTohqYgLdXGhPAbmysY8wibf6/Btv+Qkwu0uVSG7GhMiccJXSXwJ91261mB9irJh4eQ==
--cache 示例
npx eslint --cache file.js
--cache-file
h3t70vQS2gbDdBDa/PI48iXjzaV27ZNWV8zZpvRrOrRnarOJOfOw1cjWBiU15B1/eAz18Y/RLznP/NvaU4NguFzEG3qjk81817LxhYp0JJc=
fbceu0483JQmktdrklLhk9UwzW9SMGETLYrsIv5K5iWSd9SRsm7YzDO68rfO3omPwFbyalRmvnJ9wwy4cmnYJskupRcPk00jgDqQcv4n66v2vwlcKsMohfO5+u30MuAqai1J5LN7DA22PTuwpH4nf92kw1R0/Z19NZItDLXYuB3CvCivMdXaZqHuIpXOsvEGkZQH3khlqeAOu07V8JCacQ==
--cache-location
Zw5wwTlYjFu0KDC4xNrBrrHZWiQjWBplUkbtuZs1cnZxIcDiuUxWEIGnW9VrYBfInVDwBIEjTeZSFY9lNdlHQg==
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5X5KqqHWbxplsW7zTZEl7uicsivD+F/cFfi3gvLNFEjVC+ktBE/9YdPWNB0TsllHXW+fvJDAaAwWB33Au764qicuG4h6e8NRpesPvKAEYNj4BvI15Dp3YgV1HY0lOabZIJ3j2euebjyxhf4eDv1DPkOK58udV0TfFH709TR1jtm0L9D+MNWjZfHT89X4WA4m/V/gv71CvwxIAxJOtaqSafIvbsD680AdmWQqp/l10fYLKD6HRD7HT3ctC2XBw40GGF7oVBQndi0Isks4zfqdwMSOMzOmG6WwOlWZq1njKje6++BnZXsO5wQWt2HrmPBT99nvklFXoFG2EWVMqQhC39mhtOSlzl38U/HSvRUZn07qhv21RrUnvDdSFvcbq6YKKob+Rf1uXpFTNyZug8qZOe7mT7INVInxqN5QBdssRhI6n2qpsEduuqTLR8HHlD0qge+dKnLm6ZFa+Lluv5IWlJCNJP/kLGeDxYFWNQP2StQecN1V+S/HwD7kc59k3odxyZAD7nH6MsiPHOZjYe6H5KxGu5krr6sAks7JcnsXot28DHrjrxuBZ1C1HeV4i7wI11tfZXa08ZPD+Fue6UEeMYk
i6J2GOMcx2mtUogbqNUFYJ4H5N0FW0/++YwQjKiFxy22kFLmtsPxQEjEnTJFiVx0f2NzysotI7aSWqDG/gxtJkxJXI0vHPr2HFeAz8JgcmZEfY++xirzj+iow0ljDW4YwR+cdxCG8XbtlVwVYrxXw/NyUXn8+6BoSYoKzdR5fKB8tHtA/fOMdt0ZU0CH2M3olrQkGRaM+vmpIeCHt7RqH0wHXKBy5wkWdgej/pk8pRQ=
--cache-location 示例
npx eslint "src/**/*.js" --cache --cache-location "/Users/user/.eslintcache/"
--cache-strategy
bs6PGjADmLJOw4GuJEi+X/hrAyE9O/RIRT7snAR6s4/XKpk+2/4ySwIfgudPTpCX
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5X5KqqHWbxplsW7zTZEl7uiA9dCs1K8ev9w9H398gXpuKg88tnTWDfFdSN2kmpog4ol8k1UM8t1JlAdo8Qe5KTpzoBc555RfdBAb4stSMrgpzOooJlaluwCWDbm3KDLSMknEzARYlYC64Ef+/APu1eir44sXhFyloj88MaSUJRheXcm/Zd8oroGHLWIaA6nu0ucVYHXQfXDn2XGiBj8P/farqx65pGTnVONCmdpg9rH4PXVZHZWU55QAQJdPOiRcLWiU5+zFltSOm4x+u7PCUBho6We6C/NR4brIQuVT1hs7w==
We2CwkMcaa3ugwANM4jn4r+fwmQDoBKahT10GUX4c0rBi53j2s018PxOn0Ij7jdFMXUrA+BaZeleO5IEqThtBKQXiJrnc4/1ICD1fW8hmklvV/quWK38+eWx3LNNiujSKYUm/1I/QVr96RvPKzpVtt+FRc8EvhCjShs1R31pN6/PCu+ie21SiQz8/6cdrOvWspGiU3w7LEBIn4jKspawsiteGhBadAh1+Nqr20n+4UCr3wBXs2k8kkIzSJvsJ5BQ48IrN1BwL9bA6WCGy82G6zq8znsd3Lj2wOAQs+5DX2tbcc6IzZAk33hCc3YY3dLy
--cache-strategy 示例
npx eslint "src/**/*.js" --cache --cache-strategy content
其他
--init
7huKgmgl7KlykAQgHlZSzqwg4tdLljHInv5ZRs8qyBa1yASyNCN7yuPbA5FMmkyYuLVpuCWyE0Zl2cYb/XT6VuVQa+PoRCZKpStECLy/z2fxgSIcwPNHGEZ9lKj1RShYHE/JlSWYZlvKIVnpa3c+RGLqzby2WJtpcqJVukawNwBZM7KkKoe9rvEJ+vzJzQPgwQe4Tyx9Exi8L09VQvoq13FrcoS3gNNWMO9MHAJstyqU9iML8Cc7XLD3v+61g0koAzoK6Qdi6Igc60XumUmvbg9Le7kkk1gfvB5dLf6a5W1tWEEIVQu8wEEq1gCm2J9d
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5XGlZg0i3lkPPOGATuJ+Wnaq7eo2AUkmHHBy5l8lAclmA==
Zr77UGgWZjSpOHMWfdaUo4oOq3LEAV9KVvtJVGVMNjXxl7Y+xB1yFRotnHkThX9IkYZSGMZm+HIYLpGTWfBFbA==
--init 示例
npx eslint --init
--env-info
ByDcGh9NOP0IN5ag6s5LcPE6mxVXafYiVrVXPGI8YjaMMzakv0VNkQIxUDKgwzGObJo4U/g+iLlRZdjpODbSknqHWRIjsBsS5CkQGFlsTpFMt4ecBRo4R1TfqV5RmfYEYSmrjUNhh+qNWhFqqS+UsBkAb7ER5Lw3KO3GoXHPSy4=
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5XGlZg0i3lkPPOGATuJ+Wnaq7eo2AUkmHHBy5l8lAclmA==
4GYCICX/ZDSf5Cj5MPVLNrCnDB0BG+bSnN6waV4v0mgJow5yRR/o4mxPST+MauZvcMGNlwG2YULid34XR34d59+oe3wsphgF+TG9g2F9PEMC/U1Qed6vAqBDk9O5p2p5XCtHZqZcUAg4YF8du4M5Bl5+qFWmdL5RMv+s+SlmgBY=
--env-info 示例
npx eslint --env-info
--no-error-on-unmatched-pattern
dXSqFls+t7nuN07zbdKkK/dSMRy4a/Xi5AnUu9AKq+ShpaPLi0rap0Dj0CAQN5Z7sUMakIjyVmTqXbd+H1zAirz0OkU5RjnHTtC5KMrYW4lRgHuUrBkAwVX7ySSZHm77quTToeaa/GPEWuyym9myUSMs/HzNcNZ3+7QsbPzFXl6f5wBKY/MtXeGGHJtCiPNkI7m3HGWpMOwWFRPh6XFcaA==
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5XGlZg0i3lkPPOGATuJ+Wnaq7eo2AUkmHHBy5l8lAclmA==
--no-error-on-unmatched-pattern 示例
npx eslint --no-error-on-unmatched-pattern --ext .ts "lib/*"
--exit-on-fatal-error
vgCvK64Lc9AU/T//nCM5kg5tvo/OCB6y8EJwKiy4pxYErM0yjb1ECxTx+dzPmQHmUN+NqCBQQizQKFSbY0pSbOmIesxsSjw4B90KOCtnnJoSs69oYxERpjmDsyRGLtGqYSoprs9DFT0mJzERRdgPWQBc6qZEXXpB3YiGXaslpHKGZyXYBKIBV6hDM65zSBoMYE1mqPmtUa5TP35ZA6ZNRDfIdrjFKQZv8JVSoaC9XWjj3MeSEcCMcKWd9hA2wWao
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5XGlZg0i3lkPPOGATuJ+Wnaq7eo2AUkmHHBy5l8lAclmA==
--exit-on-fatal-error 示例
npx eslint --exit-on-fatal-error file.js
--debug
H+GDLNELOJ7uMdzQf7c8NZc1FgYOyGfS2gAYH1xdRICyvXuDnFMlAQridufgKvG4QeWY9bxUDaxZ5sH5uWrZmwKR04CdhRWNRehYm7ac/Wq/1u2HePd4oTWB5qEHfVRVwCO6pUaMtzTCH0+trtJh6U1hjE99Sog3euJ52zdqSAEHCJeJ/3Mi8oNOgk5vBalHKgFzYevG++B4DrDEW2R28g==
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5XGlZg0i3lkPPOGATuJ+Wnaq7eo2AUkmHHBy5l8lAclmA==
xzToVtqi4mjIw59KI/ZnJbnrGfK0fcRLH4Dcdn7lLg7kT1dLdARqTKCdd0vFvt7irIR4PxRXqL8uRDSxiG8xyxV6T36ZhjwfcrymuKCDJXpD9wMRbrWQqqVkvQ1LKFXPtfFfK2qHExpAOKLHMApwsE2BK/INUKQdgz0hLxZfwTf09/nK4AzNrbkP1kJi1YW5
--debug 示例
npx eslint --debug test.js
-h、--help
oS9PNHgZeR62wkZ7ltrARZSWHalUKGItl4HPQ9lk2PMRNnEZuFQ9gHH9xuiJW6qi6ice7/LebcQGmLSZPgbj5N6NSAN7pmV9JqA2vrqHO9izRkV15EPCnU0PcaaB+Fj0fHKqvex2qgTLWs8IDY8EQfqmSHXn2Nd7PlnhpZWpRsWhZ81O0swou/BR20sUAywt0i3PK909CsSGHfMvqu4gdaTt7GUUGAmnsjweq+mfiAk=
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5XGlZg0i3lkPPOGATuJ+Wnaq7eo2AUkmHHBy5l8lAclmA==
-h、--help 示例
npx eslint --help
-v、--version
eJiyGkGoMRCqYjkGL0G8IZOn2Ac8Uc7hrf5mE5NSgKFDMROT3mtuGY09uTmDhww985z8HxPjZBgYeX/dt93l4lEzFURYiaFvTYOTtGqx0E69jq3/FnRDdMqfdJ1475Rb1+79ZDbDy3UINSHfge7DjfExldaXbpou4sCr4YdhBGKnnF01AxekXQEOaqRLDwazovXLBs7PfqZG9Y6h7s2bJCeEXkg0yocrhRrJhcY6qiU=
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5XGlZg0i3lkPPOGATuJ+Wnaq7eo2AUkmHHBy5l8lAclmA==
-v、--version 示例
npx eslint --version
--print-config
E7M83getH/ZxdvLMZuCGfGLsrm/78eEcfR0ER7HXY8UCJJwlp918rot2yc/1JKOFMKkABw7rKyKFs4dFbi1GFH17jNEcOIpBmK8NqAZF7BBfhA5D4MtS878pdexIx3MKaA323a/g+Dc80TQ4rSM0iiNg97rRWSuzWf273M4bzP4h8LYziOreTyV1GdqECgFuhjEN+8OjGEw5hVKuGIbbiaFPNcIPBDV37eKKyWgub0tb5R+6XUHILU8nL2BCeGzs
- emMzfg0hP6rX5B4TaMmkktuWQZUZvpMXim34OmaOu5X5KqqHWbxplsW7zTZEl7ui/YsiPh4nCOdjxXdsiuTAMkdH2JG2aG5WbONyKBqJ4aDkZCGNvcpiNaqXlAaCvMKIj94TQGtQnPayhMU9Fi6GBX9WesloTNLQKGwVcNhXpN8=
--print-config 示例
npx eslint --print-config file.js
退出代码
xAtCETYIx6OdgAjQqPlVj7+PSby0pndvdkJiibpoDpVLHzSSnQw8S6Gue34IkvOFVgDcKTI47rJmc6bWA2jbLqaWRpmUPiF3FgXUITmOUEw=
- iSBJXIIB5rZijGur719wEOZJ65b26oCcI+8aIMc9VgMYbhlZ+hyzHYQNrm8jI/wftHtkkX3441zijVcOzRRHkVzYQQEclwM60MDpeM6WfEulpLP0h5BeUWfTtbxXVFfiEswKVLExhXR0SmI8RjLel992yJCuAGIKMZ9+7ZI4B7igA1jU62FkOgu+AeL0kQoHrMGOnDBN1jhLd3cq80XTaD9t3hBzptpSsfLnDVREpiyxHpZtRCIez9+TcaZpaC+hBOIfTZ3rsQElNm8oxhf2hB36juaf+1QWrPv2L4/x2OUyUBgv5hXzVwKem63aFiD163HCnDu9ErohC0jDaWoLjQUF/L8yh7B06og4KSMKItIqgPxIa8e8GXwCoR8V7qXAiJry3jxiSjHCWDk5Uvp7Kh88CfcU01PchqiZTEcd8iMN0EGVG0MxUuIfz9TJpbySpxif2YeviV7BUCKvHIneSzP1aD9kod/Dl3jWKdp4Rx4OuGmyLdnGPkpqSMOzEQHwZwIOf2QzWlSWwypUYhb9+JNRXxzuP8DNmGLLZQv0A+M5MolhZHdwj551FeRCxA5PPkU/LXlhOyW2bOFCLFruX/MRiCjsvLid7j/1DEmqJsRdZmKv3maWdjSbV1h01Bxmnm7d7LDj7J2vWEaKd/8C7w==