Skip to content

Commit

Permalink
chore: run fmt, add prettier config
Browse files Browse the repository at this point in the history
Signed-off-by: rajput-hemant <rajput.hemant2001@gmail.com>
  • Loading branch information
rajput-hemant committed Dec 15, 2023
1 parent d0ce2e2 commit e8c99aa
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 15 deletions.
12 changes: 0 additions & 12 deletions advent-of-typescript/2023/day_1.ts
Original file line number Diff line number Diff line change
@@ -1,12 +0,0 @@
import { Expect, Equal } from "type-testing";

type test_0_actual = SantasFavoriteCookies;
// ^?
type test_0_expected = "ginger-bread" | "chocolate-chip";
type test_0 = Expect<Equal<test_0_actual, test_0_expected>>;

/* -----------------------------------------------------------------------------------------------
* Code Here
* -----------------------------------------------------------------------------------------------*/

type SantasFavoriteCookies = "ginger-bread" | "chocolate-chip";
51 changes: 51 additions & 0 deletions advent-of-typescript/2023/day_2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { Equal, Expect } from "type-testing";

/* -----------------------------------------------------------------------------------------------
* Code Here
* -----------------------------------------------------------------------------------------------*/

type CookieSurveyInput<T> = keyof T;

/* -----------------------------------------------------------------------------------------------
* Do Not Edit Below This Line
* -----------------------------------------------------------------------------------------------*/

const cookieInventory = {
chocolate: 1,
sugar: 20,
gingerBread: 10,
peanutButter: 30,
snickeDoodle: 73,
};
type test_cookies_actual = CookieSurveyInput<typeof cookieInventory>;
// ^?
type test_cookies_expected =
| "chocolate"
| "sugar"
| "gingerBread"
| "peanutButter"
| "snickeDoodle";
type test_cookies = Expect<Equal<test_cookies_actual, test_cookies_expected>>;

const unrelated = {
hi: 1,
hi2: 1,
hi3: 1,
hi4: 1,
hi5: 1,
hi6: 1,
hi7: 1,
};
type test_unrelated_actual = CookieSurveyInput<typeof unrelated>;
// ^?
type test_unrealted_expected =
| "hi"
| "hi2"
| "hi3"
| "hi4"
| "hi5"
| "hi6"
| "hi7";
type test_unrelated = Expect<
Equal<test_unrelated_actual, test_unrealted_expected>
>;
Binary file modified bun.lockb
Binary file not shown.
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"devDependencies": {
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@ianvs/prettier-plugin-sort-imports": "^4.1.1",
"bun-types": "latest",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
Expand All @@ -34,5 +35,26 @@
"extends": [
"@commitlint/config-conventional"
]
},
"prettier": {
"endOfLine": "lf",
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5",
"plugins": [
"@ianvs/prettier-plugin-sort-imports"
],
"importOrder": [
"<THIRD_PARTY_MODULES>",
"",
"^types$",
"^@/utils/(.*)$",
"^[./]"
],
"importOrderParserPlugins": [
"typescript",
"decorators-legacy"
]
}
}
4 changes: 1 addition & 3 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>rajput-hemant/renovate-config"
]
"extends": ["local>rajput-hemant/renovate-config"]
}

0 comments on commit e8c99aa

Please sign in to comment.