Skip to content

Commit

Permalink
Use string union types instead of enums for better TypeScript compati…
Browse files Browse the repository at this point in the history
…bility with config file type (#322)
  • Loading branch information
bmish authored Dec 1, 2022
1 parent b14b63b commit 564d012
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
Original file line number Diff line number Diff line change
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?: readonly `${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?: readonly `${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
Original file line number Diff line number Diff line change
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 564d012

Please sign in to comment.