Skip to content
Merged
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
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
25 changes: 12 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: ['**']
branches: ['**'] # run on pushes to all branches
paths:
- 'src/**'
- 'plugins/**'
Expand All @@ -13,28 +13,24 @@ on:
- 'vitest.config.js'
- '.github/workflows/**'
pull_request:
branches: ['**']
branches: ['**'] # run on PRs against any branch

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
# Primary job: use webpack build (stable), then test with coverage.
# Primary job: format/lint, webpack build, then tests with coverage.
build-and-test:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
node-version: [22.x] # stick to Node 22 LTS for CI stability
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
- name: Setup Node.js (from .nvmrc)
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version-file: .nvmrc
cache: npm

- name: Install dependencies
Expand All @@ -45,9 +41,12 @@ jobs:
npm install
fi

- name: Check formatting
- name: Prettier check
run: npm run format-check

- name: ESLint
run: npm run lint

# Use the webpack build for CI stability (dist via webpack)
- name: Build (webpack)
run: npm run build
Expand All @@ -61,7 +60,7 @@ jobs:
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.node-version }}
name: coverage
path: coverage
if-no-files-found: ignore

Expand All @@ -74,10 +73,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js 22
- name: Setup Node.js (from .nvmrc)
uses: actions/setup-node@v4
with:
node-version: 22.x
node-version-file: .nvmrc
cache: npm

- name: Install dependencies
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
dist
.idea/
coverage/
coverage/
.eslintcache
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Only format and lint what's staged (fast)
npx lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.21.1
69 changes: 69 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import js from '@eslint/js';
import prettier from 'eslint-config-prettier';

export default [
{
ignores: ['dist/', 'node_modules/', 'coverage/', 'types/'],
},
js.configs.recommended,
prettier,
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
// Browser globals
window: 'readonly',
document: 'readonly',
navigator: 'readonly',
console: 'readonly',
alert: 'readonly',
HTMLElement: 'readonly',
HTMLVideoElement: 'readonly',
HTMLCanvasElement: 'readonly',
Image: 'readonly',
ImageData: 'readonly',
fetch: 'readonly',
CustomEvent: 'readonly',
MediaStream: 'readonly',
performance: 'readonly',
screen: 'readonly',
location: 'readonly',
WebAssembly: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
requestAnimationFrame: 'readonly',
cancelAnimationFrame: 'readonly',
// Node.js globals
process: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
require: 'readonly',
module: 'readonly',
exports: 'readonly',
// Testing globals (vitest)
describe: 'readonly',
test: 'readonly',
it: 'readonly',
expect: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
beforeAll: 'readonly',
afterAll: 'readonly',
vi: 'readonly',
// AR.js specific globals
ArToolkitContext: 'writable',
ArMarkerControls: 'writable',
},
},
rules: {
// Relax rules for existing codebase patterns
'no-empty': 'off',
'no-unused-vars': 'off',
'no-unused-private-class-members': 'off',
'no-redeclare': 'off',
},
},
];
Loading