Skip to content

Commit

Permalink
Update to use thoughtbot eslint package
Browse files Browse the repository at this point in the history
  • Loading branch information
geekiam23 committed Aug 17, 2023
1 parent 0e56c73 commit 33339d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
8 changes: 1 addition & 7 deletions src/commands/eslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export default async function runEslint() {
if (await isEslintConfigured()) {
log('eslint config already exists');
} else {
const hasPrettier = await isPackageInstalled('prettier');
const hasEslint = await isPackageInstalled('eslint');
const hasTypeScript = await isPackageInstalled('typescript');

const eslintConfigTemplate = await fs.readFile(
Expand All @@ -34,11 +32,7 @@ export default async function runEslint() {
format: true,
});

const deps = `${hasPrettier ? '' : 'prettier'} ${
hasEslint ? '' : 'eslint'
} @typescript-eslint/eslint-plugin @typescript-eslint/parser`;

await addDependency(deps, { dev: true });
await addDependency('@thoughtbot/eslint-config', { dev: true });

log(chalk.green('🎉 ESLint successfully configured'));
}
Expand Down
11 changes: 6 additions & 5 deletions src/commands/templates/eslintrc.js.eta
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
module.exports = {
extends: ['universe/native',
"extends": [
"@thoughtbot/eslint-config/native",
<% if(it.typescript) { %>
"@thoughtbot/eslint-config/typescript"
<% } %>
],
<% if(it.typescript) { %>
'universe/shared/typescript-analysis',
<% } %>
],
<% if(it.typescript) { %>
overrides: [
{
files: [
Expand Down

0 comments on commit 33339d7

Please sign in to comment.