Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint JS code with Prettier #2503

Merged
merged 3 commits into from
Jun 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ name: Lint
on: [pull_request]

jobs:
Lint:
Standard:
runs-on: ubuntu-latest
steps:
- name: Checkout code
@@ -15,3 +15,23 @@ jobs:
bundler-cache: true
- name: Lint Ruby files
run: bundle exec standardrb
Prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Restore node_modules cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('package.json') }}
restore-keys: |
${{ runner.os }}-node-modules
- name: Install dependencies
run: yarn install
- name: Lint code
run: yarn lint
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Test

on: [push, pull_request]

2 changes: 1 addition & 1 deletion app/javascript/alchemy_admin/page_publication_fields.js
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ export default function () {
)
const public_field = dialog.querySelector("#page_public")

if(!public_field) return
if (!public_field) return

public_field.addEventListener("click", function (evt) {
const checkbox = evt.target
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "alchemy_admin",
"scripts": {
"test": "jest"
"test": "jest",
"lint": "prettier --check 'app/javascript/**/*.js'"
},
"keywords": [],
"author": "Thomas von Deyen",