QUICK-LINT-JS(1)
๐ quick-lint-js(1) โ find bugs in JavaScript programs ๐โจ
okay bestie, so this is quick-lint-js, and the manual name is QUICK-LINT-JS(1) in case you were wondering ๐ซถ she's a linter, she finds bugs, she's iconic, periodt.
โจ SYNOPSIS โจ
quick-lint-js [--output-format=format] [<options>] file [file...]
quick-lint-js --lsp-server [<options>]
quick-lint-js --debug-apps
quick-lint-js --help
quick-lint-js --version
๐ธ DESCRIPTION ๐ธ
So quick-lint-js literally reads your JavaScript files and reports syntax errors and other bugs. that's the whole vibe. no cap, that's it. ๐ฅ
This command has three modes, bestie:
quick-lint-js [<options>] file [file...] : Batch mode (default). Check the given files, and report errors to the terminal (standard error). --output-format can be used to customize how errors look.
quick-lint-js --lsp-server : LSP server mode. Use this mode to integrate with code editors supporting LSP. For more information, see quick-lint-js-lsp(8).
quick-lint-js --debug-apps, quick-lint-js --help, quick-lint-js --version : Information mode. Prints information about quick-lint-js then exits.
๐ OPTIONS ๐
--output-format=formatโ customize how errors are printed. format is one of these lil cuties:gnu-like(default): a human-readable format similar to GCC.vim-qflist-json: machine-readable JSON which can be given to Vim'ssetqflistfunction.emacs-lisp: Emacs Lisp association list format.
๐ซ Incompatible with --lsp-server.
--diagnostic-hyperlinks=whenโ control whether to hyperlink error codes or not. This option is only used if--output-format=gnu-like. when is one of the following:auto(default): shows error codes as hyperlinks only if the error output is a terminal. On Windows it behaves like'never'.always: always shows error codes as hyperlinks.never: never shows error codes as hyperlinks.
๐ซ Incompatible with --lsp-server.
Added in quick-lint-js version 0.7.0.
--vim-file-bufnr=numberโ set thebufnrproperty for errors printed with the--output-format=vim-qflist-jsonoption.
--vim-file-bufnr applies only to the next input file given in the command line. Therefore, if multiple input files are given, --vim-file-bufnr can be specified multiple times. iykyk ๐
--path-for-config-search=pathโ for the following input file or--stdin, use path as the file's path when searching for a configuration file (seequick-lint-js.config(5)).
path must be a syntactically-valid path. path does not need to exist in the filesystem. wild, I know.
--path-for-config-search applies only to the next input file given in the command line. Therefore, if multiple input files are given, --path-for-config-search can be specified multiple times. If --path-for-config-search is the last option, it has no effect. ๐ญ
--path-for-config-search overrides --stdin-path.
๐ซ Incompatible with --lsp-server.
Added in quick-lint-js version 0.4.0.
--stdin-path=pathโ change the behavior of--stdin.--stdinstill reads a string from standard input, but otherwise it behaves as if the file at path was specified instead:- The default language is determined by path (unless overridden by
--language). See--languagefor details. - Searching for a configuration file is based on path (unless overridden by
--config-fileor--path-for-config-file). (Seequick-lint-js.config(5)for details on configuration file searching.)
- The default language is determined by path (unless overridden by
--stdin-path applies to only --stdin, not file paths (even special files such as /dev/stdin). rude but okay ๐
--stdin-path may appear anywhere in the command line (except after --).
path must be a syntactically-valid path. path does not need to exist in the filesystem. path may be a relative path or an absolute path. slay ๐
๐ซ Incompatible with --lsp-server.
Added in quick-lint-js version 2.17.0.
--config-file=fileโ read configuration options from file and apply them to input files which are given later in the command line. Seequick-lint-js.config(5)for the format of configuration files.
If --config-file is given twice, then the file for the first --config-file option applies only to the input files between the two --config-file options, and the file for the second --config-file option applies only to the input files after the second --config-file option. See the EXAMPLE section for an example. ๐
If --config-file is not given, quick-lint-js searches for a configuration file according to the rules specified in quick-lint-js.config(5).
--config-file overrides --path-for-config-file and --stdin-path.
๐ซ Incompatible with --lsp-server.
Added in quick-lint-js version 0.3.0.
--language=languageidโ interpret input files which are given later in the command line as if they were written in languageid. languageid is one of the following:default(default): infer the languageid from the file's extension:.js:javascript-jsx.jsx:javascript-jsx.d.ts:typescript-definition.ts:typescript.tsx:typescript-jsx- (anything else):
javascript-jsx
javascript: the latest ECMAScript standard with proposed features.javascript-jsx: likejavascriptbut with JSX (React) extensions.typescript: the latest TypeScript version.typescript-definition: the latest TypeScript version (.d.tsfile).typescript-jsx: liketypescriptbut with JSX (React) extensions.
If --language is given twice, then the languageid for the first --language option applies only to the input files between the two --language options, and the languageid for the second --language option applies only to the input files after the second --language option. See the EXAMPLE section for an example.
If --language is the last option, it has no effect. ๐
If the input file is --stdin:
- If
--stdin-pathis specified, its path is used for--language=default. - If
--stdin-pathis not specified, then the path is assumed to beexample.js. This means that--language=defaultwill behave like--language=javascript-jsx.
๐ซ Incompatible with --lsp-server.
Added in quick-lint-js version 2.10.0.
--exit-fail-on=errorsโ cause quick-lint-js to exit with a non-zero exit code if any of the discovered errors is listed in errors.
See the ERROR LISTS section for a description of the format for errors.
๐ซ Incompatible with --lsp-server.
--stdinโ read standard input as an input file.
If none of --config-file, --path-for-config-search, or --stdin-path are specified, an empty configuration file is assumed. If --config-file is specified, file is used for linting standard input. If --config-file is not specified and either --stdin-path or --path-for-config-search is specified, quick-lint-js searches for a configuration file according to the rules specified in quick-lint-js.config(5) starting from --stdin-path's path or --path-for-config-search's path.
If neither --stdin-path nor --language are specified, the javascript-jsx language is used.
๐ซ Incompatible with --lsp-server.
Added in quick-lint-js version 0.3.0.
--lsp,--lsp-serverโ run quick-lint-js in LSP server mode. Use this mode to integrate with code editors supporting LSP. For more information, seequick-lint-js-lsp(8).
๐ซ Incompatible with --output-format.
--snarkyโ add spice to your failures. ๐ถ๏ธ This option makes error messages more interesting.
Added in quick-lint-js version 2.5.0.
-h,--helpโ print a help message and exit.
The output format is not intended to be machine-parsable and may change in the future. (so don't @ her with your regex parser bestie ๐ญ)
--debug-appsโ print a list of running quick-lint-js instances which have the debug app enabled.
The output format is not intended to be machine-parsable and may change in the future.
--debug-apps is only supported on Linux, macOS, and Windows. ๐ป
-v,--versionโ print version information and exit.
The output format is not intended to be machine-parsable and may change in the future.
๐ฆ ERROR LISTS ๐ฆ
Some options, such as --exit-fail-on, accept an error list. An error list is a comma-separated list of error code predicates and error category predicates. so many predicates, it's giving grammar class ngl ๐
An error list can contain any number of include, exclude, and default predicates. An include predicate is a '+' followed by the name of an error code or error category. An exclude predicate is a '-' followed by the name of an error code or error category. A default predicate is the name of an error code or error category with no sigil. no sigil, no drama ๐
An error list containing only include and exclude predicates modifies a default set of error codes. The default set is decided by the option, but is often the set of all error codes. An error list containing at least one default predicate empties the set of error codes, then treats the default predicates as if they were include predicates. ๐ฎ
The order of predicates within an error list does not matter. Included predicates are processed first, adding to the set of error codes. Excluded predicates are processed second, removing from the set of error codes. ok so order doesn't matter but processing order does, make it make sense ๐
Error codes have the form E0000, where 0000 is four decimal digits (0-9).
The following error categories are supported:
allโ all error codes. every single one. ๐
Example error lists ๐
E0102,E0110โ only error codesE0102andE0110, excluding all other error codes.-E0102โ the default set of error codes, except for error codeE0102.+E0102โ the default set of error codes, and also error codeE0102.all,-E0102โ all error codes, except for error codeE0102.E0100,-E0100,+E0200โ only error codeE0200, excluding all other error codes.+E0200,-E0100,E0100โ only error codeE0200, excluding all other error codes.
โญ EXIT STATUS โญ
0โ main character behavior, honestly:- Batch mode: Linting succeeded with no errors or warnings. ๐
- LSP server mode: The LSP client requested that the server shut down. This exit status may change in the future.
non-0โ the not-so-slay outcome:- Batch mode: Linting failed with at least one error or warning, or at least one file could not be opened and read. ๐ญ
- The specific status code may change in the future.
๐ ENVIRONMENT ๐
LC_ALL,LC_MESSAGESโ change the language used for error and warning messages. For example, setLC_ALL=ento see messages written in United States English. ๐ฃ๏ธ
okay that's part 1, bestie โ the rest is coming, don't move ๐
๐ธ EXAMPLE ๐ธ
Okay bestie, this is the part where it all clicks. Real commands, real vibes. Let's go ๐
โจ lint one file, messages to your terminal โจ
Say you've got a file called lib/index.js and you just want the tea spilled straight into your terminal:
$ quick-lint-js lib/index.js
lib/index.js:1:20: error: variable used before declaration: language [E0058]
lib/index.js:2:7: note: variable declared here [E0058]
lib/index.js:3:1: error: assignment to const variable [E0003]
lib/index.js:1:7: note: const variable declared here [E0003]
lib/index.js:5:25: warning: use of undeclared variable: ocupation [E0057]
Look at that. error, note, warning โ the whole emotional spectrum in one run ๐ญ And yeah, ocupation is literally misspelled in the example. That's the whole point, bestie โ it's the undeclared variable. Don't come for it ๐
โจ three files, machine-readable, straight into a json file โจ
Now the glow-up: lint three files at once and write machine-readable messages to /tmp/vim-qflist.json:
$ quick-lint-js --output-format=vim-qflist-json \
--vim-bufnr=3 lib/pizza-dough.js \
--vim-bufnr=4 lib/pizza-sauce.js \
--vim-bufnr=6 lib/pineapple.js \
>/tmp/vim-qflist.json
Notice how each file gets its own --vim-bufnr? That's the pairing, periodt. Errors for lib/pizza-dough.js will include "bufnr":3 in the output and errors for lib/pineapple.js will include "bufnr":6. So your editor knows exactly which buffer to point at ๐ฏ (And yes, pineapple on pizza is a whole debate โ not our problem today ๐)
โจ lint it, but don't fail on one specific thing โจ
Here's the mood: you want to lint bad.js but you do not want to fail on use-of-undeclared-variable errors. So you negate the code with a minus sign:
$ quick-lint-js --exit-fail-on=-E0057 bad.js
bad.js:5:25: warning: use of undeclared variable: $ [E0057]
$ echo $?
0
See that? The warning still shows up in the output, but $? comes back as 0. So the lint runs, you see the message, but the exit status doesn't scream at you. Iconic behavior, honestly ๐
โจ different config files for different files โจ
Source files get the strict config, test files get the lax one. As they should ๐
$ quick-lint-js \
--config-file strict-quick-lint-js.config src/index.js src/helpers.js \
--config-file lax-quick-lint-js.config test/test-app.js
Each --config-file applies to the files that follow it. Strict for src/index.js and src/helpers.js, lax for test/test-app.js. Balanced. Responsible. Main character energy ๐
โจ linting a temp file with your project's config โจ
Got some unsaved buffer in /tmp and you still want your project's config to apply? Say less:
$ quick-lint-js --path-for-config-search=src/server.js /tmp/unsaved12m1uz.js
/tmp/unsaved12m1uz.js:12:5: warning: use of undeclared variable: document [E0057]
You're linting /tmp/unsaved12m1uz.js, but --path-for-config-search=src/server.js makes it search for the config as if the file lived at that path. Sneaky? A little. Useful? Extremely ๐ซถ
โจ .js as JavaScript, .jsx as JavaScript+JSX โจ
Two --language flags, two globs, zero chaos:
$ quick-lint-js \
--language javascript *.js \
--language javascript-jsx *.jsx
The first --language applies to the *.js files, the second applies to the *.jsx files. It's giving organized. It's giving understood the assignment ๐
โจ linting standard input โจ
Last one, and it's a lil magic trick โ read from stdin:
$ quick-lint-js --language javascript --stdin
Pipe something in, get lint results out. No file needed. Chef's kiss ๐ง
๐ SEE ALSO ๐
Go read these next, bestie, they're the supporting cast:
eslint(1)quick-lint-js.config(5)โ the config file lore lives here ๐
Okay that's the whole page!! You made it to the end, I'm so proud of you ๐ญ๐ This was quick-lint-js version 3.2.0, served up in the QUICK-LINT-JS(1) section of the manual. Go forth and lint, my love โ no cap, you're gonna slay โจ๐ฆ๐
๐ฆ where this page comes from
- alpine 3.24: quick-lint-js-doc 3.2.0-r1 ยท GPL-3.0-or-later
- nixos 26.05: quick-lint-js 3.2.0
- nixpkgs unstable: quick-lint-js 3.2.0
- Copyright (C) 2020 Matthew "strager" Glazar
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms