Skip to content

Commit

Permalink
Upgrade prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
jennyEckstein committed Jan 26, 2021
2 parents fb18563 + 770f1ce commit 5bfcad4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"printWidth": 100,
"singleQuote": true
"singleQuote": true,
"trailingComma": "none"
}
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async function getLatestTag(name) {
async function getLatestVersion(name, wanted) {
const versions = await getLatestVersions(name);
const latest = await getLatestTag(name);
const applicableVersions = versions.filter(i => semver.satisfies(i, wanted));
const applicableVersions = versions.filter((i) => semver.satisfies(i, wanted));
applicableVersions.sort((a, b) => semver.rcompare(a, b));

if (latest && semver.lt(latest, applicableVersions[0])) {
Expand All @@ -52,7 +52,7 @@ function getInstalledVersion(currentDir, name) {
}

function pushPkgs({ dir, logger, deps = {}, type, pkgs }) {
return Object.keys(deps).map(async name => {
return Object.keys(deps).map(async (name) => {
let wanted = deps[name];
if (!wanted.startsWith('^')) wanted = `^${wanted}`;
const installed = getInstalledVersion(dir, name);
Expand Down
12 changes: 6 additions & 6 deletions lib/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jest.mock('util', () => {
return { promisify: () => mockExecAsync };
});
jest.mock('chalk', () => ({
blue: str => str,
bold: str => str,
green: str => str,
red: str => str
blue: (str) => str,
bold: (str) => str,
green: (str) => str,
red: (str) => str
}));

const chance = new Chance();
Expand All @@ -34,7 +34,7 @@ describe('lib/index', () => {
const logger = { info: jest.fn() };
let olderVersion;
let newerVersion;
const mock = command => {
const mock = (command) => {
const result = command.match(moduleNameRegexVersions) || command.match(moduleNameRegexTags);
const moduleName = result[1];
const versions = [olderVersion];
Expand Down Expand Up @@ -307,7 +307,7 @@ describe('lib/index', () => {
});

test('autoUpgrade modules', async () => {
const mock2 = command => {
const mock2 = (command) => {
const moduleName = command.match('npm i (.*)')[1];
const versions = [olderVersion];
if (moduleName === outdatedDep || moduleName === outdatedDevDep) versions.push(newerVersion);
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"jsdoc-to-markdown": "^5.0.3",
"lint-staged": "^10.5.3",
"npm-watch": "^0.6.0",
"prettier": "^1.19.1"
"prettier": "^2.2.1"
},
"husky": {
"hooks": {
Expand Down

0 comments on commit 5bfcad4

Please sign in to comment.