Skip to content

Commit 1fbfe36

Browse files
committed
Merge branch 'main' of github.com:raifdmueller/Semantic-Anchors
2 parents 7e1c260 + 1f1c70b commit 1fbfe36

20 files changed

Lines changed: 3078 additions & 531 deletions

.github/workflows/codeql.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CodeQL Security Analysis
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
# Run weekly on Mondays at 08:00 UTC
10+
- cron: '0 8 * * 1'
11+
12+
jobs:
13+
analyze:
14+
name: Analyze (${{ matrix.language }})
15+
runs-on: ubuntu-latest
16+
permissions:
17+
actions: read
18+
contents: read
19+
security-events: write
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
language: [javascript-typescript]
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Initialize CodeQL
31+
uses: github/codeql-action/init@v3
32+
with:
33+
languages: ${{ matrix.language }}
34+
queries: security-extended
35+
36+
- name: Autobuild
37+
uses: github/codeql-action/autobuild@v3
38+
39+
- name: Perform CodeQL Analysis
40+
uses: github/codeql-action/analyze@v3
41+
with:
42+
category: '/language:${{ matrix.language }}'

.github/workflows/test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,32 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11+
lint:
12+
name: Lint & Format Check
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20'
22+
cache: 'npm'
23+
cache-dependency-path: website/package-lock.json
24+
25+
- name: Install dependencies
26+
working-directory: ./website
27+
run: npm ci
28+
29+
- name: Run ESLint
30+
working-directory: ./website
31+
run: npm run lint
32+
33+
- name: Check Prettier formatting
34+
working-directory: ./website
35+
run: npm run format:check
36+
1137
e2e-tests:
1238
name: E2E Tests
1339
runs-on: ubuntu-latest

website/.prettierrc

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

website/eslint.config.js

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import js from '@eslint/js'
2+
import prettierConfig from 'eslint-config-prettier'
3+
4+
const browserGlobals = {
5+
window: 'readonly',
6+
document: 'readonly',
7+
console: 'readonly',
8+
navigator: 'readonly',
9+
fetch: 'readonly',
10+
URL: 'readonly',
11+
URLSearchParams: 'readonly',
12+
history: 'readonly',
13+
location: 'readonly',
14+
localStorage: 'readonly',
15+
sessionStorage: 'readonly',
16+
setTimeout: 'readonly',
17+
clearTimeout: 'readonly',
18+
setInterval: 'readonly',
19+
clearInterval: 'readonly',
20+
HTMLElement: 'readonly',
21+
Event: 'readonly',
22+
CustomEvent: 'readonly',
23+
KeyboardEvent: 'readonly',
24+
HashChangeEvent: 'readonly',
25+
MutationObserver: 'readonly',
26+
IntersectionObserver: 'readonly',
27+
requestAnimationFrame: 'readonly',
28+
performance: 'readonly',
29+
}
30+
31+
export default [
32+
js.configs.recommended,
33+
prettierConfig,
34+
{
35+
languageOptions: {
36+
ecmaVersion: 2024,
37+
sourceType: 'module',
38+
globals: browserGlobals,
39+
},
40+
rules: {
41+
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
42+
'no-console': ['warn', { allow: ['warn', 'error'] }],
43+
},
44+
ignores: [
45+
'node_modules/**',
46+
'dist/**',
47+
'playwright-report/**',
48+
'.lighthouseci/**',
49+
'test-results/**',
50+
],
51+
},
52+
{
53+
files: ['**/*.test.js', 'tests/**/*.js', 'playwright.config.js'],
54+
languageOptions: {
55+
globals: {
56+
...browserGlobals,
57+
global: 'writable',
58+
describe: 'readonly',
59+
it: 'readonly',
60+
test: 'readonly',
61+
expect: 'readonly',
62+
beforeEach: 'readonly',
63+
afterEach: 'readonly',
64+
beforeAll: 'readonly',
65+
afterAll: 'readonly',
66+
vi: 'readonly',
67+
},
68+
},
69+
rules: {
70+
'no-console': 'off',
71+
},
72+
},
73+
]

0 commit comments

Comments
 (0)