Skip to content

Commit

Permalink
Switch to change-case (#591)
Browse files Browse the repository at this point in the history
* chore(deps): Bump no-case from 3.0.4 to 4.0.0

Bumps [no-case](https://github.com/blakeembrey/change-case) from 3.0.4 to 4.0.0.
- [Release notes](https://github.com/blakeembrey/change-case/releases)
- [Commits](https://github.com/blakeembrey/change-case/compare/[email protected]@4.0.0)

---
updated-dependencies:
- dependency-name: no-case
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore: switch to change-case

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
bmish and dependabot[bot] authored Dec 12, 2024
1 parent 4201320 commit d998fe2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 25 deletions.
9 changes: 5 additions & 4 deletions lib/rule-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { EMOJIS_TYPE } from './rule-type.js';
import { hasOptions } from './rule-options.js';
import { getLinkToRule } from './rule-link.js';
import { capitalizeOnlyFirstLetter, 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 @@ -370,9 +370,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
28 changes: 8 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"@typescript-eslint/utils": "^8.0.0",
"ajv": "^8.11.2",
"boolean": "^3.2.0",
"change-case": "^5.0.0",
"commander": "^12.1.0",
"cosmiconfig": "^9.0.0",
"deepmerge": "^4.2.2",
Expand All @@ -56,7 +57,6 @@
"json-schema": "^0.4.0",
"json-schema-traverse": "^1.0.0",
"markdown-table": "^3.0.3",
"no-case": "^3.0.4",
"type-fest": "^4.0.0"
},
"devDependencies": {
Expand Down

0 comments on commit d998fe2

Please sign in to comment.