diff --git a/index.js b/index.js index fedadd0..054c372 100644 --- a/index.js +++ b/index.js @@ -40,7 +40,9 @@ function chalkFactory(options) { Object.setPrototypeOf(chalk, Chalk.prototype); Object.setPrototypeOf(chalk.template, chalk); - chalk.template.constructor = () => {throw new Error('Chalk.constructor() is deprecated. Use new Chalk.instance() instead.')}; + chalk.template.constructor = () => { + throw new Error('Chalk.constructor() is deprecated. Use new Chalk.instance() instead.'); + }; chalk.template.instance = ChalkClass; return chalk.template; diff --git a/test/constructor.js b/test/constructor.js index 295ed94..976ae87 100644 --- a/test/constructor.js +++ b/test/constructor.js @@ -3,13 +3,13 @@ import test from 'ava'; const chalk = require('..'); test('Chalk.constructor should throw an expected error', t => { - const expectedError = t.throws(() => { - chalk.constructor(); - }); + const expectedError = t.throws(() => { + chalk.constructor(); + }); - t.is(expectedError.message, 'Chalk.constructor() is deprecated. Use new Chalk.instance() instead.'); + t.is(expectedError.message, 'Chalk.constructor() is deprecated. Use new Chalk.instance() instead.'); - t.throws(() => { - new chalk.constructor(); - }); + t.throws(() => { + new chalk.constructor(); // eslint-disable-line no-new + }); });