Skip to content

Commit

Permalink
Merge branch 'main' into pr/590
Browse files Browse the repository at this point in the history
* main:
  Switch to `change-case` (bmish#591)
  chore(deps-dev): Bump typescript-eslint from 8.17.0 to 8.18.0 (bmish#589)
  • Loading branch information
bmish committed Dec 12, 2024
2 parents e1b2d1a + d998fe2 commit da0a5bd
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 269 deletions.
9 changes: 5 additions & 4 deletions lib/rule-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import {
getEndOfLine,
sanitizeMarkdownTable,
} from './string.js';
import { noCase } from 'no-case';
import { noCase } from 'change-case';
import { getProperty } from 'dot-prop';
import { boolean, isBooleanable } from 'boolean';
import Ajv from 'ajv';
Expand Down Expand Up @@ -375,9 +375,10 @@ function getRulesAndHeadersForSplit(
if (!ruleListSplitFinalPart) {
throw new Error(`Invalid ruleListSplit value "${ruleListSplitItem}".`);
}
const ruleListSplitTitle = noCase(ruleListSplitFinalPart, {
transform: (str) => capitalizeOnlyFirstLetter(str),
});
const ruleListSplitTitle = noCase(ruleListSplitFinalPart)
.split(' ')
.map((word) => capitalizeOnlyFirstLetter(word))
.join(' ');

// Add a list for the rules with property set to this value.
rulesAndHeadersForThisSplit.push({
Expand Down
4 changes: 2 additions & 2 deletions lib/rule-options-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ function ruleOptionToColumnValues(ruleOption: RuleOption): {
? undefined
: Array.isArray(ruleOption.default)
? arrayToString(ruleOption.default)
: `\`${String(ruleOption.default)}\``,
: `\`${String(ruleOption.default)}\``, // eslint-disable-line @typescript-eslint/no-base-to-string
[COLUMN_TYPE.DEPRECATED]: ruleOption.deprecated ? 'Yes' : undefined,
[COLUMN_TYPE.DESCRIPTION]: ruleOption.description,
[COLUMN_TYPE.ENUM]:
ruleOption.enum && ruleOption.enum.length > 0
? `\`${ruleOption.enum.join('`, `')}\``
? `\`${ruleOption.enum.join('`, `')}\`` // eslint-disable-line @typescript-eslint/no-base-to-string
: undefined,
[COLUMN_TYPE.NAME]: `\`${ruleOption.name}\``,
[COLUMN_TYPE.REQUIRED]: ruleOption.required ? 'Yes' : undefined,
Expand Down
Loading

0 comments on commit da0a5bd

Please sign in to comment.