Skip to content

Commit

Permalink
feat: Add eslint configs
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminparnell committed Jan 15, 2024
1 parent 938b0ef commit d3573e4
Show file tree
Hide file tree
Showing 8 changed files with 3,238 additions and 59 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
coverage/
**/build/
**/*.d.ts
**/tsconfig.json
**/tsconfig.eslint.json
35 changes: 35 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* eslint-env node */
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:ava/recommended",
"plugin:unicorn/recommended",
],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "unicorn", "ava"],
root: true,
rules: {
"no-await-in-loop": "error",
"unicorn/switch-case-braces": "off",
"import/no-extraneous-dependencies": "off",
"unicorn/prefer-node-protocol": "off",
"import/extensions": "off",
"@typescript-eslint/naming-convention": "off",
"unicorn/expiring-todo-comments": "off",
"unicorn/prefer-logical-operator-over-ternary": "off",
"unicorn/consistent-destructuring": "off",
"unicorn/prefer-module": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/consistent-function-scoping": "off",
"unicorn/prefer-string-replace-all": "off",
},
overrides: [
{
files: ".ts",
parserOptions: {
project: "./tsconfig.eslint.json",
},
},
],
};
1 change: 0 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ jobs:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm run lint
- run: npm run test
1 change: 0 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
node-version: "18"
- run: npm ci
- run: npm run lint
- run: npm run test

publish:
needs: [unit-test]
Expand Down
4 changes: 4 additions & 0 deletions .husky/precommit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
3 changes: 3 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{ts,json,yml,md}": "npm run lint"
}
Loading

0 comments on commit d3573e4

Please sign in to comment.