Skip to content

Commit

Permalink
fix: use string union types instead of enums for config file types
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed Dec 1, 2022
1 parent b14b63b commit 93ae3be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/types.ts
Expand Up @@ -143,7 +143,7 @@ export type GenerateOptions = {
* Choices: `configs`, `deprecated`, `fixable` (off by default), `fixableAndHasSuggestions`, `hasSuggestions` (off by default), `options` (off by default), `requiresTypeChecking`, `type` (off by default).
* Default: `['deprecated', 'configs', 'fixableAndHasSuggestions', 'requiresTypeChecking']`.
*/
readonly ruleDocNotices?: readonly NOTICE_TYPE[];
readonly ruleDocNotices?: `${NOTICE_TYPE}`[];
/** Disallowed sections in each rule doc. Exit with failure if present. */
readonly ruleDocSectionExclude?: readonly string[];
/** Required sections in each rule doc. Exit with failure if missing. */
Expand All @@ -158,7 +158,7 @@ export type GenerateOptions = {
* Choices: `configsError`, `configsOff`, `configsWarn`, `deprecated`, `description`, `fixable`, `fixableAndHasSuggestions` (off by default), `hasSuggestions`, `name`, `options` (off by default), `requiresTypeChecking`, `type` (off by default).
* Default: `['name', 'description', 'configsError', 'configsWarn', 'configsOff', 'fixable', 'hasSuggestions', 'requiresTypeChecking', 'deprecated']`.
*/
readonly ruleListColumns?: readonly COLUMN_TYPE[];
readonly ruleListColumns?: `${COLUMN_TYPE}`[];
/**
* Rule property to split the rules list by.
* A separate list and header will be created for each value.
Expand Down
2 changes: 0 additions & 2 deletions test/lib/generate/option-rule-doc-notices-test.ts
Expand Up @@ -174,9 +174,7 @@ describe('generate (--rule-doc-notices)', function () {
it('has no issues', async function () {
await expect(
generate('.', {
// @ts-expect-error -- testing string value instead of enum
ruleDocNotices: ['type'],
// @ts-expect-error -- testing string value instead of enum
ruleListColumns: ['name'],
})
).resolves.toBeUndefined();
Expand Down

0 comments on commit 93ae3be

Please sign in to comment.