Skip to content

Commit

Permalink
Integrate ESLint, Prettier, and Husky for code consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
TanmayDhobale committed Mar 12, 2024
1 parent f4fc6f8 commit da22388
Show file tree
Hide file tree
Showing 16 changed files with 463 additions and 1,035 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
16 changes: 9 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@ env:
mocha: true
browser: true

plugins:
- "@typescript-eslint"
"plugins": ["@typescript-eslint", "prettier"]

extends:
- eslint:recommended
- plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended

extends:
- "eslint:recommended"
- "plugin:@typescript-eslint/eslint-recommended"
- "plugin:@typescript-eslint/recommended"
- "prettier"

parserOptions:
ecmaVersion: 2018

rules:
# Ignore Rules
indent: "off"
strict: 0
prettier/prettier: "error"
no-underscore-dangle: 0
no-mixed-requires: 0
no-process-exit: 0
Expand Down Expand Up @@ -70,7 +73,6 @@ rules:
semi-spacing: 2
quotes: [2, 'single']
key-spacing: [2, { beforeColon: false, afterColon: true }]
indent: [2, 2]
no-lonely-if: 2
no-floating-decimal: 2
brace-style: [2, 1tbs, { allowSingleLine: true }]
Expand Down
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,31 @@

OR

* Copy .env.example to .env
* Get a postgres db from https://neon.tech/ (or any other provider)
* Replace the DATABASE_URL in .env
* Run ```npx prisma migrate dev``` to setup schema
* Copy `.env.example` to `.env`
* Get a postgres db from [https://neon.tech/](https://neon.tech/) (or any other provider)
* Replace the `DATABASE_URL` in `.env`
* Run `npx prisma migrate dev` to setup schema

## Development Environment Setup for Coding Standards

To ensure your contributions adhere to the project's coding standards, please install the ESLint and Prettier extensions for your IDE. We strongly recommend configuring your IDE to automatically format code on save using the project's `.eslintrc` and `.prettierrc` settings.

For consistency, we use pre-commit hooks managed by Husky to automatically format and lint staged files. Please make sure to install all project dependencies, including Husky, by running `npm install` after cloning the repository. This step is crucial for the automatic linting and formatting to work correctly.

## Steps to run locally
With Docker

* ```docker compose up```
With Docker:

* `docker compose up`

Without Docker:

Without Docker
* ```npm install```
* ```npm run db:seed``` to seed the database
* ```npm run dev```
* Login using any userid and password 123456
* `npm install`
* `npm run db:seed` to seed the database
* `npm run dev`
* Login using any userid and password `123456`
* You should be able to see some test courses

---

Read [contributing guidelines](./CONTRIBUTING.md) to start making contributions
Read [contributing guidelines](./CONTRIBUTING.md) to start making contributions.
10 changes: 7 additions & 3 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
const nextConfig = {
experimental: {
serverActions: {
allowedOrigins: ['localhost:3000', 'app.100xdevs.com', 'app2.100xdevs.com']
}
}
allowedOrigins: [
'localhost:3000',
'app.100xdevs.com',
'app2.100xdevs.com',
],
},
},
};

module.exports = nextConfig;
Loading

0 comments on commit da22388

Please sign in to comment.