From e88b587ff953b1a926815fb65a13531210a3b5f1 Mon Sep 17 00:00:00 2001 From: Pierre Vanduynslager Date: Fri, 27 Mar 2020 00:04:56 -0400 Subject: [PATCH] style: disable `unicorn/string-content` linter rule --- lib/add-channel.js | 2 +- lib/definitions/errors.js | 2 +- lib/publish.js | 2 +- package.json | 5 ++++- test/get-pkg.test.js | 2 +- test/helpers/npm-registry.js | 2 +- test/integration.test.js | 3 +-- 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/add-channel.js b/lib/add-channel.js index 5040e51c..6e84aab9 100644 --- a/lib/add-channel.js +++ b/lib/add-channel.js @@ -37,7 +37,7 @@ module.exports = async (npmrc, {npmPublish}, pkg, context) => { logger.log( `Skip adding to npm channel as ${ - npmPublish === false ? 'npmPublish' : 'package.json’s private property' + npmPublish === false ? 'npmPublish' : "package.json's private property" } is ${npmPublish !== false}` ); diff --git a/lib/definitions/errors.js b/lib/definitions/errors.js index 4893d9ca..10a70523 100644 --- a/lib/definitions/errors.js +++ b/lib/definitions/errors.js @@ -42,7 +42,7 @@ Please make sure to set the \`NPM_TOKEN\` environment variable in your CI with t }), ENOPKGNAME: () => ({ message: 'Missing `name` property in `package.json`.', - details: `The \`package.json\`’s [name](https://docs.npmjs.com/files/package.json#name) property is required in order to publish a package to the npm registry. + details: `The \`package.json\`'s [name](https://docs.npmjs.com/files/package.json#name) property is required in order to publish a package to the npm registry. Please make sure to add a valid \`name\` for your package in your \`package.json\`.`, }), diff --git a/lib/publish.js b/lib/publish.js index ed435b6a..48c8beda 100644 --- a/lib/publish.js +++ b/lib/publish.js @@ -36,7 +36,7 @@ module.exports = async (npmrc, {npmPublish, pkgRoot}, pkg, context) => { logger.log( `Skip publishing to npm registry as ${ - npmPublish === false ? 'npmPublish' : 'package.json’s private property' + npmPublish === false ? 'npmPublish' : "package.json's private property" } is ${npmPublish !== false}` ); diff --git a/package.json b/package.json index febc54a5..0a6819c5 100644 --- a/package.json +++ b/package.json @@ -98,6 +98,9 @@ }, "xo": { "prettier": true, - "space": true + "space": true, + "rules": { + "unicorn/string-content": "off" + } } } diff --git a/test/get-pkg.test.js b/test/get-pkg.test.js index 2717e21f..b20fc11e 100644 --- a/test/get-pkg.test.js +++ b/test/get-pkg.test.js @@ -45,7 +45,7 @@ test('Throw error if missing package name', async t => { test('Throw error if package.json is malformed', async t => { const cwd = tempy.directory(); - await writeFile(path.resolve(cwd, 'package.json'), '{name: ’package’,}'); + await writeFile(path.resolve(cwd, 'package.json'), "{name: 'package',}"); const [error] = await t.throwsAsync(getPkg({}, {cwd})); diff --git a/test/helpers/npm-registry.js b/test/helpers/npm-registry.js index ebb8e20f..c9c83093 100644 --- a/test/helpers/npm-registry.js +++ b/test/helpers/npm-registry.js @@ -40,7 +40,7 @@ async function start() { factor: 2, }); } catch (_) { - throw new Error(`Couldn’t start npm-docker-couchdb after 2 min`); + throw new Error(`Couldn't start npm-docker-couchdb after 2 min`); } // Create user diff --git a/test/integration.test.js b/test/integration.test.js index 10630cdf..f220b832 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -1,5 +1,4 @@ const path = require('path'); -const {inspect} = require('util'); const test = require('ava'); const {outputJson, readJson, pathExists} = require('fs-extra'); const execa = require('execa'); @@ -594,7 +593,7 @@ test('Publish the package and add to lts dist-tag', async t => { t.deepEqual(result, {name: 'npm package (@release-1.x dist-tag)', url: undefined, channel: 'release-1.x'}); t.is( (await execa('npm', ['view', pkg.name, 'dist-tags'], {cwd, env})).stdout, - inspect({latest: '1.0.0', 'release-1.x': '1.0.0'}) + "{ latest: '1.0.0', 'release-1.x': '1.0.0' }" ); });