Skip to content

Commit

Permalink
chore: wisdom: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Mar 6, 2023
1 parent 7dd3254 commit 650dd9e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"extends": [
"plugin:node/recommended",
"plugin:n/recommended",
"plugin:putout/recommended"
],
"plugins": [
"putout",
"node"
"n"
]
}
2 changes: 1 addition & 1 deletion lib/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function release({version, info, chlog, emitter, count}) {
return;
}

const tag = 'v' + version;
const tag = `v${version}`;

if (!info.repository) {
emitter.emit('data', `Error releasing on github: no 'repository' field found in 'package.json'\n`);
Expand Down
10 changes: 7 additions & 3 deletions lib/release.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import {
} from 'supertape';

import {createMockImport} from 'mock-import';

import {release} from './release.js';

const {
mockImport,
reImport,
stopAll,
} = createMockImport(import.meta.url);

import {release} from './release.js';

test('wisdom: release: emit', async (t) => {
const version = 'v1.0.0';
const count = 1;
Expand All @@ -34,7 +35,10 @@ test('wisdom: release: emit', async (t) => {
count,
}, callback);

const expected = ['data', 'release: false\n'];
const expected = [
'data',
'release: false\n',
];

t.calledWith(emit, expected);
t.end();
Expand Down
2 changes: 1 addition & 1 deletion lib/wisdom.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async function publish({version, info, emitter, dryRun}) {

if (!version.indexOf('v')) {
version = version.slice(1);
type += 'v' + version;
type += `v${version}`;
} else if (/major|minor|patch/.test(version)) {
type += version;
version = minor(version, info.version);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"c8": "^7.8.0",
"escover": "^2.1.2",
"eslint": "^8.1.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-n": "^15.6.1",
"eslint-plugin-putout": "^16.2.1",
"madrun": "^9.0.2",
"mock-import": "^3.0.2",
Expand Down

0 comments on commit 650dd9e

Please sign in to comment.