Skip to content
Open
Show file tree
Hide file tree
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
37 changes: 0 additions & 37 deletions .eslintrc

This file was deleted.

27 changes: 21 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,42 @@ updates:
directory: "/"
schedule:
interval: weekly
time: "11:00"
open-pull-requests-limit: 10
reviewers:
- lewisgoddard
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
time: "11:00"
open-pull-requests-limit: 10
reviewers:
- lewisgoddard
allow:
- dependency-type: "all"
groups:
npm-patching:
update-types:
- "minor"
- "patch"
- package-ecosystem: composer
directory: "/_backend"
schedule:
interval: weekly
time: "11:00"
open-pull-requests-limit: 10
reviewers:
- lewisgoddard
allow:
- dependency-type: "all"
groups:
composer-patching:
update-types:
- "minor"
- "patch"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
reviewers:
- lewisgoddard
groups:
gha-patching:
update-types:
- "minor"
- "patch"
112 changes: 8 additions & 104 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,112 +7,16 @@ on:
types:
- opened
- reopened
- ready_for_review
- synchronize
push:
branches:
- master

permissions:
contents: read

jobs:
Lint_Css:
name: Lint (CSS)
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@2.37.1
with:
php-version: '8.1'
tools: composer

- name: Setup Node.js
uses: actions/setup-node@v6.4.0
with:
node-version: 18

- name: Install
run: npm ci

- name: Lint
run: npx stylelint "_styles/**/*.css" -f github

Lint_Javascript:
name: Lint (JS)
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@2.37.1
with:
php-version: 8.1
tools: composer

- name: Setup Node.js
uses: actions/setup-node@v6.4.0
with:
node-version: 18

- name: Install
run: npm ci

- name: Lint
run: ./_tests/javascript.sh

Lint_Php:
name: Lint (PHP)
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@2.37.1
with:
php-version: 8.1
tools: composer

- name: Setup Node.js
uses: actions/setup-node@v6.4.0
with:
node-version: 18

- name: Install
run: npm ci

- name: Lint
run: ./_tests/php.sh

Lint_Translations:
name: Lint (Translations)
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@2.37.1
with:
php-version: 8.1
tools: composer

- name: Setup Node.js
uses: actions/setup-node@v6.4.0
with:
node-version: 18

- name: Install
run: npm ci

- name: Lint
run: php ./_tests/translations.php

Build:
runs-on: ubuntu-latest

Expand All @@ -121,15 +25,15 @@ jobs:
uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@2.37.1
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # v2.37.1
with:
php-version: 8.1
php-version: 8.1 # This PHP version matches the server.
tools: composer

- name: Setup Node.js
uses: actions/setup-node@v6.4.0
uses: actions/setup-node@v6
with:
node-version: 18
node-version: 18 # This Node version matches the server.

- name: Install
run: npm ci
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---

name: Lint

on:
pull_request:
types:
- opened
- reopened
- ready_for_review
- synchronize
push:
branches:
- master

permissions:
contents: read

jobs:
Lint:
name: Lint (${{ matrix.label }})
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- label: CSS
command: npx stylelint "_styles/**/*.css" --custom-formatter @csstools/stylelint-formatter-github
- label: JS
command: ./_tests/javascript.sh
- label: PHP
command: ./_tests/php.sh
- label: Translations
command: php ./_tests/translations.php

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # v2.37.1
with:
php-version: '8.5'
tools: composer

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 'lts/*'

- name: Install
run: npm ci

- name: Lint
run: ${{ matrix.command }}
45 changes: 45 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Migrated from eslint-config-standard (deprecated)
// Now uses maintained packages with equivalent rules
import prettier from "eslint-config-prettier";
import importX from "eslint-plugin-import-x";
import n from "eslint-plugin-n";
import promise from "eslint-plugin-promise";
import globals from "globals";

export default [
{
languageOptions: {
ecmaVersion: 2024,
sourceType: "module",
globals: {
...globals.browser,
...globals.node,
...globals.jquery,
},
},
plugins: {
"import-x": importX,
n,
promise,
},
rules: {
// Import rules (standard's style)
"import-x/order": [
"error",
{
groups: ["builtin", "external", "internal", "parent", "sibling", "index"],
alphabetize: { order: "asc" },
},
],

// Node rules
"n/no-extraneous-require": "error",
"n/hashbang": "off",

// Promise rules
"promise/catch-or-return": "error",
"promise/no-nesting": "warn",
},
},
prettier,
];
Loading