Skip to content

Commit

Permalink
Merge pull request #49 from Nolulamo/develop
Browse files Browse the repository at this point in the history
Create GitHub Action for linting Front End code #26
  • Loading branch information
terrameijar authored Feb 26, 2024
2 parents bd5299e + a09256e commit e1a4b99
Show file tree
Hide file tree
Showing 11 changed files with 1,231 additions and 204 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/front_end_eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Front-end Eslint

on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Update npm
working-directory: frontend
run: npm install -g npm@latest
- name: Install dependencies
working-directory: frontend
run : npm install
- name: Lint code
working-directory: frontend
run: npm run lint

20 changes: 0 additions & 20 deletions frontend/.eslintrc.cjs

This file was deleted.

36 changes: 36 additions & 0 deletions frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"indent": [
"error",
"tab"
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
]
}
}
11 changes: 11 additions & 0 deletions frontend/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"singleQuote": false,
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"printWidth": 80,
"useTabs": true,
"jsxSingleQuote": false,
"arrowParens": "always",
"jsxBracketSameLine": false
}
Loading

0 comments on commit e1a4b99

Please sign in to comment.