Skip to content

Commit

Permalink
Create git hooks for eslint/format to run on commit
Browse files Browse the repository at this point in the history
  • Loading branch information
surahj committed Sep 20, 2023
1 parent 77159e6 commit 2bbadfd
Show file tree
Hide file tree
Showing 9 changed files with 2,551 additions and 96 deletions.
19 changes: 19 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": ["airbnb/base", "prettier", "plugin:node/recommended"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error",
"spaced-comment": "off",
"no-console": "warn",
"consistent-return": "off",
"func-names": "off",
"object-shorthand": "off",
"no-process-exit": "off",
"no-param-reassign": "off",
"no-return-await": "off",
"no-underscore-dangle": 1,
"class-methods-use-this": "off",
"prefer-destructuring": ["error", { "object": true, "array": false }],
"no-unused-vars": ["error", { "argsIgnorePattern": "req|res|next|val" }]
}
}
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint
npm run format
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
10 changes: 5 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require('dotenv').config()
const express = require('express')
const app = express()
require('dotenv').config();
const express = require('express');

const URI = process.env.MYSQL_ADDON_URI
const app = express();

const URI = process.env.MYSQL_ADDON_URI;

app.listen()
app.listen();
10 changes: 5 additions & 5 deletions db/db.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const Seqeulize = require("seqeulize")
require('dotenv').config()
const URI = process.env.MYSQL_ADDON_URI
const Seqeulize = require('seqeulize');
require('dotenv').config();

const URI = process.env.MYSQL_ADDON_URI;

const seqeulize = new Seqeulize(URI, { dialect: 'mysql' })
const seqeulize = new Seqeulize(URI, { dialect: 'mysql' });

module.exports = seqeulize
module.exports = seqeulize;
Loading

0 comments on commit 2bbadfd

Please sign in to comment.