Skip to content

chore: update prettier to v3 #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 17 additions & 62 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"projectOwner": "LeDDGroup",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"files": ["README.md"],
"imageSize": 100,
"commit": true,
"commitConvention": "angular",
Expand All @@ -15,155 +13,112 @@
"name": "Daniel Perez Alvarez",
"avatar_url": "https://avatars2.githubusercontent.com/u/17787042?v=4",
"profile": "https://github.com/danielpza",
"contributions": [
"code",
"maintenance",
"test"
]
"contributions": ["code", "maintenance", "test"]
},
{
"login": "anion155",
"name": "Михайлов Антон",
"avatar_url": "https://avatars1.githubusercontent.com/u/4786672?v=4",
"profile": "https://github.com/anion155",
"contributions": [
"code",
"bug",
"test"
]
"contributions": ["code", "bug", "test"]
},
{
"login": "joshuaavalon",
"name": "Joshua Avalon",
"avatar_url": "https://avatars0.githubusercontent.com/u/7152420?v=4",
"profile": "https://joshuaavalon.io",
"contributions": [
"bug",
"platform"
]
"contributions": ["bug", "platform"]
},
{
"login": "roblav96",
"name": "Robert Laverty",
"avatar_url": "https://avatars1.githubusercontent.com/u/1457327?v=4",
"profile": "https://roblav96.github.io/resume",
"contributions": [
"bug",
"test"
]
"contributions": ["bug", "test"]
},
{
"login": "oleersoy",
"name": "Ole Ersoy",
"avatar_url": "https://avatars3.githubusercontent.com/u/1163873?v=4",
"profile": "https://github.com/oleersoy",
"contributions": [
"bug",
"blog"
]
"contributions": ["bug", "blog"]
},
{
"login": "sbmw",
"name": "sbmw",
"avatar_url": "https://avatars0.githubusercontent.com/u/30099628?v=4",
"profile": "https://github.com/sbmw",
"contributions": [
"bug"
]
"contributions": ["bug"]
},
{
"login": "richardspence",
"name": "richardspence",
"avatar_url": "https://avatars2.githubusercontent.com/u/9914123?v=4",
"profile": "https://github.com/richardspence",
"contributions": [
"bug"
]
"contributions": ["bug"]
},
{
"login": "viT-1",
"name": "Vitaly Pinchuk",
"avatar_url": "https://avatars1.githubusercontent.com/u/19496430?v=4",
"profile": "http://codepen.io/viT-1/",
"contributions": [
"bug"
]
"contributions": ["bug"]
},
{
"login": "laij84",
"name": "laij84",
"avatar_url": "https://avatars0.githubusercontent.com/u/18145822?v=4",
"profile": "https://github.com/laij84",
"contributions": [
"bug"
]
"contributions": ["bug"]
},
{
"login": "dko-slapdash",
"name": "dko-slapdash",
"avatar_url": "https://avatars0.githubusercontent.com/u/46383452?v=4",
"profile": "https://github.com/dko-slapdash",
"contributions": [
"bug"
]
"contributions": ["bug"]
},
{
"login": "hedwiggggg",
"name": "hedwiggggg",
"avatar_url": "https://avatars1.githubusercontent.com/u/42947316?v=4",
"profile": "https://github.com/hedwiggggg",
"contributions": [
"bug",
"test",
"code"
]
"contributions": ["bug", "test", "code"]
},
{
"login": "kuskoman",
"name": "kuskoman",
"avatar_url": "https://avatars3.githubusercontent.com/u/15456923?v=4",
"profile": "https://github.com/kuskoman",
"contributions": [
"doc"
]
"contributions": ["doc"]
},
{
"login": "booninite",
"name": "alex weidner",
"avatar_url": "https://avatars3.githubusercontent.com/u/13647495?v=4",
"profile": "https://github.com/booninite",
"contributions": [
"bug"
]
"contributions": ["bug"]
},
{
"login": "nonara",
"name": "Ron S.",
"avatar_url": "https://avatars0.githubusercontent.com/u/1427565?v=4",
"profile": "https://github.com/nonara",
"contributions": [
"bug",
"test",
"code"
]
"contributions": ["bug", "test", "code"]
},
{
"login": "vladimiry",
"name": "Vladimir Yakovlev",
"avatar_url": "https://avatars2.githubusercontent.com/u/1560781?v=4",
"profile": "https://github.com/vladimiry",
"contributions": [
"bug"
]
"contributions": ["bug"]
},
{
"login": "vwpo",
"name": "vwpo",
"avatar_url": "https://avatars3.githubusercontent.com/u/57674261?v=4",
"profile": "https://github.com/vwpo",
"contributions": [
"bug"
]
"contributions": ["bug"]
}
],
"contributorsPerLine": 7,
Expand Down
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ Add it to _plugins_ in your _tsconfig.json_
"baseUrl": "./",
// Configure your path mapping here
"paths": {
"@utils/*": ["utils/*"]
"@utils/*": ["utils/*"],
},
// Note: To transform paths for both the output .js and .d.ts files, you need both of the below entries
"plugins": [
// Transform paths in output .js files
{ "transform": "typescript-transform-paths" },

// Transform paths in output .d.ts files (Include this line if you output declarations files)
{ "transform": "typescript-transform-paths", "afterDeclarations": true }
]
}
{ "transform": "typescript-transform-paths", "afterDeclarations": true },
],
},
}
```

Expand Down Expand Up @@ -86,12 +86,12 @@ import { sum } from "@utils/sum";
"transformers": [
{
"name": "typescript-transform-paths/nx-transformer",
"options": { "afterDeclarations": true }
}
]
}
}
}
"options": { "afterDeclarations": true },
},
],
},
},
},
}
```

Expand All @@ -108,13 +108,13 @@ To enable virtual directory mapping, use the `useRootDirs` plugin option.
"rootDirs": ["src", "generated"],
"baseUrl": ".",
"paths": {
"#root/*": ["./src/*", "./generated/*"]
"#root/*": ["./src/*", "./generated/*"],
},
"plugins": [
{ "transform": "typescript-transform-paths", "useRootDirs": true },
{ "transform": "typescript-transform-paths", "useRootDirs": true, "afterDeclarations": true }
]
}
{ "transform": "typescript-transform-paths", "useRootDirs": true, "afterDeclarations": true },
],
},
}
```

Expand Down Expand Up @@ -158,15 +158,15 @@ Example:
"compilerOptions": {
"paths": {
"sub-module1/*": ["../../node_modules/sub-module1/*"],
"sub-module2/*": ["../../node_modules/sub-module2/*"]
"sub-module2/*": ["../../node_modules/sub-module2/*"],
},
"plugins": [
{
"transform": "typescript-transform-paths",
"exclude": ["**/node_modules/**"]
}
]
}
"exclude": ["**/node_modules/**"],
},
],
},
}
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@types/minimatch": "^5.1.2",
"@types/node": "^18.11.2",
"jest": "^29.7.0",
"prettier": "^2.7.1",
"prettier": "^3.3.3",
"rimraf": "^5.0.5",
"standard-version": "^9.5.0",
"@types/ts-expose-internals": "npm:[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion register.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ try {
tsNode = require("ts-node");
} catch {
throw new Error(
`Cannot resolve ts-node. Make sure ts-node is installed before using typescript-transform-paths/register`
`Cannot resolve ts-node. Make sure ts-node is installed before using typescript-transform-paths/register`,
);
}

Expand Down
5 changes: 2 additions & 3 deletions src/harmony/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ export type DownSampleTsTypes<TypeMap extends [any, any][], Tuple extends [...un
};

// @prettier-ignore
type DownSampleTsType<TypeMap extends [any, any][], T> = T extends Exclude<TypeMap[number][0], undefined>
? Extract<TypeMap[number], [T, any]>[1]
: T;
type DownSampleTsType<TypeMap extends [any, any][], T> =
T extends Exclude<TypeMap[number][0], undefined> ? Extract<TypeMap[number], [T, any]>[1] : T;

// @formatter:on
// endregion
16 changes: 8 additions & 8 deletions src/harmony/versions/four-seven.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export namespace TsFourSeven {
[TsCurrentModule.NamedExportBindings, TsFourSevenModule.NamedExportBindings],
[TsCurrentModule.ModuleDeclaration, TsFourSevenModule.ModuleDeclaration],
[TsCurrentModule.ModuleName, TsFourSevenModule.ModuleName],
[TsCurrentModule.ModuleBody, TsFourSevenModule.ModuleBody]
[TsCurrentModule.ModuleBody, TsFourSevenModule.ModuleBody],
];
}

Expand All @@ -56,13 +56,13 @@ export namespace TsFourSeven {
modifiers: readonly Modifier[] | undefined,
importClause: ImportClause | undefined,
moduleSpecifier: Expression,
assertClause: AssertClause | undefined
assertClause: AssertClause | undefined,
) {
const [dsNode, dsImportClause, dsModuleSpecifier, dsAssertClause] = downSample(
node,
importClause,
moduleSpecifier,
assertClause
assertClause,
);

return factory.updateImportDeclaration(
Expand All @@ -71,7 +71,7 @@ export namespace TsFourSeven {
dsNode.modifiers,
dsImportClause,
dsModuleSpecifier,
dsAssertClause
dsAssertClause,
);
};
case "updateExportDeclaration":
Expand All @@ -81,13 +81,13 @@ export namespace TsFourSeven {
isTypeOnly: boolean,
exportClause: NamedExportBindings | undefined,
moduleSpecifier: Expression | undefined,
assertClause: AssertClause | undefined
assertClause: AssertClause | undefined,
) {
const [dsNode, dsExportClause, dsModuleSpecifier, dsAssertClause] = downSample(
node,
exportClause,
moduleSpecifier,
assertClause
assertClause,
);

return factory.updateExportDeclaration(
Expand All @@ -97,15 +97,15 @@ export namespace TsFourSeven {
isTypeOnly,
dsExportClause,
dsModuleSpecifier,
dsAssertClause
dsAssertClause,
);
};
case "updateModuleDeclaration":
return function (
node: ModuleDeclaration,
modifiers: readonly Modifier[] | undefined,
name: ModuleName,
body: ModuleBody | undefined
body: ModuleBody | undefined,
) {
const [dsNode, dsName, dsBody] = downSample(node, name, body);

Expand Down
Loading