Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c7cc7f3
Add oxlint plugin for js-toolkit best practices
titouanmathis May 7, 2026
e55b745
Remove v4 mentions from plugin docs and rule description
titouanmathis May 7, 2026
1aadaa0
Fix oxlint config
titouanmathis May 7, 2026
74c9717
Add auto-fix to async-lifecycle-methods, refs-camel-case, options-cam…
titouanmathis May 7, 2026
77567ed
Update README to indicate which rules are auto-fixable
titouanmathis May 7, 2026
2ea98a5
Add a fix:oxlint script
titouanmathis May 7, 2026
47c4df0
Fix demo files
titouanmathis May 7, 2026
de8df3e
Fix no-deprecated-properties: $parent and $root are deprecated, not r…
titouanmathis May 7, 2026
59c9b3c
Fix no-deprecated-properties: $queryAll() does not exist, use $query()
titouanmathis May 7, 2026
a1e7343
Fix using the oxlint-plugin in CI
titouanmathis May 7, 2026
bc69b1d
Move oxlint-plugin source files to src/
titouanmathis May 7, 2026
c7c49d1
Run oxlint-plugin tests in CI with coverage
titouanmathis May 7, 2026
d6be0d2
Publish oxlint-plugin from package root
titouanmathis May 7, 2026
3d14af3
Add names to CI
titouanmathis May 7, 2026
49ad9a0
Add badges to readme
titouanmathis May 7, 2026
adbd934
Add oxlint-plugin-js-toolkit to README and docs
titouanmathis May 7, 2026
62abb79
Use npm ci in CI
titouanmathis May 7, 2026
210efd9
Fix oxlint config
titouanmathis May 7, 2026
5c721b6
Add 7 new rules to oxlint-plugin-js-toolkit
titouanmathis May 7, 2026
93bb94a
Fix false positive and add window/document support in no-event-listen…
titouanmathis May 7, 2026
4046bcf
Downgrade no-deprecated-properties default severity to warn
titouanmathis May 7, 2026
d3bf6a6
Update README to reflect no-deprecated-properties warn severity
titouanmathis May 7, 2026
0209c6d
Lint doc files
titouanmathis May 7, 2026
a48ba41
Add a missing dependency for tests
titouanmathis May 7, 2026
72dfd50
Update changelog
titouanmathis May 7, 2026
211c964
Use oxlint createOnce alternative API for better linting performance
titouanmathis May 7, 2026
73f8d99
Rename package to @studiometa/eslint-plugin-js-toolkit
titouanmathis May 7, 2026
b9b2875
Update changelog to use new package name
titouanmathis May 7, 2026
9c0811f
Fix oxlintrc specifier path after package rename
titouanmathis May 7, 2026
7e5b185
Fix oxlint config snippet to use explicit plugin alias
titouanmathis May 7, 2026
43640b1
Fix npm ci install
titouanmathis May 7, 2026
e5fe236
Fix linting and formatting scripts
titouanmathis May 7, 2026
a1f0a4b
Format files
titouanmathis May 7, 2026
0e2f337
Fix naming
titouanmathis May 7, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
node-version: 24
cache: npm
- name: Install dependencies
run: npm install
run: npm ci
- name: Run the benchmarks
uses: CodSpeedHQ/action@v4
with:
Expand Down
35 changes: 30 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,37 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-

- run: npm install --no-audit --no-fund
- run: npm ci --no-audit --no-fund

- run: npm run build
- name: Build js-toolkit
run: npm run build

- name: Test
- name: Build oxlint-plugin
run: npm run build
working-directory: packages/eslint-plugin-js-toolkit

- name: Test js-toolkit
run: npm run test -- -- --retry=3 --coverage.enabled

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./packages/coverage
flags: unittests
files: ./packages/coverage/clover.xml
flags: js-toolkit
fail_ci_if_error: false
verbose: true

- name: Test oxlint-plugin
run: npm test -- --retry=3 --coverage.enabled
working-directory: packages/eslint-plugin-js-toolkit

- name: Upload oxlint-plugin coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: packages/eslint-plugin-js-toolkit/coverage/clover.xml
flags: eslint-plugin-js-toolkit
fail_ci_if_error: false
verbose: true

Expand All @@ -69,6 +87,13 @@ jobs:
tag: ${{ env.NPM_TAG }}
token: ${{ secrets.NPM_TOKEN }}

- uses: JS-DevTools/npm-publish@v3
with:
provenance: true
package: packages/eslint-plugin-js-toolkit/
tag: ${{ env.NPM_TAG }}
token: ${{ secrets.NPM_TOKEN }}

- uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref }}
Expand Down
31 changes: 24 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
node-version: 24
cache: npm
- name: Install dependencies
run: npm install
run: npm ci --no-audit --no-progress --no-fund
- name: Build
run: npm run build

Expand All @@ -31,29 +31,46 @@ jobs:
node-version: 24
cache: npm
- name: Install dependencies
run: npm install
run: npm ci --no-audit --no-progress --no-fund
- name: Run code quality tests
run: npm run lint:oxlint
run: npm run lint:static
- name: Run format tests
run: npm run lint:fmt
- name: Run types tests
run: npm run lint:types

unit:
runs-on: macos-latest
strategy:
matrix:
include:
- package: js-toolkit
working-directory: .
test-command: npm run test -- -- --retry=3 --coverage.enabled
coverage-file: ./packages/coverage/clover.xml
- package: eslint-plugin-js-toolkit
working-directory: packages/eslint-plugin-js-toolkit
test-command: npm test -- --retry=3 --coverage.enabled
coverage-file: packages/eslint-plugin-js-toolkit/coverage/clover.xml
name: unit (${{ matrix.package }})
defaults:
run:
working-directory: ${{ matrix.working-directory }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm install
run: npm ci --no-audit --no-progress --no-fund
- name: Run tests
run: npm run test -- -- --retry=3 --coverage.enabled
run: ${{ matrix.test-command }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./packages/coverage/clover.xml
flags: unittests
files: ${{ matrix.coverage-file }}
flags: ${{ matrix.package }}
fail_ci_if_error: false
verbose: true
env:
Expand Down
25 changes: 24 additions & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
{
"jsPlugins": [
{ "name": "js-toolkit", "specifier": "./packages/eslint-plugin-js-toolkit/src/index.ts" }
],
"rules": {
"typescript/no-this-alias": [
"error",
{
"allowDestructuring": true
}
]
}
},
"overrides": [
{
"files": ["packages/js-toolkit/**/*.ts", "packages/demo/**/*.{ts,js}"],
"rules": {
"js-toolkit/require-config": "error",
"js-toolkit/require-config-name-pascal-case": "error",
"js-toolkit/refs-camel-case": "error",
"js-toolkit/refs-plural-multiple": "error",
"js-toolkit/options-camel-case": "error",
"js-toolkit/async-lifecycle-methods": "error",
"js-toolkit/on-handler-naming": "error",
"js-toolkit/on-global-handler-prefix": "warn",
"js-toolkit/no-deprecated-properties": "error",
"js-toolkit/no-dispatch-event": "warn",
"js-toolkit/no-shadow-dom": "error",
"js-toolkit/no-create-app": "warn",
"js-toolkit/no-event-listener-methods": "error"
}
}
]
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format

## [Unreleased]

### Added

- Add `@studiometa/eslint-plugin-js-toolkit` package with 20 rules enforcing best practices for `@studiometa/js-toolkit` projects ([#726](https://github.com/studiometa/js-toolkit/pull/726), [e2477e79](https://github.com/studiometa/js-toolkit/commit/e2477e79))

## [v3.6.0-beta.0](https://github.com/studiometa/js-toolkit/compare/3.5.0..3.6.0-beta.0) (2026-04-21)

### Added
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ This project is a JavaScript micro-framework (along with its utility functions)

Visit [js-toolkit.studiometa.dev](https://js-toolkit.studiometa.dev) to learn more, jump directly to [ui.studiometa.dev](https://ui.studiometa.dev) to discover existing components, or open [the playground](https://ui.studiometa.dev/-/play/) to test it live.

## Linting

The [`@studiometa/eslint-plugin-js-toolkit`](./packages/eslint-plugin-js-toolkit/) package provides an Oxlint/ESLint plugin that enforces best practices when writing components with this framework.

```bash
npm install --save-dev @studiometa/eslint-plugin-js-toolkit
```

See the [plugin README](./packages/eslint-plugin-js-toolkit/README.md) or the [linting guide](https://js-toolkit.studiometa.dev/guide/going-further/linting.html) for configuration details.

## Quick overview

This framework lets you define components as classes, and bind them to the DOM with `data-…` attributes. For example, here is how a `Counter` component would be defined in JavaScript:
Expand Down
Loading
Loading