Skip to content

Commit 5d3507c

Browse files
committed
chore(release v1.23.1): convert ESLint config to ESM, update README for usage, and enhance package exports and dependencies
1 parent 9dd7fc1 commit 5d3507c

7 files changed

Lines changed: 54 additions & 44 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
11
# Changelog
22

3+
## [1.23.1] - 2026-02-13
4+
5+
### Changed
6+
7+
- **ESLint config as ESM:** Converted `eslint.config.js` and `eslint.config.base.js` to `.mjs` (ES module) to fix the "CommonJS module; may be converted to an ES module" lint warning. Single source of truth is now `eslint.config.base.mjs`; this repo uses `eslint.config.mjs` (base + local overrides).
8+
- **Package:** Export `"./eslint"` now points to `eslint.config.base.mjs`; published `files` include `eslint.config.base.mjs`.
9+
- **Consumers:** Use `eslint.config.mjs` with `import playwrightLibConfig from 'vasu-playwright-utils/eslint'` and `export default [...]`. `require()` is not supported for the published ESM config.
10+
- **README:** ESLint section updated to document ESM usage (`eslint.config.mjs`, `import` / `export default`).
11+
312
## [1.23.0] - 2026-02-13
413

514
### Added
615

7-
- **Shareable ESLint config:** New flat config at `config/eslint.config.cjs` for Playwright TypeScript projects. Consume it via `vasu-playwright-utils/eslint` in your `eslint.config.js` and override rules as needed.
16+
- **Shareable ESLint config:** New flat config for Playwright TypeScript projects. Consume via `vasu-playwright-utils/eslint` in your `eslint.config.mjs` and override rules as needed.
817
- **README:** New [ESLint](#eslint) section with usage, spreading the config, and examples for overriding rules and file-specific overrides.
918
- **Sample config:** `eslint.config.sample.mjs` (ESM) showing how to extend the shareable config and override rules.
1019

1120
### Changed
1221

1322
- **Engines:** Node.js requirement updated from `>=18.0.0` to `>=20.0.0`.
14-
- **Package:** Export `"./eslint"` added;
15-
- **Shareable ESLint config:** JSDoc rules `jsdoc/check-alignment` and `jsdoc/check-indentation` set to `off`. Project root resolution fixed to use `require('process').cwd()` to avoid lint errors in the config file.
16-
- **Local ESLint (eslint.config.js):** JSDoc rules `jsdoc/check-alignment` and `jsdoc/check-indentation` overridden to `warn` in this repo (base config stays `off` for consumers).
23+
- **Package:** Export `"./eslint"` added; config included in published `files`.
24+
- **Shareable ESLint config:** Single source; JSDoc rules `jsdoc/check-alignment` and `jsdoc/check-indentation` set to `off`. Project root via `process.cwd()` for portability.
25+
- **Local ESLint:** JSDoc rules `jsdoc/check-alignment` and `jsdoc/check-indentation` overridden to `warn` in this repo (base stays `off` for consumers).
1726

1827
### Updated Dependencies
1928

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ This library ships a shareable ESLint config for Playwright TypeScript projects.
4040

4141
### Using the config
4242

43-
1. Use **ESLint 9 flat config** (`eslint.config.js` at your project root).
43+
1. Use **ESLint 9 flat config** (`eslint.config.mjs` at your project root).
4444

45-
2. In your `eslint.config.js`, spread the library config:
45+
2. In your `eslint.config.mjs`, spread the library config:
4646

4747
```javascript
48-
const playwrightLibConfig = require('vasu-playwright-utils/eslint');
48+
import playwrightLibConfig from 'vasu-playwright-utils/eslint';
4949

50-
module.exports = [...playwrightLibConfig];
50+
export default [...playwrightLibConfig];
5151
```
5252

5353
3. Ensure your project has a `tsconfig.json` at the root (the config uses it for TypeScript parsing).
@@ -57,9 +57,9 @@ module.exports = [...playwrightLibConfig];
5757
Add config objects after the spread to override or relax rules:
5858

5959
```javascript
60-
const playwrightLibConfig = require('vasu-playwright-utils/eslint');
60+
import playwrightLibConfig from 'vasu-playwright-utils/eslint';
6161

62-
module.exports = [
62+
export default [
6363
...playwrightLibConfig,
6464
// Override specific rules
6565
{
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
/**
22
* Shareable ESLint config for Playwright TypeScript projects.
3-
* Single source of truth: used by this repo (via eslint.config.js) and by consumers (vasu-playwright-utils/eslint).
3+
* Single source of truth: used by this repo (via eslint.config.mjs) and by consumers (vasu-playwright-utils/eslint).
44
*
55
* @example
6-
* // eslint.config.js (in your project)
7-
* const playwrightLibConfig = require('vasu-playwright-utils/eslint');
8-
* module.exports = [
6+
* // eslint.config.mjs (in your project)
7+
* import playwrightLibConfig from 'vasu-playwright-utils/eslint';
8+
* export default [
99
* ...playwrightLibConfig,
1010
* { rules: { 'playwright/no-focused-test': 'warn' } },
1111
* ];
1212
*/
1313

14-
const typescript = require('@typescript-eslint/eslint-plugin');
15-
const typescriptParser = require('@typescript-eslint/parser');
16-
const prettier = require('eslint-plugin-prettier');
17-
const importPlugin = require('eslint-plugin-import');
18-
const jsdoc = require('eslint-plugin-jsdoc');
19-
const playwright = require('eslint-plugin-playwright');
20-
const js = require('@eslint/js');
14+
import typescript from '@typescript-eslint/eslint-plugin';
15+
import typescriptParser from '@typescript-eslint/parser';
16+
import prettier from 'eslint-plugin-prettier';
17+
import importPlugin from 'eslint-plugin-import';
18+
import jsdoc from 'eslint-plugin-jsdoc';
19+
import playwright from 'eslint-plugin-playwright';
20+
import js from '@eslint/js';
21+
import process from 'node:process';
2122

22-
// Works in this repo and when required from other projects (consumer's cwd)
23-
const projectRoot = require('process').cwd();
23+
// Works in this repo and when imported from other projects (consumer's cwd)
24+
const projectRoot = process.cwd();
2425

25-
module.exports = [
26+
export default [
2627
{
2728
ignores: [
2829
'node_modules/**',

eslint.config.js renamed to eslint.config.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/**
22
* This repo's ESLint config: base config + local overrides.
3-
* Edit eslint.config.base.js to change rules; that file is also published as vasu-playwright-utils/eslint.
3+
* Edit eslint.config.base.mjs to change rules; that file is also published as vasu-playwright-utils/eslint.
44
*/
5-
const base = require('./eslint.config.base.js');
5+
import base from './eslint.config.base.mjs';
66

7-
module.exports = [
7+
export default [
88
...base,
99
// Repo-specific: JSDoc alignment/indentation as warn (base has them off for consumers)
1010
{ rules: { 'jsdoc/check-alignment': 'warn', 'jsdoc/check-indentation': 'warn' } },

eslint.config.sample.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* To use: copy this file to eslint.config.mjs (or eslint.config.js if your project uses "type": "module").
44
*/
55
// In your project: import from 'vasu-playwright-utils/eslint'
6-
import playwrightLibConfig from './eslint.config.base.js';
6+
import playwrightLibConfig from './eslint.config.base.mjs';
77

88
export default [
99
...playwrightLibConfig,

package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "vasu-playwright-utils",
3-
"version": "1.23.0",
3+
"version": "1.23.1",
44
"description": "Playwright Typescript Library with reusable utilities",
55
"main": "./dist/src/vasu-playwright-lib/index.js",
66
"types": "./dist/src/vasu-playwright-lib/index.d.ts",
77
"exports": {
88
".": "./dist/src/vasu-playwright-lib/index.js",
9-
"./eslint": "./eslint.config.base.js",
9+
"./eslint": "./eslint.config.base.mjs",
1010
"./action-utils": "./dist/src/vasu-playwright-lib/utils/action-utils.js",
1111
"./assert-utils": "./dist/src/vasu-playwright-lib/utils/assert-utils.js",
1212
"./element-utils": "./dist/src/vasu-playwright-lib/utils/element-utils.js",
@@ -42,14 +42,14 @@
4242
"files": [
4343
"dist",
4444
"src",
45-
"eslint.config.base.js"
45+
"eslint.config.base.mjs"
4646
],
4747
"engines": {
4848
"node": ">=20.0.0"
4949
},
5050
"dependencies": {
51-
"@eslint/js": "^9.39.2",
52-
"@types/node": "^25.3.1",
51+
"@eslint/js": "^9.39.3",
52+
"@types/node": "^25.3.2",
5353
"@typescript-eslint/eslint-plugin": "^8.56.1",
5454
"@typescript-eslint/parser": "^8.56.1",
5555
"cross-env": "^10.1.0",

0 commit comments

Comments
 (0)