Skip to content

Commit

Permalink
chore: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Dec 29, 2018
1 parent c720984 commit efe5889
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 25 deletions.
12 changes: 4 additions & 8 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@
{
"taskName": "tsc",
"command": "node",
"args": [
"./node_modules/typescript/lib/tsc.js",
"-w",
"-p",
"."
],
"args": ["./node_modules/typescript/lib/tsc.js", "-w", "-p", "."],
"isBackground": true,
"problemMatcher": "$tsc-watch"
}]
}
}
]
}
6 changes: 4 additions & 2 deletions src/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ export const addPackages = async (
}
const addedAction = options.link ? 'linked' : 'added'
console.log(
`Package ${pkg.name}@${pkg.version} ${addedAction} ==> ${destModulesDir}.`
`Package ${pkg.name}@${
pkg.version
} ${addedAction} ==> ${destModulesDir}.`
)
}

Expand Down Expand Up @@ -213,6 +215,6 @@ export const addPackages = async (

if (options.yarn) {
console.log('Running yarn:')
execSync('yarn', {cwd: options.workingDir})
execSync('yarn', { cwd: options.workingDir })
}
}
12 changes: 5 additions & 7 deletions src/installations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ export const readInstallationsFile = (): InstallationsFile => {
export const showInstallations = ({ packages }: { packages: string[] }) => {
const config = readInstallationsFile()
Object.keys(config)
.filter(
packageName =>
packages.length ? packages.indexOf(packageName) >= 0 : true
.filter(packageName =>
packages.length ? packages.indexOf(packageName) >= 0 : true
)
.map((name: PackageName) => ({ name, locations: config[name] }))
.forEach(({ name, locations }) => {
Expand All @@ -55,14 +54,13 @@ export const cleanInstallations = async ({
packages,
dry
}: {
packages: string[],
packages: string[]
dry: boolean
}) => {
const config = readInstallationsFile()
const installsToRemove = Object.keys(config)
.filter(
packageName =>
packages.length ? packages.indexOf(packageName) >= 0 : true
.filter(packageName =>
packages.length ? packages.indexOf(packageName) >= 0 : true
)
.map((name: PackageName) => ({ name, locations: config[name] }))
.reduce(
Expand Down
2 changes: 1 addition & 1 deletion test/fixture/project/nested/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"dependencies": {
"dep-package": "1.0.0"
}
}
}
14 changes: 7 additions & 7 deletions test/fixture/project/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "yalc-test-project",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"dep-package": "1.0.0"
}
"name": "yalc-test-project",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"dep-package": "1.0.0"
}
}

0 comments on commit efe5889

Please sign in to comment.