Skip to main content

lints-js

See the source

The core stylistic config block. This is where the magic happens — all formatting rules in one composable unit.

What it enforces

RuleDefault
SemicolonsNone (ASI)
QuotesDouble
Indent2 spaces
Arrow parensAs needed
Brace style1TBS
Keyword spacingNo space after if, for, while, etc.
Object spacingNo internal spaces: {a: 1}
Blank linesRequired after control statements
Max line length80 characters
Trailing commasNone
ConsoleWarn

Default file patterns

["src/**/*.{js,mjs,cjs}"]

Options

uglify({
with: ["lints-js"],
options: {
"lints-js": {
files: ["src/**/*.js", "lib/**/*.js"],
ignores: ["src/generated/**"],
indent: 4,
maxLen: 120,
overrides: {
"no-console": "off",
},
},
},
})

files

Array of glob patterns for files this config applies to.

ignores

Array of glob patterns for files to exclude.

indent

Number of spaces for indentation. Default: 2.

maxLen

Maximum line length. Default: 80.

overrides

An object of ESLint rule overrides. These are merged on top of the default rules, so you can tweak individual rules without losing the rest.