Skip to content

Commit

Permalink
Merge pull request #2 from sziget/linter
Browse files Browse the repository at this point in the history
Linter
  • Loading branch information
joemeszaros authored Jan 17, 2025
2 parents 36b71fd + caac995 commit 27e81ac
Show file tree
Hide file tree
Showing 10 changed files with 1,357 additions and 3 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Checks

on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
eslint:
name: ESLint check
uses: ./.github/workflows/eslint.yml

prettier:
name: Prettier check
uses: ./.github/workflows/prettier.yml

tests:
name: Run tests
uses: ./.github/workflows/tests.yml
25 changes: 25 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: ESLint

on:
workflow_dispatch:
workflow_call:

jobs:
eslint-check:
name: ESLint check
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 22

- name: Install Node.js dependencies
run: npm ci

- name: Run ESLint check
run: npx eslint src/**
25 changes: 25 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Prettier

on:
workflow_dispatch:
workflow_call:

jobs:
prettier-check:
name: Prettier check
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 22

- name: Install Node.js dependencies
run: npm ci

- name: Run Prettier check
run: npx prettier ./src/** --check
25 changes: 25 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Tests

on:
workflow_dispatch:
workflow_call:

jobs:
run-tests:
name: Run Tests
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 22

- name: Install Node.js dependencies
run: npm ci

- name: Run Tests
run: npm run test
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.vscode/*
app.mjs
node_modules/
package.json
package-lock.json
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore directory .github:
.github/
dependencies/
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"quoteProps": "as-needed",
"trailingComma": "none",
"eslintIntegration": true,
"plugins": ["@yikes2000/prettier-plugin-merge-extras"],
"plugins": ["@yikes2000/prettier-plugin-merge-extras","eslint-plugin-prettier"],
"preserveDotChain": true,
"preserveFirstBlankLine": true
}
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ import pluginJs from "@eslint/js";
export default [
{languageOptions: { globals: globals.browser }},
pluginJs.configs.recommended,
{ignores: [".github/*","dependencies/*"]}, // <<< ignore all files in folders
];
Loading

0 comments on commit 27e81ac

Please sign in to comment.