Skip to content

Commit 5670946

Browse files
committed
chore: standardize CI/CD workflows
- Add ESLint + Prettier to site/ - Add .github/workflows/ci.yml (lint + build on PRs) - Rename pages.yml to deploy.yml - Add npm lint/lint:fix/format/format:check scripts - Fix missing L (Leaflet) import in cross-links.js caught by eslint Affects: bassin-minier-unesco See MAINTENANCE_PLAN/02-CICD-WORKFLOWS.md
1 parent 110fe36 commit 5670946

7 files changed

Lines changed: 1083 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches-ignore:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 15
16+
steps:
17+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
18+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
19+
with:
20+
node-version: 22
21+
cache: npm
22+
cache-dependency-path: site/package-lock.json
23+
- run: npm ci
24+
working-directory: site
25+
- run: npm run lint
26+
working-directory: site
27+
- run: npm run build
28+
working-directory: site

site/.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"trailingComma": "es5",
5+
"printWidth": 100,
6+
"tabWidth": 2
7+
}

site/eslint.config.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import js from '@eslint/js';
2+
import prettier from 'eslint-plugin-prettier';
3+
import globals from 'globals';
4+
5+
export default [
6+
{ ignores: ['dist/**'] },
7+
js.configs.recommended,
8+
{
9+
files: ['src/**/*.js'],
10+
languageOptions: {
11+
ecmaVersion: 2022,
12+
sourceType: 'module',
13+
globals: {
14+
...globals.browser,
15+
},
16+
},
17+
plugins: {
18+
prettier: prettier,
19+
},
20+
rules: {
21+
'prettier/prettier': 'warn',
22+
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
23+
'no-console': 'warn',
24+
},
25+
},
26+
{
27+
files: ['vite.config.js'],
28+
languageOptions: {
29+
ecmaVersion: 2022,
30+
sourceType: 'module',
31+
globals: {
32+
...globals.node,
33+
},
34+
},
35+
},
36+
];

0 commit comments

Comments
 (0)