Skip to content

Commit

Permalink
chore: add eslint workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
BallardRobinett committed Feb 7, 2024
1 parent 6a070bf commit 8af5423
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 17 deletions.
6 changes: 0 additions & 6 deletions .bin/pre-commit-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

set -euxo pipefail

# Check if ESLint is installed
if ! command -v eslint &> /dev/null; then
echo "ESLint is not installed. Installing ESLint..."
yarn add eslint --dev
fi

pushd client || exit 1
files=("$@")
files=("${files[@]/#/../}") # add ../ to each element
Expand Down
31 changes: 31 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
"env": {
"browser": true,
"es2021": true
},
"extends": "plugin:react/recommended",
"overrides": [
{
"env": {
"node": true
},
"files": [
".eslintrc.{js,cjs}"
],
"parserOptions": {
"sourceType": "script"
}
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"react"
],
"rules": {
}
}
11 changes: 0 additions & 11 deletions .eslintrc.yml

This file was deleted.

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, develop, 127-fix-precommit-conditions]
pull_request:
branches: [main, develop]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 20
- name: Install dependencies
run: yarn install

- name: Run ESLint
run: yarn run eslint

0 comments on commit 8af5423

Please sign in to comment.