diff --git a/.editorconfig b/.editorconfig index 86c8f59..8f9d77e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,7 +7,7 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[package.json] +[{package.json,*.yml}] indent_style = space indent_size = 2 diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 804f8af..0000000 --- a/.jshintrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "node": true, - "esnext": true, - "bitwise": true, - "camelcase": true, - "curly": true, - "immed": true, - "newcap": true, - "noarg": true, - "undef": true, - "unused": "vars", - "strict": true -} diff --git a/benchmark.js b/benchmark.js index ce3f2c4..5c26a87 100644 --- a/benchmark.js +++ b/benchmark.js @@ -1,3 +1,5 @@ +/* globals set bench */ +'use strict'; var chalk = require('./'); suite('chalk', function () { diff --git a/index.js b/index.js index 7e3aa6c..2d85a91 100644 --- a/index.js +++ b/index.js @@ -44,7 +44,7 @@ function build(_styles) { builder.enabled = this.enabled; // __proto__ is used because we must return a function, but there is // no way to create a function with a different prototype. - /*eslint no-proto: 0 */ + /* eslint-disable no-proto */ builder.__proto__ = proto; return builder; diff --git a/package.json b/package.json index daabdd1..6ccf96e 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "node": ">=0.10.0" }, "scripts": { - "test": "mocha", + "test": "xo && mocha", "bench": "matcha benchmark.js", "coverage": "nyc npm test && nyc report", "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls" @@ -58,6 +58,13 @@ "nyc": "^3.0.0", "require-uncached": "^1.0.2", "resolve-from": "^1.0.0", - "semver": "^4.3.3" + "semver": "^4.3.3", + "xo": "*" + }, + "xo": { + "envs": [ + "node", + "mocha" + ] } } diff --git a/test.js b/test.js index bc39470..1e6d75e 100644 --- a/test.js +++ b/test.js @@ -119,7 +119,6 @@ describe('chalk on windows', function () { var chalkCtx = requireUncached('./'); assert.equal(chalkCtx.blue.dim('foo'), '\u001b[94m\u001b[2mfoo\u001b[22m\u001b[39m'); }); - }); describe('chalk.enabled', function () {