Skip to main 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.

Structure

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.

Common options

Most config blocks accept these shared options:

files

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

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

ignores

An array of glob patterns specifying which files to exclude.

ignores: ["src/generated/**", "dist/**"]

Config-specific options

lints-js

OptionTypeDefaultDescription
indentnumber2Spaces per indent level
maxLennumber80Max line length
overridesobject{}ESLint rule overrides

lints-jsdoc

OptionTypeDefaultDescription
overridesobject{}JSDoc rule overrides

languageOptions

OptionTypeDefaultDescription
ecmaVersionnumber | string"latest"ECMAScript version
sourceTypestring"module"Module type
additionalGlobalsobject{}Extra globals

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

OptionTypeDefaultDescription
additionalGlobalsobject{}Extra globals