From 650dd9efd1fd657feed2191d1592a9a4b054ec9c Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 7 Mar 2023 00:20:51 +0200 Subject: [PATCH] chore: wisdom: lint --- .eslintrc.json | 4 ++-- lib/release.js | 2 +- lib/release.spec.js | 10 +++++++--- lib/wisdom.js | 2 +- package.json | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 06b4cbb..e9c96de 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,10 +1,10 @@ { "extends": [ - "plugin:node/recommended", + "plugin:n/recommended", "plugin:putout/recommended" ], "plugins": [ "putout", - "node" + "n" ] } diff --git a/lib/release.js b/lib/release.js index fa32a1e..faff240 100644 --- a/lib/release.js +++ b/lib/release.js @@ -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`); diff --git a/lib/release.spec.js b/lib/release.spec.js index 7b1c305..9449950 100644 --- a/lib/release.spec.js +++ b/lib/release.spec.js @@ -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; @@ -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(); diff --git a/lib/wisdom.js b/lib/wisdom.js index 5383159..5f1f302 100644 --- a/lib/wisdom.js +++ b/lib/wisdom.js @@ -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); diff --git a/package.json b/package.json index 7bfb528..e633f15 100644 --- a/package.json +++ b/package.json @@ -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",