@rightcapital/prettier-config 8.0.6-renovate-dev-dependencies.6535.1.0 → 9.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
@@ -6,6 +6,7 @@ RightCapital's shared [Prettier](https://prettier.io/) configuration.
6
6
 
7
7
  ## Prerequisites
8
8
 
9
+ - Node.js `^22.13.0 || >=24`
9
10
  - `prettier` (^3.0.0)
10
11
 
11
12
  ## Installation
@@ -16,12 +17,22 @@ pnpm add -D @rightcapital/prettier-config
16
17
 
17
18
  ## Usage
18
19
 
19
- In your `prettier.config.cjs`:
20
+ In your `prettier.config.mjs`:
21
+
22
+ ```js
23
+ import config from '@rightcapital/prettier-config';
24
+
25
+ export default config;
26
+ ```
27
+
28
+ Existing `prettier.config.cjs` setups are also supported:
20
29
 
21
30
  ```js
22
31
  module.exports = require('@rightcapital/prettier-config');
23
32
  ```
24
33
 
34
+ The package is ESM-only; Node.js's `module.exports` interop export makes `require()` return the configuration object directly.
35
+
25
36
  ## What's included
26
37
 
27
38
  - Single quotes
package/lib/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { Options } from 'prettier';
2
2
  declare const config: Options;
3
- export = config;
3
+ export default config;
4
+ export { config as 'module.exports' };
4
5
  //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";
1
+ import { fileURLToPath } from 'node:url';
2
2
  const config = {
3
3
  arrowParens: 'always',
4
4
  printWidth: 80,
@@ -6,7 +6,9 @@ const config = {
6
6
  singleQuote: true,
7
7
  tabWidth: 2,
8
8
  trailingComma: 'all',
9
- plugins: [require.resolve('prettier-plugin-packagejson')],
9
+ plugins: [fileURLToPath(import.meta.resolve('prettier-plugin-packagejson'))],
10
10
  };
11
- module.exports = config;
11
+ export default config;
12
+ // Keep native require() consumers receiving the config object instead of an ESM namespace.
13
+ export { config as 'module.exports' };
12
14
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightcapital/prettier-config",
3
- "version": "8.0.6-renovate-dev-dependencies.6535.1.0",
3
+ "version": "9.0.0",
4
4
  "description": "Prettier Config for RightCapital",
5
5
  "keywords": [
6
6
  "prettier",
@@ -18,8 +18,14 @@
18
18
  },
19
19
  "license": "MIT",
20
20
  "author": "RightCapital <npm-publisher@rightcapital.com>",
21
- "type": "commonjs",
22
- "exports": "./lib/index.js",
21
+ "type": "module",
22
+ "exports": {
23
+ ".": {
24
+ "types": "./lib/index.d.ts",
25
+ "default": "./lib/index.js"
26
+ },
27
+ "./package.json": "./package.json"
28
+ },
23
29
  "main": "./lib/index.js",
24
30
  "types": "./lib/index.d.ts",
25
31
  "files": [
@@ -33,7 +39,7 @@
33
39
  "prettier": "^3.0.0"
34
40
  },
35
41
  "engines": {
36
- "node": ">=16.0.0"
42
+ "node": "^22.13.0 || >=24"
37
43
  },
38
44
  "publishConfig": {
39
45
  "registry": "https://registry.npmjs.org"