diff --git a/config/overrides.js b/config/overrides.js index ce08c754..728355e6 100644 --- a/config/overrides.js +++ b/config/overrides.js @@ -1,4 +1,4 @@ 'use strict'; module.exports = { - // put rule overrides here + // Put rule overrides here }; diff --git a/config/plugins.js b/config/plugins.js index 5f164d92..e9fe9822 100644 --- a/config/plugins.js +++ b/config/plugins.js @@ -1,6 +1,6 @@ 'use strict'; module.exports = { - // repeated here from eslint-config-xo in case some plugins set something different + // Repeated here from eslint-config-xo in case some plugins set something different parserOptions: { ecmaVersion: 2017, sourceType: 'module', @@ -32,7 +32,7 @@ module.exports = { 'promise/param-names': 'error', 'promise/no-promise-in-callback': 'error', 'promise/no-callback-in-promise': 'error', - // enable this sometime in the future when Node.js has async/await support + // Enable this sometime in the future when Node.js has async/await support // 'promise/prefer-await-to-then': 'error', 'import/default': 'error', 'import/export': 'error', @@ -49,7 +49,7 @@ module.exports = { 'import/newline-after-import': 'error', 'import/no-amd': 'error', 'import/no-duplicates': 'error', - // enable this sometime in the future when Node.js has ES2015 module support + // Enable this sometime in the future when Node.js has ES2015 module support // 'import/unambiguous': 'error', // enable this sometime in the future when Node.js has ES2015 module support // 'import/no-commonjs': 'error', diff --git a/index.js b/index.js index 199f1af5..7be1cb32 100644 --- a/index.js +++ b/index.js @@ -63,7 +63,7 @@ exports.lintFiles = (pattern, opts) => { const glob = patterns.concat(gitIgnores); return globby(glob, {ignore: opts.ignores, nodir: true}).then(paths => { - // filter out unwanted file extensions + // Filter out unwanted file extensions // for silly users that don't specify an extension in the glob pattern paths = paths.filter(x => { // Remove dot before the actual extension @@ -85,7 +85,7 @@ exports.lintFiles = (pattern, opts) => { }; function mergeReports(reports) { - // merge multiple reports into a single report + // Merge multiple reports into a single report let results = []; let errorCount = 0; let warningCount = 0; diff --git a/options-manager.js b/options-manager.js index e3b6c2e2..aec09a3a 100644 --- a/options-manager.js +++ b/options-manager.js @@ -45,7 +45,7 @@ const DEFAULT_CONFIG = { function normalizeOpts(opts) { opts = Object.assign({}, opts); - // alias to help humans + // Alias to help humans [ 'env', 'global', @@ -81,7 +81,7 @@ function mergeWithPkgConf(opts) { return Object.assign({}, conf, opts); } -// define the shape of deep properties for deepAssign +// Define the shape of deep properties for deepAssign function emptyOptions() { return { rules: {}, @@ -104,7 +104,7 @@ function buildConfig(opts) { const spaces = typeof opts.space === 'number' ? opts.space : 2; config.rules.indent = ['error', spaces, {SwitchCase: 1}]; - // only apply if the user has the React plugin + // Only apply if the user has the React plugin if (opts.cwd && resolveFrom(opts.cwd, 'eslint-plugin-react')) { config.plugins = config.plugins.concat('react'); config.rules['react/jsx-indent-props'] = ['error', spaces]; @@ -140,12 +140,12 @@ function buildConfig(opts) { // TODO: this logic needs to be improved, preferably use the same code as ESLint // user's configs must be resolved to their absolute paths const configs = opts.extends.map(name => { - // don't do anything if it's a filepath + // Don't do anything if it's a filepath if (pathExists.sync(name)) { return name; } - // don't do anything if it's a config from a plugin + // Don't do anything if it's a config from a plugin if (name.startsWith('plugin:')) { return name; } diff --git a/test/cli.js b/test/cli.js index 789b9e33..f828cba2 100644 --- a/test/cli.js +++ b/test/cli.js @@ -45,7 +45,7 @@ test('overrides fixture', async () => { // https://github.com/sindresorhus/xo/issues/65 test.failing('ignores fixture', async t => { const cwd = path.join(__dirname, 'fixtures/ignores'); - t.throws(execa('../../../cli.js', ['--no-local'], {cwd})); + await t.throws(execa('../../../cli.js', ['--no-local'], {cwd})); }); test('ignore files in .gitignore', async t => { diff --git a/test/options-manager.js b/test/options-manager.js index 8c5361c3..d60108f2 100644 --- a/test/options-manager.js +++ b/test/options-manager.js @@ -1,8 +1,8 @@ import path from 'path'; import test from 'ava'; import proxyquire from 'proxyquire'; -import parentConfig from './fixtures/nested/package.json'; -import childConfig from './fixtures/nested/child/package.json'; +import parentConfig from './fixtures/nested/package'; +import childConfig from './fixtures/nested/child/package'; process.chdir(__dirname); @@ -40,7 +40,7 @@ test('normalizeOpts: falsie values stay falsie', t => { test('buildConfig: defaults', t => { const config = manager.buildConfig({}); - t.true(/[\\\/]\.xo-cache[\\\/]?$/.test(config.cacheLocation)); + t.true(/[\\/]\.xo-cache[\\/]?$/.test(config.cacheLocation)); t.is(config.useEslintrc, false); t.is(config.cache, true); t.is(config.baseConfig.extends[0], 'xo/esnext'); @@ -64,7 +64,7 @@ test('buildConfig: space: 4', t => { test('buildConfig: semicolon', t => { const config = manager.buildConfig({semicolon: false}); t.deepEqual(config.rules, { - 'semi': ['error', 'never'], + semi: ['error', 'never'], 'semi-spacing': ['error', { before: false, after: true