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
28 changes: 28 additions & 0 deletions .github/workflows/lint-javascript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check JavaScript formatting

on:
pull_request:
paths:
- '**/*.{js,mjs,cjs}'
- 'package*.json'
- .github/workflows/lint-javascript.yml
workflow_dispatch:

permissions:
contents: read

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: .node-version
cache: npm
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npm run format:javascript:check
14 changes: 8 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,14 @@ npm run lint:fix

Alternatively use any of the following commands to call one of the underlying linting utilities:

| Command | Purpose |
| ------------------------------- | --------------------------------------- |
| `npm run format:toc` | Reformats any Table of Contents |
| `npm run format:toc:check` | Read-only Table of Contents check |
| `npm run format:prettier` | Reformats multiple types of source code |
| `npm run format:prettier:check` | Read-only prettier check |
| Command | Purpose |
| --------------------------------- | --------------------------------------- |
| `npm run format:toc` | Reformats any Table of Contents |
| `npm run format:toc:check` | Read-only Table of Contents check |
| `npm run format:prettier` | Reformats multiple types of source code |
| `npm run format:prettier:check` | Read-only prettier check |
| `npm run format:javascript` | Reformats JavaScript source code |
| `npm run format:javascript:check` | Read-only ESLint check |

## Link checks

Expand Down
1 change: 1 addition & 0 deletions build-automation.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const checkIfThereAreNewVersions = async (github) => {
if (latestSupportedVersions[availableMajor] == null) {
continue;
}
// eslint-disable-next-line no-unused-vars
const [_latestMajor, latestMinor, latestPatch] =
latestSupportedVersions[availableMajor].fullVersion.split('.');
if (
Expand Down
12 changes: 12 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import js from '@eslint/js';
import globals from 'globals';
import { defineConfig } from 'eslint/config';

export default defineConfig([
{
files: ['**/*.{js,mjs,cjs}'],
plugins: { js },
extends: ['js/recommended'],
languageOptions: { globals: globals.node },
},
]);
Loading