Skip to content

Commit

Permalink
feat: add eslint, document it, add it to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
BracketJohn committed Mar 1, 2023
1 parent 315cd53 commit b7c741d
Show file tree
Hide file tree
Showing 6 changed files with 2,118 additions and 67 deletions.
29 changes: 29 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
// From: https://github.com/airbnb/javascript/issues/451 - we want airbnb, but not it's react rules (because we don't use react)
"extends": "airbnb-base",
"overrides": [
{
"files": [
"./**/*.ts"
],
"rules": {
"no-console": [
"error",
{
"allow": [
"info",
"warn",
"trace",
"error"
]
}
]
}
}
],
"rules": {
"no-return-await": [
"error"
]
}
}
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ jobs:
- run: npm install

- run: npm run typecheck

- run: npm run lint
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ npm i
# Run application in development mode
npm run dev

# Typechecking
# Typechecking (via TypeScript / tsc)
npm run typecheck
```




# Linting (via eslint)
```

### Coding Setup

Expand Down
16 changes: 8 additions & 8 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const main = async () => {
console.log('GM MakerDao')
}
console.info('GM MakerDao');
};

main().catch((err) => {
console.error("Shutting down...")
console.error('Shutting down...');
if (err instanceof Error) {
console.error(err)
console.error(err);
} else {
console.error("An unknown error has occurred. Please open an issue on github with the below:")
console.log(err)
console.error('An unknown error has occurred. Please open an issue on github (https://github.com/makerdao-ses/switchboard-boilerplate/issues/new) with the below context:');
console.info(err);
}
process.exit(1)
})
process.exit(1);
});
Loading

0 comments on commit b7c741d

Please sign in to comment.