Skip to content

Commit

Permalink
chore: Configure ESLint and Git Pre commit hook
Browse files Browse the repository at this point in the history
- configure eslint and prettier format

Delivers #187419115
  • Loading branch information
Heisjabo committed Jun 9, 2024
1 parent 3f8a19f commit fcf98a7
Show file tree
Hide file tree
Showing 19 changed files with 5,511 additions and 969 deletions.
57 changes: 55 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,71 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
env: {
browser: true,
es2020: true,
node: true,
},
extends: [
"eslint:recommended",
"airbnb",
"airbnb-typescript",
"airbnb/hooks",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.eslint.json",
},
plugins: ["react-refresh"],
rules: {
"react/react-in-jsx-scope": "off",
"react/function-component-definition": [
"warn",
{
namedComponents: "arrow-function",
unnamedComponents: "arrow-function",
},
],
"no-undef": "off",
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"@typescript-eslint/quotes": ["off"],
"arrow-body-style": ["warn", "as-needed"],
"import/order": [
"warn",
{
groups: [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
],
"newlines-between": "always",
},
],
"@typescript-eslint/comma-dangle": ["warn", "always-multiline"],
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: [
"vite.config.ts",
"postcss.config.js",
"tailwind.config.js",
],
},
],
"import/extensions": ["off"],
},
settings: {
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
},
};
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 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run test
10 changes: 10 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"tabWidth": 2,
"useTabs": false,
"singleQuote": false,
"semi": true,
"bracketSpacing": true,
"arrowParens": "always",
"bracketSameLine": true,
"endOfLine": "auto"
}
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# EAGLE E-commerce

<img alt="Static Badge" src="https://img.shields.io/badge/Reviewed_By-HoundCI-blue?style=flat-square">

The front-end of Eagle E-commerce utilizes React for a modern, user-friendly interface, while Node.js powers its backend, ensuring a seamless shopping experience

[![Maintainability](https://api.codeclimate.com/v1/badges/81fa30232b27b1482f4f/maintainability)](https://codeclimate.com/github/atlp-rwanda/eagles-ec-fe/maintainability)
Expand All @@ -15,18 +17,25 @@ This project was built using the PERN (PostgreSQL, Express.js, React.js, Node.js
To run the app locally, follow these steps:

1. **Clone the repository:**

```bash
git clone https://github.com/atlp-rwanda/eagles-ec-fe.git
```
```

2. **Change working dir to cloned repo:**

```bash
cd eagle-ec-fe
```

3. **Install dependencies:**

```bash
npm install
```

4. **Run developmnt server:**

```bash
npm run dev
```
Expand All @@ -44,4 +53,5 @@ npm install
```bash
npm run test:coverage
```
Write your test by creating a file with .test.tsx extetion under __test__ directory.
Write your test by creating a file with .test.tsx extetion under __test__ directory.
```
9 changes: 9 additions & 0 deletions hound.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
eslint:
enabled: true
file_patterns:
- "*.js"
- "*.ts"
enabled_plugins:
- eslint-plugin-import
- eslint-plugin-prettier
- eslint-plugin:@typescript-eslint
Loading

0 comments on commit fcf98a7

Please sign in to comment.