@pplancq/commitlint-config 2.3.3 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -23,3 +23,27 @@ npx init-commitlint-config
23
23
  ### @pplancq/commitlint-config
24
24
 
25
25
  This is the default configuration. To use, add `"commitlint": { "extends": ["@pplancq/commitlint-config"] }` to your `package.json`.
26
+
27
+ ## ⚠️ Breaking Change: ESM Only from v3
28
+
29
+ As of version 3.x, this package is ESM-only. CommonJS (`require`) is no longer supported.
30
+
31
+ ## Migration from CommonJS to ESM
32
+
33
+ **Old (CommonJS) usage:**
34
+
35
+ ```js
36
+ // .commitlintrc.js or commitlint.config.js
37
+ module.exports = { extends: ['@pplancq/commitlint-config'] };
38
+ ```
39
+
40
+ **New (ESM) usage:**
41
+
42
+ ```js
43
+ // commitlint.config.mjs (or commitlint.config.js when using "type": "module")
44
+ export default {
45
+ extends: ['@pplancq/commitlint-config'],
46
+ };
47
+ ```
48
+
49
+ If you are using a `.js` config file, ensure your environment supports ESM (e.g., Node.js >= 18, or set "type": "module" in your package.json).
package/bin/init.mjs ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ import { writeFileSync } from 'node:fs';
3
+
4
+ console.info('Add commitlint config in commitlint.config.mjs');
5
+
6
+ writeFileSync(
7
+ 'commitlint.config.mjs',
8
+ `export default {
9
+ extends: ['@pplancq/commitlint-config'],
10
+ };
11
+ `,
12
+ {
13
+ encoding: 'utf-8',
14
+ },
15
+ );
package/index.js CHANGED
@@ -9,4 +9,5 @@ const config = {
9
9
  },
10
10
  };
11
11
 
12
- module.exports = config;
12
+ // eslint-disable-next-line import/no-default-export
13
+ export default config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pplancq/commitlint-config",
3
- "version": "2.3.3",
3
+ "version": "3.0.0",
4
4
  "license": "MIT",
5
5
  "description": "pplancq commitlint config",
6
6
  "author": "pplancq <paul.plancq@outlook.fr>",
@@ -24,9 +24,10 @@
24
24
  "bugs": {
25
25
  "url": "https://github.com/pplancq/dev-tools/issues"
26
26
  },
27
+ "type": "module",
27
28
  "main": "index.js",
28
29
  "bin": {
29
- "init-commitlint-config": "bin/init.js"
30
+ "init-commitlint-config": "bin/init.mjs"
30
31
  },
31
32
  "keywords": [
32
33
  "commitlint",
@@ -40,9 +41,9 @@
40
41
  },
41
42
  "devDependencies": {
42
43
  "eslint": "^9.39.2",
43
- "eslint-plugin-prettier": "^5.5.4",
44
+ "eslint-plugin-prettier": "^5.5.5",
44
45
  "lint-staged": "^16.2.7",
45
- "prettier": "^3.7.4"
46
+ "prettier": "^3.8.1"
46
47
  },
47
48
  "engines": {
48
49
  "node": ">=v18"
package/bin/init.js DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- const { writeFileSync } = require('fs');
3
-
4
- console.info('Add commitlint config in .commitlintrc.js');
5
-
6
- writeFileSync('.commitlintrc.js', "module.exports = { extends: ['@pplancq/commitlint-config'] };\n", {
7
- encoding: 'utf-8',
8
- });