Skip to content

Commit

Permalink
Merge pull request #2 from OSDG-IIITH/introduce_workflows
Browse files Browse the repository at this point in the history
actions: add eslint and prettier
  • Loading branch information
ankith26 authored Jun 14, 2024
2 parents ab0494c + bbe8f45 commit cb9743f
Show file tree
Hide file tree
Showing 17 changed files with 775 additions and 312 deletions.
34 changes: 34 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'airbnb',
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'eslint-config-prettier',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
overrides: [
{
env: {
node: true,
},
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script',
},
},
],
plugins: ['react-refresh', 'import'],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
'no-console': 0,
},
};
30 changes: 30 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Auto Formatting

on:
push:
branches:
- main
workflow_dispatch:

jobs:
formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install Prettier
run: |
npm install --global prettier
- name: Format with Prettier
run: prettier --write "**/*.{js,jsx,md,mdx,css,yaml}"

- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply Prettier Formatting Fixes
25 changes: 25 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint

on:
pull_request:
branches:
- main

jobs:
linting:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Install NodeJS
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}

- name: Code Checkout
uses: actions/checkout@v2

- name: Install Dependencies
run: npm ci

- name: Code Linting
run: npm run lint
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "es5"
}
8 changes: 0 additions & 8 deletions README (1).md

This file was deleted.

Loading

0 comments on commit cb9743f

Please sign in to comment.