Skip to main content

Rule overrides

The overrides option lets you modify individual ESLint rules within a config block without losing the rest of the defaults.

How it works

Overrides are merged on top of uglier's default rules using a shallow merge. You can change severity, disable rules, or adjust rule options.

Examples

Disable a rule

uglify({
with: ["lints-js"],
options: {
"lints-js": {
overrides: {
"no-console": "off",
},
},
},
})

Change severity

uglify({
with: ["lints-js"],
options: {
"lints-js": {
overrides: {
"@stylistic/max-len": ["warn", {code: 120}],
},
},
},
})

Override JSDoc rules

uglify({
with: ["lints-jsdoc"],
options: {
"lints-jsdoc": {
overrides: {
"jsdoc/require-description": "warn",
"jsdoc/require-param-type": "off",
},
},
},
})

What you can override

Any ESLint rule that the config block sets. Check the individual config block docs for the full list of default rules.