Skip to content

Commit

Permalink
Replace rome with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
pedsmoreira committed Jan 13, 2024
1 parent f497048 commit e55f398
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 86 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"build": "tsup --entry.casex src/casex.ts --dts --format esm --minify",
"build:watch": "yarn build --watch",
"typecheck": "tsc --noEmit src/casex.ts",
"format": "rome format src --write",
"lint": "rome check src",
"format": "prettier ./src/**/* --write",
"test": "vitest",
"postversion": "git push && git push --tags",
"ci:check": "yarn check",
Expand All @@ -37,7 +36,7 @@
"version": "yarn build && git add package.json"
},
"devDependencies": {
"rome": "^11.0.0",
"prettier": "^3.2.1",
"tsup": "^6.5.0",
"typescript": "^4.9.4",
"vitest": "^0.28.4"
Expand Down
9 changes: 0 additions & 9 deletions rome.json

This file was deleted.

12 changes: 6 additions & 6 deletions src/_internal/casex-letter-case.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
interface CasexLetterCaseArgs {
text: string;
letter: string;
text: string;
letter: string;
}

export function casexLetterCase({ text, letter }: CasexLetterCaseArgs): string {
if (letter === "-") return "";
if (letter === "*") return text;
if (letter === "-") return "";
if (letter === "*") return text;

const isUpperCase = letter === letter.toUpperCase();
return isUpperCase ? text.toUpperCase() : text.toLowerCase();
const isUpperCase = letter === letter.toUpperCase();
return isUpperCase ? text.toUpperCase() : text.toLowerCase();
}
8 changes: 4 additions & 4 deletions src/_internal/casex-pattern-from-string.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { CasexPattern } from "../types";

export function casexPatternFromString(pattern: string): CasexPattern {
const firstSyllable = pattern.substring(0, 2);
const glue = pattern.substring(2, pattern.length - 2);
const secondSyllable = pattern.substring(pattern.length - 2);
const firstSyllable = pattern.substring(0, 2);
const glue = pattern.substring(2, pattern.length - 2);
const secondSyllable = pattern.substring(pattern.length - 2);

return { firstSyllable, glue, secondSyllable };
return { firstSyllable, glue, secondSyllable };
}
16 changes: 8 additions & 8 deletions src/_internal/casex-syllable-case.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { casexLetterCase } from "./casex-letter-case";

interface CasexSyllableCaseArgs {
text: string;
syllable: string;
text: string;
syllable: string;
}

export function casexSyllableCase({
text,
syllable,
text,
syllable,
}: CasexSyllableCaseArgs): string {
return (
casexLetterCase({ text: text[0], letter: syllable[0] }) +
casexLetterCase({ text: text.substring(1), letter: syllable[1] })
);
return (
casexLetterCase({ text: text[0], letter: syllable[0] }) +
casexLetterCase({ text: text.substring(1), letter: syllable[1] })
);
}
22 changes: 11 additions & 11 deletions src/_internal/split-with-delimiters.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
const DELIMITERS = "A-Z\\s_-";

interface SplitWithDelimitersArgs {
text: string;
delimiters?: string;
text: string;
delimiters?: string;
}

export function splitWithDelimiters({
text,
delimiters,
text,
delimiters,
}: SplitWithDelimitersArgs): string[] {
const regex = new RegExp(
// rome-ignore lint/style/useTemplate: <explanation>
"([A-Z]?)([^" + (delimiters || DELIMITERS) + "]*)",
"g",
);
const regex = new RegExp(
// rome-ignore lint/style/useTemplate: <explanation>
"([A-Z]?)([^" + (delimiters || DELIMITERS) + "]*)",
"g",
);

const matches = text.match(regex) || [];
return matches.filter(Boolean);
const matches = text.match(regex) || [];
return matches.filter(Boolean);
}
6 changes: 3 additions & 3 deletions src/types/casex-pattern.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface CasexPattern {
readonly firstSyllable: string;
readonly glue: string;
readonly secondSyllable: string;
readonly firstSyllable: string;
readonly glue: string;
readonly secondSyllable: string;
}
47 changes: 5 additions & 42 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -143,36 +143,6 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@rometools/cli-darwin-arm64@11.0.0":
version "11.0.0"
resolved "https://registry.yarnpkg.com/@rometools/cli-darwin-arm64/-/cli-darwin-arm64-11.0.0.tgz#8f916df0580fede2325434a50ed5b1f2cf972696"
integrity sha512-F3vkdY+s3FLIEnAjSbyHTuIPB88cLpccimW4ecid5I7S6GzGG3iUJI4xT00JhH73K4P/qW20/9r+kH1T9Du8Xg==

"@rometools/cli-darwin-x64@11.0.0":
version "11.0.0"
resolved "https://registry.yarnpkg.com/@rometools/cli-darwin-x64/-/cli-darwin-x64-11.0.0.tgz#1393a5bba26e8c5352737270a1a98f2759f40d14"
integrity sha512-X6jhtS6Iml4GOzgNtnLwIp/KXXhSdqeVyfv69m/AHnIzx3gQAjPZ7BPnJLvTCbhe4SKHL+uTZYFSCJpkUUKE6w==

"@rometools/cli-linux-arm64@11.0.0":
version "11.0.0"
resolved "https://registry.yarnpkg.com/@rometools/cli-linux-arm64/-/cli-linux-arm64-11.0.0.tgz#efbfd36013455fc5d940b24b1b195a43aba87bcb"
integrity sha512-dktTJJlTpmycBZ2TwhJBcAO8ztK8DdevdyZnFFxdYRvtmJgTjIsC2UFayf/SbKew8B8q1IhI0it+D6ihAeIpeg==

"@rometools/cli-linux-x64@11.0.0":
version "11.0.0"
resolved "https://registry.yarnpkg.com/@rometools/cli-linux-x64/-/cli-linux-x64-11.0.0.tgz#675532d9f603b88ab0686da800ec711b45d22085"
integrity sha512-WVcnXPNdWGUWo0p4NU8YzuthjYR7q+b4vRcjdxtP1DlpphZmSsoC/RSE85nEqRAz8hChcKUansVzOPM8BSsuGA==

"@rometools/cli-win32-arm64@11.0.0":
version "11.0.0"
resolved "https://registry.yarnpkg.com/@rometools/cli-win32-arm64/-/cli-win32-arm64-11.0.0.tgz#4d50f446acf2bc126cb58b5cff5a4d53b7c6a378"
integrity sha512-tPj6RThQzS7Q45jqQll7NlTYvNcsg/BEP3LYiiazqSh9FAFnMkrV6ewUcMPKWyAfiyLs7jlz4rRvdNRUSygzfQ==

"@rometools/cli-win32-x64@11.0.0":
version "11.0.0"
resolved "https://registry.yarnpkg.com/@rometools/cli-win32-x64/-/cli-win32-x64-11.0.0.tgz#c6d48db5ea52b393dae7fe04bfe803ad8cee71a5"
integrity sha512-bmBai8WHxYjsGk1+je7ZTfCUCWq30WJI3pQM8pzTA674lfGTZ9ymJoZwTaIMSO4rL5V9mlO6uLunsBKso9VqOg==

"@types/chai-subset@^1.3.3":
version "1.3.3"
resolved "https://registry.yarnpkg.com/@types/chai-subset/-/chai-subset-1.3.3.tgz#97893814e92abd2c534de422cb377e0e0bdaac94"
Expand Down Expand Up @@ -955,6 +925,11 @@ postcss@^8.4.21:
picocolors "^1.0.0"
source-map-js "^1.0.2"

prettier@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.1.tgz#babf33580e16c796a9740b9fae551624f7bfeaab"
integrity sha512-qSUWshj1IobVbKc226Gw2pync27t0Kf0EdufZa9j7uBSJay1CC+B3K5lAAZoqgX3ASiKuWsk6OmzKRetXNObWg==

pretty-format@^27.5.1:
version "27.5.1"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e"
Expand Down Expand Up @@ -1019,18 +994,6 @@ rollup@^3.2.5:
optionalDependencies:
fsevents "~2.3.2"

rome@^11.0.0:
version "11.0.0"
resolved "https://registry.yarnpkg.com/rome/-/rome-11.0.0.tgz#cd2f00fadfd3611399eba9a2f87612e1f3299a23"
integrity sha512-rRo6JOwpMLc3OkeTDRXkrmrDqnxDvZ75GS4f0jLDBNmRgDXWbu0F8eVnJoRn+VbK2AE7vWvhVOMBjnWowcopkQ==
optionalDependencies:
"@rometools/cli-darwin-arm64" "11.0.0"
"@rometools/cli-darwin-x64" "11.0.0"
"@rometools/cli-linux-arm64" "11.0.0"
"@rometools/cli-linux-x64" "11.0.0"
"@rometools/cli-win32-arm64" "11.0.0"
"@rometools/cli-win32-x64" "11.0.0"

run-parallel@^1.1.9:
version "1.2.0"
resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee"
Expand Down

0 comments on commit e55f398

Please sign in to comment.