Skip to content

Commit

Permalink
feat: add eslint, prettier, and commitlint
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanStandel committed Jun 11, 2022
1 parent fb5752d commit 04cf627
Show file tree
Hide file tree
Showing 12 changed files with 4,078 additions and 247 deletions.
12 changes: 12 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": ["@commitlint/config-conventional"],
"formatter": "@commitlint/format",
"rules": {
"scope-enum": [
2, "always", [ "client" ]
],
"header-max-length": [
0, "always", 256
]
}
}
42 changes: 42 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"ignorePatterns": ["**/*.js"],
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:import/recommended",
"plugin:import/typescript"
],
"rules": {
// evidently doesn't resolve esm, real issues should break builds anyways
"import/no-unresolved": ["off"],
// this rule is stupid
"no-restricted-globals": ["off"],
"prettier/prettier": ["error", {}, { "usePrettierrc": true }],
"import/order": [
"error",
{
"alphabetize": { "order": "asc" },
"groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index"
],
"newlines-between": "always",
"pathGroupsExcludedImportTypes": ["builtin"]
}
],
"@typescript-eslint/no-non-null-assertion": ["off"],
"@typescript-eslint/explicit-module-boundary-types": ["off"],
"@typescript-eslint/ban-ts-comment": ["off"]
}
}
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"arrowParens": "avoid",
"parser": "typescript",
"quotes": "double",
"printWidth": 100,
"semi": true,
"trailingComma": "all"
}
Loading

0 comments on commit 04cf627

Please sign in to comment.