Skip to content

Commit 399be09

Browse files
committed
init project
1 parent 5b878f3 commit 399be09

36 files changed

+3217
-301
lines changed

.eslintrc.json

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,65 @@
11
{
2-
"extends": "next/core-web-vitals"
2+
// Configuration for JavaScript files
3+
"extends": [
4+
"airbnb-base",
5+
"next/core-web-vitals", // Needed to avoid warning in next.js build: 'The Next.js plugin was not detected in your ESLint configuration'
6+
"plugin:prettier/recommended"
7+
],
8+
"rules": {
9+
"prettier/prettier": [
10+
"error",
11+
{
12+
"singleQuote": true,
13+
"endOfLine": "auto"
14+
}
15+
],
16+
"no-underscore-dangle": "off",
17+
"consistent-return": "off",
18+
"array-callback-return": "off",
19+
"no-console": "off",
20+
"import/prefer-default-export": "off",
21+
"no-param-reassign": "off"
22+
},
23+
"overrides": [
24+
// Configuration for TypeScript files
25+
{
26+
"files": ["**/*.ts", "**/*.tsx", "**/**/*.tsx"],
27+
"plugins": [
28+
"@typescript-eslint",
29+
"tailwindcss",
30+
"simple-import-sort",
31+
"react-hooks"
32+
],
33+
"extends": [
34+
"plugin:tailwindcss/recommended",
35+
"airbnb-typescript",
36+
"next/core-web-vitals",
37+
"plugin:prettier/recommended"
38+
],
39+
"parserOptions": {
40+
"project": "./tsconfig.json"
41+
},
42+
"rules": {
43+
"react-hooks/rules-of-hooks": "error",
44+
"prettier/prettier": [
45+
"error",
46+
{
47+
"singleQuote": true,
48+
"endOfLine": "auto"
49+
}
50+
],
51+
"react/destructuring-assignment": "off", // Vscode doesn't support automatically destructuring, it's a pain to add a new variable
52+
"react/require-default-props": "off", // Allow non-defined react props as undefined
53+
"react/jsx-props-no-spreading": "off", // _app.tsx uses spread operator and also, react-hook-form
54+
"react-hooks/exhaustive-deps": "warn",
55+
"@next/next/no-img-element": "off", // We currently not using next/image because it isn't supported with SSG mode
56+
"@typescript-eslint/comma-dangle": "off", // Avoid conflict rule between Eslint and Prettier
57+
"@typescript-eslint/consistent-type-imports": "error", // Ensure `import type` is used when it's necessary
58+
"import/prefer-default-export": "off", // Named export is easier to refactor automatically
59+
"simple-import-sort/imports": "error", // Import configuration for `eslint-plugin-simple-import-sort`
60+
"simple-import-sort/exports": "error", // Export configuration for `eslint-plugin-simple-import-sort`
61+
"@typescript-eslint/no-unused-vars": "error"
62+
}
63+
}
64+
]
365
}

.github/workflows/main.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: MAIN
2+
on: push
3+
jobs:
4+
lint:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Get Code
8+
uses: actions/checkout@v3
9+
- name: Cache Dependencies
10+
uses: actions/cache@v3
11+
with:
12+
path: ~/.npm
13+
key: npm-deps-${{ hashFiles('**/package-lock.json') }}
14+
- name: Install Dependencies
15+
run: npm ci
16+
- name: Check lint
17+
run: npm run lint

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ yarn-error.log*
2727

2828
# local env files
2929
.env*.local
30+
.env
3031

3132
# vercel
3233
.vercel

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"useTabs": false,
3+
"endOfLine": "auto",
4+
"jsxSingleQuote": false,
5+
"singleQuote": true,
6+
"semi": false,
7+
"tabWidth": 2,
8+
"trailingComma": "es5",
9+
"bracketSameLine": false,
10+
"arrowParens": "always"
11+
}

.vscode/settings.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.tabSize": 2,
4+
"eslint.probe": [
5+
"javascript",
6+
"javascriptreact",
7+
"typescript",
8+
"typescriptreact"
9+
],
10+
"editor.formatOnSave": true,
11+
"editor.formatOnPaste": false,
12+
"editor.codeActionsOnSave": [
13+
"source.formatDocument",
14+
"source.addMissingImports",
15+
"source.fixAll.eslint"
16+
],
17+
"[prisma]": {
18+
"editor.defaultFormatter": "Prisma.prisma"
19+
}
20+
}

0 commit comments

Comments
 (0)