Skip to content

Options

Every config block in uglier can be customized through the options object. This lets you keep the opinionated defaults where they make sense and override where they don’t.

import uglify from "@gesslar/uglier"
export default [
...uglify({
with: ["lints-js", "lints-jsdoc", "node"],
options: {
"lints-js": {
indent: 4,
maxLen: 120,
},
"lints-jsdoc": {
ignores: ["tests/**"],
},
node: {
files: ["src/**/*.js", "scripts/**/*.js"],
},
},
})
]

The options object is keyed by config name. Each key accepts the options specific to that config block.

Most config blocks accept these shared options:

An array of glob patterns specifying which files the config applies to.

files: ["src/**/*.js", "lib/**/*.js"]

An array of glob patterns specifying which files to exclude.

ignores: ["src/generated/**", "dist/**"]
OptionTypeDefaultDescription
indentnumber2Spaces per indent level
maxLennumber80Max line length
overridesobject{}ESLint rule overrides
OptionTypeDefaultDescription
overridesobject{}JSDoc rule overrides
OptionTypeDefaultDescription
ecmaVersionnumber | string"latest"ECMAScript version
sourceTypestring"module"Module type
additionalGlobalsobject{}Extra globals

Environment configs (node, web, react, tauri, vscode-extension)

Section titled “Environment configs (node, web, react, tauri, vscode-extension)”
OptionTypeDefaultDescription
additionalGlobalsobject{}Extra globals