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
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run lint
run: yarn lint
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"printWidth": 80,
"tabWidth": 2
}
18 changes: 18 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import globals from "globals";
import { defineConfig } from "eslint/config";
import eslintConfigPrettier from "eslint-config-prettier/flat";

export default defineConfig([
{
files: ["**/*.{js,mjs,cjs}"],
languageOptions: { globals: { ...globals.browser, ...globals.node } },
rules: {
"spaced-comment": ["error", "always"],
"capitalized-comments": ["error", "always"],
},
},
{
ignores: ["dist/*", "tests/coverage/*"],
},
eslintConfigPrettier,
]);
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"prebuild": "rimraf dist",
"build": "webpack --config webpack.config.js --mode production",
"start": "webpack serve --config webpack.config.js --mode development",
"format": "prettier --write \"**/*.js\"",
"lint": "eslint && prettier --check \"**/*.js\"",
"lint:fix": "eslint --fix && prettier --write \"**/*.js\"",
"postinstall": "patch-package",
"test": "jest --config tests/jest.config.js",
"upload-examples": "node scripts/uploadExamples.js",
Expand Down Expand Up @@ -37,6 +38,9 @@
"bson-objectid": "^2.0.4",
"cross-fetch": "^4.0.0",
"dotenv": "^16.4.5",
"eslint": "^9.32.0",
"eslint-config-prettier": "^10.1.8",
"globals": "^16.3.0",
"html-webpack-plugin": "^5.5.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
Expand Down
Loading