Skip to content

Commit

Permalink
chore: format code with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpza committed Aug 6, 2024
1 parent c56f2ad commit b0fbea2
Show file tree
Hide file tree
Showing 20 changed files with 118 additions and 161 deletions.
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 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

0 comments on commit b0fbea2

Please sign in to comment.