Skip to content

Commit 68e952d

Browse files
committed
Add config description for the suppression property
1 parent 3255a75 commit 68e952d

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

packages/code-analyzer-core/src/config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,12 @@ export class CodeAnalyzerConfig {
227227
valueType: 'object',
228228
defaultValue: { files: [] },
229229
wasSuppliedByUser: !deepEquals(this.config.ignores, DEFAULT_CONFIG.ignores)
230+
},
231+
suppressions: {
232+
descriptionText: getMessage('ConfigFieldDescription_suppressions'),
233+
valueType: 'object',
234+
defaultValue: { disable_suppressions: false },
235+
wasSuppliedByUser: !deepEquals(this.config.suppressions, DEFAULT_CONFIG.suppressions)
230236
}
231237
}
232238
};
@@ -260,6 +266,13 @@ export class CodeAnalyzerConfig {
260266
return !this.config.suppressions.disable_suppressions;
261267
}
262268

269+
/**
270+
* Returns the suppressions configuration object.
271+
*/
272+
public getSuppressions(): Suppressions {
273+
return this.config.suppressions;
274+
}
275+
263276
/**
264277
* Returns the absolute path folder where all path based values within the configuration may be relative to.
265278
* Typically, this is set as the folder where a configuration file was loaded from, but doesn't have to be.

packages/code-analyzer-core/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export type {
88
EngineOverrides,
99
Ignores,
1010
RuleOverrides,
11-
RuleOverride
11+
RuleOverride,
12+
Suppressions
1213
} from "./config"
1314

1415

packages/code-analyzer-core/src/messages.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ const MESSAGE_CATALOG : MessageCatalog = {
6161
` - "**/*.test.js"\n` +
6262
`-------------------------------------------`,
6363

64+
ConfigFieldDescription_suppressions:
65+
`Configuration for inline suppression markers in source code.\n` +
66+
` disable_suppressions: Boolean to disable processing of suppression markers.\n` +
67+
`---- [Example usage]: ---------------------\n` +
68+
`suppressions:\n` +
69+
` disable_suppressions: false\n` +
70+
`-------------------------------------------`,
71+
6472
GenericEngineConfigOverview:
6573
`%s ENGINE CONFIGURATION`,
6674

0 commit comments

Comments
 (0)