.\" Code generated by docs/man/generate-man-pages. DO NOT EDIT. .\" source: docs/*.adoc . .\" Copyright (C) 2020 Matthew "strager" Glazar .\" See end of file for extended copyright information. . .\" Manual page for the 'man' utility. . . '\" t .\" Title: quick-lint-js .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.17 .\" Manual: \ \& .\" Source: quick-lint-js version 3.2.0 .\" Language: English .\" .TH "QUICK\-LINT\-JS" "1" "" "quick\-lint\-js version 3.2.0" "\ \&" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" quick-lint-js \- find bugs in JavaScript programs .SH "SYNOPSIS" .sp \fBquick\-lint\-js\fP [\fB\-\-output\-format\fP=\fIformat\fP] [<options>] \fIfile\fP [\fIfile\fP...] .br \fBquick\-lint\-js\fP \fB\-\-lsp\-server\fP [<options>] .br \fBquick\-lint\-js\fP \fB\-\-debug\-apps\fP .br \fBquick\-lint\-js\fP \fB\-\-help\fP .br \fBquick\-lint\-js\fP \fB\-\-version\fP .SH "DESCRIPTION" .sp \fBquick\-lint\-js\fP reads JavaScript files and reports syntax errors and other bugs. .sp This command has three modes: .sp \fBquick\-lint\-js\fP [<options>] \fIfile\fP [\fIfile\fP...] .RS 4 Batch mode (default). Check the given files, and report errors to the terminal (standard error). \fB\-\-output\-format\fP can be used to customize how errors look. .RE .sp \fBquick\-lint\-js\fP \-\-lsp\-server .RS 4 LSP server mode. Use this mode to integrate with code editors supporting LSP. For more information, see \fBquick\-lint\-js\-lsp\fP(8). .RE .sp \fBquick\-lint\-js\fP \-\-debug\-apps, \fBquick\-lint\-js\fP \-\-help, \fBquick\-lint\-js\fP \-\-version .RS 4 Information mode. Prints information about quick\-lint\-js then exits. .RE .SH "OPTIONS" .sp \fB\-\-output\-format\fP=\fIformat\fP .RS 4 Customize how errors are printed. \fIformat\fP is one of the following: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fBgnu\-like\fP (default): a human\-readable format similar to GCC. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fBvim\-qflist\-json\fP: machine\-readable JSON which can be given to Vim\(cqs \fIsetqflist\fP function. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fBemacs\-lisp\fP: Emacs Lisp association list format. .RE .sp Incompatible with \fB\-\-lsp\-server\fP. .RE .sp \fB\-\-diagnostic\-hyperlinks\fP=\fIwhen\fP .RS 4 Control whether to hyperlink error codes or not. This option is only used if \fB\-\-output\-format=gnu\-like\fP. \fIwhen\fP is one of the following: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fBauto\fP (default): shows error codes as hyperlinks only if the error output is a terminal. On Windows it behaves like \*(Aqnever\*(Aq. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fBalways\fP: always shows error codes as hyperlinks. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fBnever\fP: never shows error codes as hyperlinks. .RE .sp Incompatible with \fB\-\-lsp\-server\fP. .sp Added in quick\-lint\-js version 0.7.0. .RE .sp \fB\-\-vim\-file\-bufnr\fP=\fInumber\fP .RS 4 Set the \fIbufnr\fP property for errors printed with the \fB\-\-output\-format=vim\-qflist\-json\fP option. .sp \fB\-\-vim\-file\-bufnr\fP applies only to the next input file given in the command line. Therefore, if multiple input files are given, \fB\-\-vim\-file\-bufnr\fP can be specified multiple times. .RE .sp \fB\-\-path\-for\-config\-search\fP=\fIpath\fP .RS 4 For the following input file or \fB\-\-stdin\fP, use \fIpath\fP as the file\(cqs path when searching for a configuration file (see \fBquick\-lint\-js.config\fP(5)). .sp \fIpath\fP must be a syntactically\-valid path. \fIpath\fP does not need to exist in the filesystem. .sp \fB\-\-path\-for\-config\-search\fP applies only to the next input file given in the command line. Therefore, if multiple input files are given, \fB\-\-path\-for\-config\-search\fP can be specified multiple times. If \fB\-\-path\-for\-config\-search\fP is the last option, it has no effect. .sp \fB\-\-path\-for\-config\-search\fP overrides \fB\-\-stdin\-path\fP. .sp Incompatible with \fB\-\-lsp\-server\fP. .sp Added in quick\-lint\-js version 0.4.0. .RE .sp \fB\-\-stdin\-path\fP=\fIpath\fP .RS 4 Change the behavior of \fB\-\-stdin\fP. \fB\-\-stdin\fP still reads a string from standard input, but otherwise it behaves as if the file at \fIpath\fP was specified instead: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} The default language is determined by \fIpath\fP (unless overridden by \fB\-\-language\fP). See \fB\-\-language\fP for details. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} Searching for a configuration file is based on \fIpath\fP (unless overridden by \fB\-\-config\-file\fP or \fB\-\-path\-for\-config\-file\fP). (See \fBquick\-lint\-js.config\fP(5) for details on configuration file searching.) .RE .sp \fB\-\-stdin\-path\fP applies to only \fB\-\-stdin\fP, not file paths (even special files such as /dev/stdin). .sp \fB\-\-stdin\-path\fP may appear anywhere in the command line (except after \fB\-\-\fP). .sp \fIpath\fP must be a syntactically\-valid path. \fIpath\fP does not need to exist in the filesystem. \fIpath\fP may be a relative path or an absolute path. .sp Incompatible with \fB\-\-lsp\-server\fP. .sp Added in quick\-lint\-js version 2.17.0. .RE .sp \fB\-\-config\-file\fP=\fIfile\fP .RS 4 Read configuration options from \fIfile\fP and apply them to input files which are given later in the command line. See \fBquick\-lint\-js.config\fP(5) for the format of configuration files. .sp If \fB\-\-config\-file\fP is given twice, then the \fIfile\fP for the first \fB\-\-config\-file\fP option applies only to the input files between the two \fB\-\-config\-file\fP options, and the \fIfile\fP for the second \fB\-\-config\-file\fP option apples only to the input files after the second \fB\-\-config\-file\fP option. See the EXAMPLE section for an example. .sp If \fB\-\-config\-file\fP is not given, \fBquick\-lint\-js\fP searches for a configuration file according to the rules specified in \fBquick\-lint\-js.config\fP(5). .sp \fB\-\-config\-file\fP overrides \fB\-\-path\-for\-config\-file\fP and \fB\-\-stdin\-path\fP. .sp Incompatible with \fB\-\-lsp\-server\fP. .sp Added in quick\-lint\-js version 0.3.0. .RE .sp \fB\-\-language\fP=\fIlanguageid\fP .RS 4 Interpret input files which are given later in the command line as if they were written in \fIlanguageid\fP. \fIlanguageid\fP is one of the following: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fBdefault\fP (default): infer the \fIlanguageid\fP from the file\(cqs extension: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fB.js\fP: \fBjavascript\-jsx\fP .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fB.jsx\fP: \fBjavascript\-jsx\fP .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fB.d.ts\fP: \fBtypescript\-definition\fP .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fB.ts\fP: \fBtypescript\fP .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fB.tsx\fP: \fBtypescript\-jsx\fP .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} (anything else): \fBjavascript\-jsx\fP .RE .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fBjavascript\fP: the latest ECMAScript standard with proposed features. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fBjavascript\-jsx\fP: like \fBjavascript\fP but with JSX (React) extensions. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fBtypescript\fP: the latest TypeScript version. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fBtypescript\-definition\fP: the latest TypeScript version (.d.ts file). .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fBtypescript\-jsx\fP: like \fBtypescript\fP but with JSX (React) extensions. .RE .sp If \fB\-\-language\fP is given twice, then the \fIlanguageid\fP for the first \fB\-\-language\fP option applies only to the input files between the two \fB\-\-language\fP options, and the \fIlanguageid\fP for the second \fB\-\-language\fP option apples only to the input files after the second \fB\-\-language\fP option. See the EXAMPLE section for an example. .sp If \fB\-\-language\fP is the last option, it has no effect. .sp If the input file is \fB\-\-stdin\fP: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} If \fB\-\-stdin\-path\fP is specified, its \fIpath\fP is used for \fB\-\-language=default\fP. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} If \fB\-\-stdin\-path\fP is not specified, then the path is assumed to be \fBexample.js\fP. This means that \fB\-\-language=default\fP will behave like \fB\-\-language=javascript\-jsx\fP. .RE .sp Incompatible with \fB\-\-lsp\-server\fP. .sp Added in quick\-lint\-js version 2.10.0. .RE .sp \fB\-\-exit\-fail\-on\fP=\fIerrors\fP .RS 4 Cause \fBquick\-lint\-js\fP to exit with a non\-zero exit code if any of the discovered errors is listed in \fIerrors\fP. .sp See the ERROR LISTS section for a description of the format for \fIerrors\fP. .sp Incompatible with \fB\-\-lsp\-server\fP. .RE .sp \fB\-\-stdin\fP .RS 4 Read standard input as an input file. .sp If none of \fB\-\-config\-file\fP, \fB\-\-path\-for\-config\-search\fP, or \fB\-\-stdin\-path\fP are specified, an empty configuration file is assumed. If \fB\-\-config\-file\fP is specified, \fIfile\fP is used for linting standard input. If \fB\-\-config\-file\fP is not specified and either \fB\-\-stdin\-path\fP or \fB\-\-path\-for\-config\-search\fP is specified, \fBquick\-lint\-js\fP searches for a configuration file according to the rules specified in \fBquick\-lint\-js.config\fP(5) starting from \fB\-\-stdin\-path\fP\*(Aqs \fIpath\fP or \fB\-\-path\-for\-config\-search\fP\*(Aqs \fIpath\fP. .sp If neither \fB\-\-stdin\-path\fP nor \fB\-\-language\fP are specified, the \fBjavascript\-jsx\fP language is used. .sp Incompatible with \fB\-\-lsp\-server\fP. .sp Added in quick\-lint\-js version 0.3.0. .RE .sp \fB\-\-lsp\fP, \fB\-\-lsp\-server\fP .RS 4 Run \fBquick\-lint\-js\fP in LSP server mode. Use this mode to integrate with code editors supporting LSP. For more information, see \fBquick\-lint\-js\-lsp\fP(8). .sp Incompatible with \fB\-\-output\-format\fP. .RE .sp \fB\-\-snarky\fP .RS 4 Add spice to your failures. This option makes error messages more interesting. .sp Added in quick\-lint\-js version 2.5.0. .RE .sp \fB\-h\fP, \fB\-\-help\fP .RS 4 Print a help message and exit. .sp The output format is not intended to be machine\-parsable and may change in the future. .RE .sp \fB\-\-debug\-apps\fP .RS 4 Print a list of running quick\-lint\-js instances which have the debug app enabled. .sp The output format is not intended to be machine\-parsable and may change in the future. .sp \fB\-\-debug\-apps\fP is only supported on Linux, macOS, and Windows. .RE .sp \fB\-v\fP, \fB\-\-version\fP .RS 4 Print version information and exit. .sp The output format is not intended to be machine\-parsable and may change in the future. .RE .SH "ERROR LISTS" .sp Some options, such as \fB\-\-exit\-fail\-on\fP, accept an error list. An error list is a comma\-separated list of error code predicates and error category predicates. .sp An error lists can contain any number of include, exclude, and default predicates. An include predicate is a \*(Aq+\*(Aq followed by the name of an error code or error category. An exclude predicate is a \*(Aq\-\*(Aq followed by the name of an error code or error category. An default predicate is the name of an error code or error category with no sigil. .sp 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. .sp 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. .sp Error codes have the form \fBE0000\fP, where \fI0000\fP is four decimal digits (0\-9). .sp The following error categories are supported: .sp \fBall\fP .RS 4 All error codes. .RE .sp Example error lists: .sp \fBE0102,E0110\fP .RS 4 Only error codes E0102 and E0110, excluding all other error codes. .RE .sp \fB\-E0102\fP .RS 4 The default set of error codes, except for error code E0102. .RE .sp \fB+E0102\fP .RS 4 The default set of error codes, and also error code E0102. .RE .sp \fBall,\-E0102\fP .RS 4 All error codes, except for error code E0102. .RE .sp \fBE0100,\-E0100,+E0200\fP .RS 4 Only error code E0200, excluding all other error codes. .RE .sp \fB+E0200,\-E0100,E0100\fP .RS 4 Only error code E0200, excluding all other error codes. .RE .SH "EXIT STATUS" .sp \fB0\fP .RS 4 Batch mode: Linting succeeded with no errors or warnings. .sp LSP server mode: The LSP client requested that the server shut down. This exit status may change in the future. .RE .sp \fBnon\-0\fP .RS 4 Batch mode: Linting failed with at least one error or warning, or at least one \fIfile\fP could not be opened and read. .sp The specific status code may change in the future. .RE .SH "ENVIRONMENT" .sp \fBLC_ALL\fP, \fBLC_MESSAGES\fP .RS 4 Change the language used for error and warning messages. For example, set \fBLC_ALL=en\fP to see messages written in United States English. .RE .SH "EXAMPLE" .sp To lint a file called \fIlib/index.js\fP, writing error messages to the terminal: .RS 3 .ll -.6i .sp .if n .RS 4 .nf .fam C $ \fBquick\-lint\-js\fP 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] .fam .fi .if n .RE .br .RE .ll .sp To lint three files, writing machine\-readable messages to \fI/tmp/vim\-qflist.json\fP: .RS 3 .ll -.6i .sp .if n .RS 4 .nf .fam C $ \fBquick\-lint\-js\fP \-\-output\-format=vim\-qflist\-json \(rs \-\-vim\-bufnr=3 lib/pizza\-dough.js \(rs \-\-vim\-bufnr=4 lib/pizza\-sauce.js \(rs \-\-vim\-bufnr=6 lib/pineapple.js \(rs >/tmp/vim\-qflist.json .fam .fi .if n .RE .br .RE .ll .sp Errors for \fIlib/pizza\-dough.js\fP will include \fI"bufnr":3\fP in the output and errors for \fIlib/pineapple.js\fP will include \fI"bufnr":6\fP. .sp To lint a file called \fIbad.js\fP, but don\(cqt fail on use\-of\-undeclared\-variable errors: .RS 3 .ll -.6i .sp .if n .RS 4 .nf .fam C $ \fBquick\-lint\-js\fP \-\-exit\-fail\-on=\-E0057 bad.js bad.js:5:25: warning: use of undeclared variable: $ [E0057] $ echo $? 0 .fam .fi .if n .RE .br .RE .ll .sp To lint source files with a strict configuration file and lint test files with a lax configuration file: .RS 3 .ll -.6i .sp .if n .RS 4 .nf .fam C $ \fBquick\-lint\-js\fP \(rs \-\-config\-file strict\-quick\-lint\-js.config src/index.js src/helpers.js \(rs \-\-config\-file lax\-quick\-lint\-js.config test/test\-app.js .fam .fi .if n .RE .br .RE .ll .sp To lint a temporary file, but use the configuration file of a project: .RS 3 .ll -.6i .sp .if n .RS 4 .nf .fam C $ \fBquick\-lint\-js\fP \-\-path\-for\-config\-search=src/server.js /tmp/unsaved12m1uz.js /tmp/unsaved12m1uz.js:12:5: warning: use of undeclared variable: document [E0057] .fam .fi .if n .RE .br .RE .ll .sp To lint \fI.js\fP files as JavaScript, and \fI.jsx\fP files as JavaScript+JSX: .RS 3 .ll -.6i .sp .if n .RS 4 .nf .fam C $ \fBquick\-lint\-js\fP \(rs \-\-language javascript *.js \(rs \-\-language javascript\-jsx *.jsx .fam .fi .if n .RE .br .RE .ll .sp To lint standard input as JavaScript: .RS 3 .ll -.6i .sp .if n .RS 4 .nf .fam C $ \fBquick\-lint\-js\fP \-\-language javascript \-\-stdin .fam .fi .if n .RE .br .RE .ll .SH "SEE ALSO" .sp \fBeslint\fP(1) \fBquick\-lint\-js.config\fP(5) .\" quick-lint-js finds bugs in JavaScript programs. .\" Copyright (C) 2020 Matthew "strager" Glazar .\" .\" This file is part of quick-lint-js. .\" .\" quick-lint-js is free software: you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation, either version 3 of the License, or .\" (at your option) any later version. .\" .\" quick-lint-js is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with quick-lint-js. If not, see <https://www.gnu.org/licenses/>.