QUICK-LINT-JS.CONFIG(5)
π NAME π
quick-lint-js.config is the configuration file for *quick-lint-js*(1) β and yes bestie, this is the QUICK-LINT-JS.CONFIG(5) manual page, so you are in exactly the right place. π
π SYNOPSIS π
quick-lint-js.config
πΈ DESCRIPTION πΈ
Okay so the whole vibe is this: the quick-lint-js(1) program, and also quick-lint-js editor plugins, can be configured using a quick-lint-js.config file. Thatβs the main character energy of this page. π«Ά
π FILES π
quick-lint-js uses the following algorithm to find its configuration:
- If the input JavaScript file has no path (e.g. if its contents are given using standard input (
--stdin) and the--path-for-config-searchoption is not used), assume no configuration file and stop. - Compute the absolute canonical path of the input JavaScript file by joining the JavaScript fileβs given path with the current working directory, following all symbolic links, and resolving all
.and..components. (If the--path-for-config-searchoption was used, compute its absolute canonical path.) - Check if the absolute canonical path computed in step 2 exists.
- If the path exists, remove the last component of the path. Remember this path as the current directory.
- If the path does not exist, remove the last component of the path repeatedly until the path exists. If no checked path exists (for example, if a path with a non-existent drive was given), assume no configuration file and stop. Remember this path as the current directory.
- Look for a configuration file in the current directory:
- Check if the file
quick-lint-js.configexists. If so, use it as the configuration file and stop. - Go to step 5.
- Check if the file
- If the current directory is a filesystem root, assume no configuration file and stop.
- Remove the last component of the current directory.
- Go to step 4.
In short, quick-lint-js looks for quick-lint-js.config in ancestor directories. π₯
If no configuration file is found, quick-lint-js behaves as if a quick-lint-js.config file was found with contents {}.
In addition to the above search algorithm, the --config-file command-line option can be given to quick-lint-js(1).
π§Ύ FORMAT π§Ύ
quick-lint-js.config files contain UTF-8-encoded JSON (per RFC 8259). The top-level object contains quick-lint-js configuration properties. A quick-lint-js.config file with no configuration looks like this:
{}
quick-lint-js.config files do not support a dedicated comment syntax β so no sneaky comments, bestie. π
β¨ OPTIONS β¨
The quick-lint-js configuration object can contain one or more of the following keys:
globalsβ Optional. Global variables which programs can use.globalsis an object. Its format is described in the GLOBALS section below. π«Άglobal-groupsβ Optional. Pre-defined categories of global variables which programs can use.global-groupsis either an array or a boolean.- If
global-groupsistrueor not present, then itβs as if the value was an array of all possible group names, except forliterally-anything. - If
global-groupsisfalseor an empty array, then no global variables are defined aside from those listed in theglobalsconfiguration property. - If
global-groupsis a non-empty array, then global variables are defined per the given group names. Each group name is a string. For the list of group names, see the GLOBAL GROUPS section.
- If
jsx-modeβ Optional. How to lint intrinsic JSX elements.jsx-modeis a string. Possible values are as follows:"auto"(default): Determine the JSX flavor automatically using various heuristics. See the JSX linting documentation athttps://quick-lint-js.com/errors/jsx/#autofor more information about these heuristics."react": Assume that JSX is intended for the React.js framework."none": Disable all framework-specific JSX linting rules.
See the JSX linting documentation at https://quick-lint-js.com/errors/jsx/ for more information on which rules are configured by jsx-mode.
Introduced in quick-lint-js version 3.1.0. β¨
π GLOBALS π
The globals configuration property tells quick-lint-js what global variables to assume exist.
If the global variables you want are from a popular platform or library, you might want to use global-groups instead.
Each property in the globals configuration property represents a single global variable. The propertyβs key is the JavaScript variable name. The propertyβs value can be either true, false, or an object:
- If the value is
true, then the variable is defined as if the propertyβs value was{}. - If the value is
false, then the variable is not defined, even if a group listed inglobal-groupswould otherwise define the variable. - If the value is an object, then the variable is defined with attributes according to the object:
shadowable: Optional. Iftrueor not present, the variable can be redefined in the programβs outer-most scope. Iffalse, the variable cannot be redefined in the programβs outer-most scope.writable: Optional. Iftrueor not present, the variable can be assigned to. Iffalse, the variable cannot be assigned to.
JSON Unicode escapes ("\u0068ello") are allowed in the variable name. JavaScript Unicode escapes ("\\u{68}llo") are not allowed in the variable name. π
π GLOBAL GROUPS π
The following groups are supported for the global-groups configuration property:
literally-anythingβ all possible global variables. All global variables are defined asshadowableandwritable. This in effect suppresses E0002, E0033, E0057, E0059, or E0214 entirely (except if variables are also configured using theglobalsconfiguration property). This group is not enabled by default.browserβ globals defined in HTML and DOM standards, includingwindow,alert, andconsole. This group is enabled by default.bunβ globals defined by the Bun JavaScript runtime, includingBun,fetch, andconsole. This group is enabled by default.denoβ globals defined by the Deno JavaScript runtime, includingDeno,fetch, andconsole. This group is enabled by default. (Introduced in version 2.13.0.)ecmascriptβ globals defined by the latest ECMAScript (JavaScript) standard, includingObjectandNaN. This group is enabled by default.jasmineβ globals defined by the Jasmine test framework, includingdescribe,it, andexpect. This group is enabled by default.jestβ globals defined by the Jest test framework, includingdescribe,test, andexpect. This group is enabled by default.jqueryβ globals defined by the jQuery library, including$. This group is enabled by default.node.jsβ globals defined by Node.js for CommonJS modules, includingrequire,console, and__dirname. This group is enabled by default.node.js-esβ globals defined by Node.js for ES modules, includingconsoleandprocess. This group is enabled by default.typescriptβ global types defined by TypeScript, includingReadonlyandNonNullable. This group is enabled by default. (Introduced in version 2.12.0.)quickjsβ globals defined by QuickJS, includingconsoleandscriptArgs. This group is enabled by default. (Introduced in version 2.11.0.)web-workerβ globals defined in HTML standards for dedicated Web Workers, includingpostMessage,self, andconsole. This group is enabled by default. (Introduced in version 2.6.0.)
π EXAMPLES π
Imagine we have a browser-only application. Its tests are written using the Jest testing framework. It uses the Google Maps libraries, which are exposed using the google global variable. Such an application might have the following quick-lint-js.config file:
{
"global-groups": ["browser", "ecmascript", "jest"],
"globals": {
"google": {"writable": false}
}
}
If you want to suppress E0002, E0033, E0057, E0059, or E0214, configure globals or global-groups. For example, if youβre seeing a spurious warning E0057 "use of undeclared variable: MyLibrary" (false positive), use the following configuration in quick-lint-js.config:
{
"globals": {
"MyLibrary": true
}
}
If you are not seeing E0002, E0033, E0057, E0059, or E0214 (false negative), but you want to see E0057 "use of undeclared variable: $", use one of the following configuration in quick-lint-js.config:
{
"globals": {
"$": false
}
}
Alternatively, suppress the jquery globals group (which defines $ as a global variable) by enabling only the environments you use in your project with this quick-lint-js.config:
{
"global-groups": ["ecmascript", "node.js"]
}
π«Ά SEE ALSO π«Ά
quick-lint-js(1) β thatβs the one, bestie. β¨
mwah β quick-lint-js version 3.2.0, QUICK-LINT-JS.CONFIG(5), signing off π«Άπ
π¦ 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