Skip to content

Commit

Permalink
Added prettier and eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Maghish committed Nov 11, 2024
1 parent 2c01718 commit c5e1b80
Show file tree
Hide file tree
Showing 5 changed files with 1,128 additions and 25 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/eslint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: ESLint

on:
push:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: npm install

- name: Run ESLint
run: npm run lint

- name: Upload ESLint report
uses: actions/upload-artifact@v2
with:
name: eslint-report
path: eslint-report.json
27 changes: 27 additions & 0 deletions .github/workflows/prettier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Prettier

on:
push:
branches:
- main

jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: npm install

- name: Run Prettier
run: npx prettier --write .

- name: Commit changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add .
git commit -m "Format code with Prettier (fixes ${GITHUB_EVENT_BEFORE})"
git push origin main
10 changes: 10 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
rules: {
"no-console": "off",
"no-debugger": "off",
"no-unused-vars": "off",
"no-useless-escape": "error",
quotes: ["error", "double"],
semi: "off",
},
};
Loading

0 comments on commit c5e1b80

Please sign in to comment.