TSSLint supports a plugin system that allows you to rewrite rules on a per-file basis, filter diagnostics, and inject code fixes. You can use bundled plugins or build your own by implementing the Plugin type from @tsslint/types.
Bundled plugins include:
createIgnorePlugin: Handles tsslint-ignore [rule-id] comments (single-line or block-style *-start/*-end).createCategoryPlugin: Allows overriding the severity of rules based on pattern matching (e.g., setting all style/* rules to Warning).createDiagnosticsPlugin: Forwards TypeScript's own diagnostics (like semantic errors) through the TSSLint pipeline.
When using createDiagnosticsPlugin, it is recommended to wrap it in a check for isCLI() to avoid double-reporting errors in IDEs where ts-server already surfaces them.
import {
defineConfig,
createIgnorePlugin,
createCategoryPlugin,
createDiagnosticsPlugin,
isCLI,
} from '@tsslint/config';
import ts from 'typescript';
export default defineConfig({
rules: { /* ... */ },
plugins: [
// Handle tsslint-ignore [rule-id]
createIgnorePlugin('tsslint-ignore', /* report unused */ true),
// Override severity by rule-id pattern
createCategoryPlugin({
'style/*': ts.DiagnosticCategory.Warning,
}),
// Forward TypeScript's own diagnostics through the same pipeline.
...(isCLI() ? [createDiagnosticsPlugin('semantic')] : []),
],
});