Creating Preset
A preset is a JavaScript or JSON file that exports an configuration object.
- TypeScript
- JavaScript (ESM)
- JavaScript (CJS)
export default {
rules: {
"no-missing-namespace": { severity: "error" }
}
};
export default {
rules: {
"no-missing-namespace": { severity: "error" }
}
};
module.exports = {
rules: {
"no-missing-namespace": { severity: "error" }
}
};
You can use extends
in a preset. For example, you can create a preset based on the recommended preset.
- TypeScript
- JavaScript (ESM)
- JavaScript (CJS)
export default {
extends: ["@kosko/plugin-lint/presets/recommended"],
rules: {
"ban-image": {
severity: "error",
config: { images: ["*:latest"] }
}
}
};
export default {
extends: ["@kosko/plugin-lint/presets/recommended"],
rules: {
"ban-image": {
severity: "error",
config: { images: ["*:latest"] }
}
}
};
module.exports = {
extends: ["@kosko/plugin-lint/presets/recommended"],
rules: {
"ban-image": {
severity: "error",
config: { images: ["*:latest"] }
}
}
};