Skip to content

Commit

Permalink
feat(eslint): Use eslint:recommended instead of unobtrusive
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Apr 30, 2020
1 parent e936e55 commit 3df16cd
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 68 deletions.
2 changes: 1 addition & 1 deletion packages/spire-plugin-doctoc/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('spire-plugin-doctoc', () => {
'--debug',
]);
expect(stdout).toMatch(/Using linters:/);
expect(stdout).toMatch(/\{readme\,contributing\}\.md/);
expect(stdout).toMatch(/\{readme,contributing\}\.md/);
await fixture.clean();
});
});
2 changes: 1 addition & 1 deletion packages/spire-plugin-eslint/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
parser: 'babel-eslint',
extends: ['prettier', 'unobtrusive'],
extends: ['eslint:recommended', 'prettier'],
plugins: ['prettier'],
env: {
es6: true,
Expand Down
7 changes: 4 additions & 3 deletions packages/spire-plugin-eslint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,17 @@ function eslint(
const currentContent = await readFile(configFile, 'UTF-8');
if (!currentContent.includes(defaultEslintConfig)) {
return logger.warn(
'Attempted to set ESLint config but it already exists. Please ensure existing config re-exports `%s`.',
'Attempted to set ESLint config but it already exists. ' +
'Please ensure existing config re-exports `%s`.',
defaultEslintConfig
);
}
}
}
await writeFile(
configFile,
`// This file was created by spire-plugin-eslint for editor support
module.exports = require('${defaultEslintConfig}');`
'// This file was created by spire-plugin-eslint for editor support\n' +
`module.exports = require('${defaultEslintConfig}');`
);
}
},
Expand Down
1 change: 0 additions & 1 deletion packages/spire-plugin-eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"babel-eslint": "^10.0.2",
"eslint": "^6.0.1",
"eslint-config-prettier": "^6.0.0",
"eslint-config-unobtrusive": "^1.2.3",
"eslint-plugin-prettier": "^3.1.0",
"execa": "^4.0.0",
"fs-extra": "^8.1.0"
Expand Down
10 changes: 1 addition & 9 deletions packages/spire/bin/spire.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
#!/usr/bin/env node
const spire = require('spire');

async function main() {
try {
return await spire();
} catch (reason) {
throw reason;
}
}

main().then((code) => {
spire().then((code) => {
process.exitCode = code;
});
7 changes: 2 additions & 5 deletions packages/spire/lib/plugins/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function git(
).stdout,
});
} catch (reason) {
if (Boolean(env.SKIP_PREFLIGHT_CHECK)) {
if (env.SKIP_PREFLIGHT_CHECK) {
setState({ root: cwd });
} else {
throw new SpireError(
Expand Down Expand Up @@ -78,10 +78,7 @@ function git(
].join(' ')
);
}
const hookCommand = gitHooks[hook].replace(
/\<spireBin\>/g,
spireBin
);
const hookCommand = gitHooks[hook].replace(/<spireBin>/g, spireBin);
await outputFile(hookPath, hookToString(hookCommand), 'utf8');
await chmod(hookPath, '744'); // a+x
}
Expand Down
2 changes: 1 addition & 1 deletion packages/spire/tests/hooks.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('spire', () => {
'--debug',
]);
expect(stderr).toBe('');
expect(stdout).toMatch(new RegExp(`Running hooks\.${hook}`));
expect(stdout).toMatch(new RegExp(`Running hooks.${hook}`));
await fixture.clean();
});
});
49 changes: 2 additions & 47 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2903,7 +2903,7 @@ debug@^3.1.0:
dependencies:
ms "^2.1.1"

debuglog@*, debuglog@^1.0.1:
debuglog@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=
Expand Down Expand Up @@ -3305,11 +3305,6 @@ eslint-config-prettier@^6.0.0:
dependencies:
get-stdin "^6.0.0"

eslint-config-unobtrusive@^1.2.3:
version "1.2.5"
resolved "https://registry.yarnpkg.com/eslint-config-unobtrusive/-/eslint-config-unobtrusive-1.2.5.tgz#4e5b09ef625e31e78396176e3c23874491d04180"
integrity sha512-JOhF2PaSXBnT2JapDVUDpbOOj3rY0nOTxuP6J/V9Dd4sRfCFqjBaT0uSHUbMzr4ta2rOyrF2GJjhDvvkbzsr9Q==

eslint-plugin-prettier@^3.1.0:
version "3.1.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz#432e5a667666ab84ce72f945c72f77d996a5c9ba"
Expand Down Expand Up @@ -4410,7 +4405,7 @@ import-local@^3.0.2:
pkg-dir "^4.2.0"
resolve-cwd "^3.0.0"

imurmurhash@*, imurmurhash@^0.1.4:
imurmurhash@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
Expand Down Expand Up @@ -5816,11 +5811,6 @@ lockfile@^1.0.4:
dependencies:
signal-exit "^3.0.2"

lodash._baseindexof@*:
version "3.1.0"
resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c"
integrity sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw=

lodash._baseuniq@~4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8"
Expand All @@ -5829,33 +5819,11 @@ lodash._baseuniq@~4.6.0:
lodash._createset "~4.0.0"
lodash._root "~3.0.0"

lodash._bindcallback@*:
version "3.0.1"
resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e"
integrity sha1-5THCdkTPi1epnhftlbNcdIeJOS4=

lodash._cacheindexof@*:
version "3.0.2"
resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92"
integrity sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI=

lodash._createcache@*:
version "3.1.2"
resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093"
integrity sha1-VtagZAF2JeeevKa4AY4XRAvc8JM=
dependencies:
lodash._getnative "^3.0.0"

lodash._createset@~4.0.0:
version "4.0.3"
resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26"
integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY=

lodash._getnative@*, lodash._getnative@^3.0.0:
version "3.9.1"
resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=

lodash._reinterpolate@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
Expand Down Expand Up @@ -5901,11 +5869,6 @@ lodash.isstring@^4.0.1:
resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451"
integrity sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=

lodash.restparam@*:
version "3.6.1"
resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805"
integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=

lodash.set@^4.3.2:
version "4.3.2"
resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23"
Expand Down Expand Up @@ -6682,7 +6645,6 @@ npm@^6.10.3:
cmd-shim "^3.0.3"
columnify "~1.5.4"
config-chain "^1.1.12"
debuglog "*"
detect-indent "~5.0.0"
detect-newline "^2.1.0"
dezalgo "~1.0.3"
Expand All @@ -6697,7 +6659,6 @@ npm@^6.10.3:
has-unicode "~2.0.1"
hosted-git-info "^2.8.8"
iferr "^1.0.2"
imurmurhash "*"
infer-owner "^1.0.4"
inflight "~1.0.6"
inherits "^2.0.4"
Expand All @@ -6716,14 +6677,8 @@ npm@^6.10.3:
libnpx "^10.2.2"
lock-verify "^2.1.0"
lockfile "^1.0.4"
lodash._baseindexof "*"
lodash._baseuniq "~4.6.0"
lodash._bindcallback "*"
lodash._cacheindexof "*"
lodash._createcache "*"
lodash._getnative "*"
lodash.clonedeep "~4.5.0"
lodash.restparam "*"
lodash.union "~4.6.0"
lodash.uniq "~4.5.0"
lodash.without "~4.4.0"
Expand Down

0 comments on commit 3df16cd

Please sign in to comment.