Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added contributing docs and github workflows standard #10

Merged
merged 9 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.github
120 changes: 120 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
parser: "@typescript-eslint/parser"

env:
node: true
es6: true
jest: true
mocha: true
browser: true

plugins:
- "@typescript-eslint"

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

parserOptions:
ecmaVersion: 2018

rules:
# Ignore Rules
strict: 0
no-underscore-dangle: 0
no-mixed-requires: 0
no-process-exit: 0
no-warning-comments: 0
no-use-before-define: 0
curly: 0
no-multi-spaces: 0
no-alert: 0
consistent-return: 0
consistent-this: [0, self]
func-style: 0
max-nested-callbacks: 0
camelcase: 0
no-dupe-class-members: 0

# Warnings
no-debugger: 1
no-empty: 1
no-invalid-regexp: 1
no-unused-expressions: 1
no-native-reassign: 1
no-fallthrough: 1

# Errors
eqeqeq: 2
no-undef: 2
no-dupe-keys: 2
no-empty-character-class: 2
no-self-compare: 2
valid-typeof: 2
handle-callback-err: 2
no-shadow-restricted-names: 2
no-new-require: 2
no-mixed-spaces-and-tabs: 2
block-scoped-var: 2
no-else-return: 2
no-throw-literal: 2
no-void: 2
radix: 2
wrap-iife: [2, outside]
no-shadow: 0
no-path-concat: 2
valid-jsdoc: [0, {requireReturn: false, requireParamDescription: false, requireReturnDescription: false}]

# stylistic errors
no-spaced-func: 2
semi-spacing: 2
key-spacing: [2, { beforeColon: false, afterColon: true }]
no-lonely-if: 2
no-floating-decimal: 2
brace-style: [2, 1tbs, { allowSingleLine: true }]
comma-style: [2, last]
no-multiple-empty-lines: [2, {max: 1}]
no-nested-ternary: 2
operator-assignment: [2, always]
padded-blocks: [2, never]
quote-props: [2, as-needed]
keyword-spacing: [2, {'before': true, 'after': true, 'overrides': {}}]
space-before-blocks: [2, always]
array-bracket-spacing: [2, never]
computed-property-spacing: [2, never]
space-in-parens: [2, never]
space-unary-ops: [2, {words: true, nonwords: false}]
wrap-regex: 2
linebreak-style: 0
semi: [2, always]
arrow-spacing: [2, {before: true, after: true}]
no-class-assign: 2
no-const-assign: 2
no-this-before-super: 2
no-var: 2
object-shorthand: [2, always]
prefer-arrow-callback: 2
prefer-const: 2
prefer-spread: 2
prefer-template: 2

# TypeScript
"@typescript-eslint/no-empty-interface": "off"
"@typescript-eslint/no-use-before-define": ["off"]
"@typescript-eslint/no-empty-function": "off"
"@typescript-eslint/ban-ts-comment": "off"
"@typescript-eslint/no-explicit-any": "off"
"@typescript-eslint/explicit-module-boundary-types": "off"
"@typescript-eslint/no-this-alias": "off"
"@typescript-eslint/no-unnecessary-type-constraint": "off"
"@typescript-eslint/ban-types": "off"

overrides:
- files:
- "test/**"
- "*.spec.ts"
- "*.test.ts"
rules:
prefer-arrow-callback: 0
"@typescript-eslint/no-non-null-assertion": 0
"@typescript-eslint/no-unused-vars": 0
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug
about: Create a report to help us improve
title: "bug: "
labels: bug
assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Do something
2. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots or GIFs**
If applicable, add screenshots to help explain your problem.

**Info (please complete the following information):**
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: 'feature: '
labels: enhancement
assignees: ''
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### PR Fixes:
- 1
- 2

Resolves #[Issue Number if there]

### Checklist before requesting a review
- [ ] I have performed a self-review of my code
- [ ] I assure there is no similar/duplicate pull request regarding same issue
32 changes: 32 additions & 0 deletions .github/workflows/lint_and_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Linting, formatting and Build on PR
on:
pull_request:
branches:
- dev

jobs:
Continuous-Integration:
name: Performs linting, formatting on the application
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v3

- uses: actions/setup-node@v4
with:
node-version: 20

- name: Install yarn
run: npm install -g yarn

- name: Install Dependencies
run: yarn --legacy-peer-deps

- name: Run linting check
run: yarn run lint:check

- name: Check formatting
run: yarn run format:check

- name: Build
run: yarn run build
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.github
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all"
}
79 changes: 79 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Starkfarm Client

![image](https://avatars.githubusercontent.com/u/165751591?s=200&v=4)

Starkfarm Client is a web application built using [Next.js](https://nextjs.org/), bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Table of Contents

- [Starkfarm Client](#starkfarm-client)
- [Table of Contents](#table-of-contents)
- [Getting Started](#getting-started)
- [Contributing](#contributing)
- [All Thanks To Our Contributors](#all-thanks-to-our-contributors)

## Getting Started

To run the project locally and start using Starkfarm Client, follow these steps:

1. Clone the repository:

```bash
git clone https://github.com/yourusername/starkfarm-client.git
```

2. Navigate to the project directory:

```bash
cd starkfarm-client
```

3. Install dependencies:

```bash
npm install
# or
yarn install
# or
pnpm install
```

4. Start the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
```

5. Make sure to lint and format your code before creating a PR

- `npm run lint:check` to check for lint errors
- `npm run lint:fix` to fix lint errors
- `npm run format:check` to format the code
- `npm run format:fix` to fix the formatting
- If the code is not formatted properly, the CI will fail

Open [http://localhost:3000](http://localhost:3000) in your browser to see the Starkfarm Client in action.

For more details on API routes, check out [the API documentation](https://nextjs.org/docs/api-routes/introduction) and edit the routes in `src/app/api`.

<!-- ## Key Features -->

<!-- ## How It Works -->

## Contributing

We welcome contributions from the community to enhance Starkfarm Client further. If you're interested in contributing, please read our [Contributing Guidelines](CONTRIBUTING.md) for detailed information on how to get started.

## All Thanks To Our Contributors

<a href="https://github.com/strkfarm/starkfarm-client/graphs/contributors">
<img src="https://contrib.rocks/image?repo=strkfarm/starkfarm-client" />
</a>

<!-- ## License

This project is licensed under the [GNU General Public License v3.0](https://github.com/strkfarm/Starkfarm-client/blob/main/LICENCE). -->
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"lint:check": "eslint --max-warnings 0 --config .eslintrc .",
"lint:fix": "eslint --max-warnings 0 --config .eslintrc . --fix",
"format:check": "prettier --check \"**/*.{ts,tsx,json}\"",
"format:fix": "prettier --write \"**/*.{ts,tsx,json}\""
},
"dependencies": {
"@ajna/pagination": "^1.4.19",
Expand Down Expand Up @@ -50,10 +54,13 @@
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@typescript-eslint/eslint-plugin": "^7.7.0",
"@typescript-eslint/parser": "^7.7.0",
"autoprefixer": "^10.0.1",
"eslint": "^8",
"eslint-config-next": "14.1.0",
"postcss": "^8",
"prettier": "^3.2.5",
"tailwindcss": "^3.3.0",
"typescript": "^5"
},
Expand Down
Loading