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
29 changes: 19 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
name: tests
name: Tests

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

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: ["20"]
name: Node.js ${{ matrix.node_version }}
node-version: ["20.x", "21.x", "22.x"] # Updated to include Node.js 22.x

name: Node.js ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: "npm"
- run: npm install
- run: npm run test:ci
node-version: ${{ matrix.node-version }}
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm run test:all
4 changes: 2 additions & 2 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ If you are adding new functionality or fixing a bug, please add a test for it.
**Run test and build the library before submitting a pull request :pray:**

```bash
npm run test:ci
npm run test:all
```

**How to add a new module**
Expand All @@ -39,7 +39,7 @@ To create a new module:
- Add a new package.json inside the folder (see any of them as an example)
- Add required dependencies to "dependencies" inside package.json. Ensure correct dependency versions. For example, if your module needs to use `tonal/core` look at core's package.json to see what version to use
- Add your functionality and tests
- Ensure everything works: run `npm run test:ci` at root folder
- Ensure everything works: run `npm run test:all` at root folder
- Create a pull request

## Release
Expand Down
42 changes: 42 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import globals from "globals";
import js from "@eslint/js";
import tsParser from "@typescript-eslint/parser";
import tsPlugin from "@typescript-eslint/eslint-plugin";

export default [
{
files: ["packages/**/*.ts"],
ignores: [
"node_modules/",
"packages/**/dist/*",
],

languageOptions: {
globals: {
...globals.browser, // Standard browser globals (e.g., window, document)
...globals.node, // Standard Node.js globals (e.g., process, require)
},
ecmaVersion: "latest",
sourceType: "module",
parser: tsParser,

parserOptions: {
project: "./tsconfig.json", // Adjust this path if your main tsconfig is elsewhere
ecmaFeatures: {
},
},
},

plugins: {
"@typescript-eslint": tsPlugin,
},

rules: {
...js.configs.recommended.rules,
...tsPlugin.configs["eslint-recommended"].rules,
...tsPlugin.configs.recommended.rules,
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],

},
},
];
Loading