Skip to content

Commit

Permalink
chore(eslint): eslint and git pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
GarrixA committed Apr 18, 2024
1 parent 136661d commit 1303b99
Show file tree
Hide file tree
Showing 16 changed files with 6,597 additions and 3,257 deletions.
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
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"

npm run precommit
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": true,
"tabWidth": 2,
"useTabs": true
}
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"pkief.material-icon-theme",
"ritwickdey.liveserver"
]
}
51 changes: 51 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";

export default tseslint.config(
{
ignores: ["**/src/database/migrations/*.js", "**/src/database/seeders/*.js", "**src/database/config/*.js"]
},
eslint.configs.recommended,
...tseslint.configs.recommended,
{
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
ecmaVersion: 2020,
},
},
},
{
files: ["*.ts", "*.js"],
...tseslint.configs.disableTypeChecked,
},
{
files: ["*.test *.js"],
rules: {
"@typescript-eslint/no-unused-vars": 0,
"@typescript-eslint/no-unsafe-call": 0,
languageOptions: {
globals: {
it: "readonly",
describe: "readonly",
},
},
},
},
{
rules: {
semi: "error",
"@typescript-eslint/no-unused-vars": 2,
"@typescript-eslint/no-explicit-any": 0,
"no-shadow": [2, { allow: ["req", "res", "err"] }],
"new-cap": 0,
"one-var-declaration-per-line": 0,
"consistent-return": 0,
"no-param-reassign": 0,
"comma-dangle": 0,
curly: ["error", "multi-line"],

},
},
);
Loading

0 comments on commit 1303b99

Please sign in to comment.