@abinnovision/prettier-config 2.1.5 → 2.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.2.0](https://github.com/abinnovision/js-commons/compare/prettier-config-v2.1.5...prettier-config-v2.2.0) (2026-04-28)
4
+
5
+
6
+ ### Features
7
+
8
+ * support ESLint 10 in shared configs ([#599](https://github.com/abinnovision/js-commons/issues/599)) ([4de4c56](https://github.com/abinnovision/js-commons/commit/4de4c562df5b43b15de7b52637c7d82bd15e498f))
9
+
3
10
  ## [2.1.5](https://github.com/abinnovision/js-commons/compare/prettier-config-v2.1.4...prettier-config-v2.1.5) (2025-11-08)
4
11
 
5
12
 
package/README.md CHANGED
@@ -1,37 +1,41 @@
1
1
  # @abinnovision/prettier-config
2
2
 
3
- Prettier config for all types of projects. The config mostly inherits the
4
- default Prettier config. This additionally comes with a `.editorconfig`, which
5
- is compatible with most editors.
3
+ Shared Prettier config with an opinionated `.editorconfig`.
6
4
 
7
5
  ## Installation
8
6
 
9
7
  ```shell
10
- yarn add --dev @abinnovision/prettier-config
8
+ yarn add --dev @abinnovision/prettier-config prettier
11
9
  ```
12
10
 
13
- ## EditorConfig
11
+ ## Usage
14
12
 
15
- The EditorConfig is a small file in the root directory of your project called
16
- `.editorconfig`. It defines various code style options for the project. This
17
- packages comes with an opinionated version of this file.
13
+ Reference the config in your `package.json`:
18
14
 
19
- To synchronize the `.editorconfig` file from this package use the following:
15
+ ```json
16
+ {
17
+ "prettier": "@abinnovision/prettier-config"
18
+ }
19
+ ```
20
+
21
+ ## EditorConfig
22
+
23
+ Sync the bundled `.editorconfig` into your project:
20
24
 
21
25
  ```shell
22
26
  yarn sync-editorconfig
23
27
  ```
24
28
 
25
- Optionally, you can put it into your `postinstall` hook to always keep in sync
26
- with the one defined in this project.
29
+ Optionally add it to your `postinstall` hook to keep it in sync automatically:
27
30
 
28
31
  ```json5
29
32
  {
30
- // ...
31
33
  scripts: {
32
- // ...
33
34
  postinstall: "sync-editorconfig",
34
35
  },
35
- // ...
36
36
  }
37
37
  ```
38
+
39
+ ## License
40
+
41
+ Apache-2.0
@@ -0,0 +1,23 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ //#endregion
23
+ exports.__toESM = __toESM;
@@ -1,39 +1,15 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
- // If the importer is in node compatibility mode or this is not an ESM
19
- // file that has been converted to a CommonJS file using a Babel-
20
- // compatible transform (i.e. "__esModule" has not been set), then set
21
- // "default" to the CommonJS "module.exports" for node compatibility.
22
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
23
- mod
24
- ));
25
-
26
- // src/bin/sync-editorconfig.ts
27
- var fs = __toESM(require("fs/promises"), 1);
28
- var path = __toESM(require("path"), 1);
29
- var process = __toESM(require("process"), 1);
30
- var DISABLE_ENV_VAR = "DISABLE_SYNC_EDITORCONFIG";
31
- void async function() {
32
- if ([true, "true"].includes(process.env[DISABLE_ENV_VAR] ?? false)) {
33
- return;
34
- }
35
- await fs.copyFile(
36
- path.resolve(__dirname, "../../assets/.editorconfig"),
37
- path.resolve(process.cwd(), ".editorconfig")
38
- );
39
- }();
2
+ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
3
+ let fs_promises = require("fs/promises");
4
+ fs_promises = require_runtime.__toESM(fs_promises);
5
+ let path = require("path");
6
+ path = require_runtime.__toESM(path);
7
+ let process = require("process");
8
+ process = require_runtime.__toESM(process);
9
+ //#region src/bin/sync-editorconfig.ts
10
+ const DISABLE_ENV_VAR = "DISABLE_SYNC_EDITORCONFIG";
11
+ (async function() {
12
+ if ([true, "true"].includes(process.env[DISABLE_ENV_VAR] ?? false)) return;
13
+ await fs_promises.copyFile(path.resolve(__dirname, "../../assets/.editorconfig"), path.resolve(process.cwd(), ".editorconfig"));
14
+ })();
15
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import * as fs from "fs/promises";
3
+ import * as path from "path";
4
+ import * as process from "process";
5
+ //#region src/bin/sync-editorconfig.ts
6
+ const DISABLE_ENV_VAR = "DISABLE_SYNC_EDITORCONFIG";
7
+ (async function() {
8
+ if ([true, "true"].includes(process.env[DISABLE_ENV_VAR] ?? false)) return;
9
+ await fs.copyFile(path.resolve(__dirname, "../../assets/.editorconfig"), path.resolve(process.cwd(), ".editorconfig"));
10
+ })();
11
+ //#endregion
12
+ export {};
package/dist/index.cjs ADDED
@@ -0,0 +1,20 @@
1
+ //#region src/index.ts
2
+ const config = {
3
+ printWidth: 80,
4
+ useTabs: true,
5
+ tabWidth: 2,
6
+ semi: true,
7
+ trailingComma: "all",
8
+ bracketSpacing: true,
9
+ arrowParens: "always",
10
+ endOfLine: "lf",
11
+ overrides: [{
12
+ files: ["pnpm-lock.yaml"],
13
+ options: { requirePragma: true }
14
+ }, {
15
+ files: ["*.md"],
16
+ options: { useTabs: false }
17
+ }]
18
+ };
19
+ //#endregion
20
+ module.exports = config;
@@ -0,0 +1,5 @@
1
+ import { Config } from "prettier";
2
+
3
+ //#region src/index.d.ts
4
+ declare const config: Config;
5
+ export = config;
@@ -0,0 +1,6 @@
1
+ import { Config } from "prettier";
2
+
3
+ //#region src/index.d.ts
4
+ declare const config: Config;
5
+ //#endregion
6
+ export { config as default };
package/dist/index.mjs ADDED
@@ -0,0 +1,20 @@
1
+ //#region src/index.ts
2
+ const config = {
3
+ printWidth: 80,
4
+ useTabs: true,
5
+ tabWidth: 2,
6
+ semi: true,
7
+ trailingComma: "all",
8
+ bracketSpacing: true,
9
+ arrowParens: "always",
10
+ endOfLine: "lf",
11
+ overrides: [{
12
+ files: ["pnpm-lock.yaml"],
13
+ options: { requirePragma: true }
14
+ }, {
15
+ files: ["*.md"],
16
+ options: { useTabs: false }
17
+ }]
18
+ };
19
+ //#endregion
20
+ export { config as default };
package/package.json CHANGED
@@ -1,12 +1,6 @@
1
1
  {
2
2
  "name": "@abinnovision/prettier-config",
3
- "version": "2.1.5",
4
- "publishConfig": {
5
- "npm": true,
6
- "ghpr": true,
7
- "npmAccess": "public"
8
- },
9
- "type": "module",
3
+ "version": "2.2.0",
10
4
  "repository": {
11
5
  "url": "https://github.com/abinnovision/js-commons"
12
6
  },
@@ -16,8 +10,21 @@
16
10
  "email": "info@abigroup.io",
17
11
  "url": "https://abigroup.io/"
18
12
  },
19
- "main": "./dist/index.js",
20
- "types": "./dist/index.d.ts",
13
+ "type": "module",
14
+ "exports": {
15
+ ".": {
16
+ "import": {
17
+ "types": "./dist/index.d.mts",
18
+ "default": "./dist/index.mjs"
19
+ },
20
+ "require": {
21
+ "types": "./dist/index.d.cts",
22
+ "default": "./dist/index.cjs"
23
+ }
24
+ }
25
+ },
26
+ "main": "./dist/index.cjs",
27
+ "types": "./dist/index.d.cts",
21
28
  "bin": {
22
29
  "sync-editorconfig": "./dist/bin/sync-editorconfig.cjs"
23
30
  },
@@ -26,7 +33,7 @@
26
33
  "assets/"
27
34
  ],
28
35
  "scripts": {
29
- "build": "tsup src/index.ts --dts --format esm --clean && tsup src/bin/* --format cjs --clean -d dist/bin",
36
+ "build": "tsdown",
30
37
  "format:check": "prettier --check 'src/**/*.{ts,js}' '**/*.{md,json,json5,yaml,yml}'",
31
38
  "format:fix": "prettier --write 'src/**/*.{ts,js}' '**/*.{md,json,json5,yaml,yml}'",
32
39
  "lint:check": "eslint 'src/**/*.{ts,js}'",
@@ -41,16 +48,22 @@
41
48
  "prettier --write"
42
49
  ]
43
50
  },
44
- "prettier": "./dist/index.js",
51
+ "prettier": "./dist/index.mjs",
45
52
  "devDependencies": {
53
+ "@internal/tsconfig": "^1.0.0",
46
54
  "@types/node": "^22.12.0",
47
55
  "@types/prettier": "^3.0.0",
48
- "eslint": "^9.39.1",
56
+ "eslint": "^10.0.0",
49
57
  "prettier": "^3.4.2",
50
- "tsup": "^8.3.6",
58
+ "tsdown": "^0.21.3",
51
59
  "typescript": "^5.9.3"
52
60
  },
53
61
  "peerDependencies": {
54
62
  "prettier": "^2.4.0 || ^3.0.0"
63
+ },
64
+ "publishConfig": {
65
+ "ghpr": true,
66
+ "npm": true,
67
+ "npmAccess": "public"
55
68
  }
56
69
  }
package/dist/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import { Config } from 'prettier';
2
-
3
- declare const config: Config;
4
-
5
- export { config as default };
package/dist/index.js DELETED
@@ -1,35 +0,0 @@
1
- // src/index.ts
2
- var config = {
3
- printWidth: 80,
4
- useTabs: true,
5
- tabWidth: 2,
6
- semi: true,
7
- trailingComma: "all",
8
- bracketSpacing: true,
9
- arrowParens: "always",
10
- endOfLine: "lf",
11
- overrides: [
12
- {
13
- files: ["pnpm-lock.yaml"],
14
- options: {
15
- requirePragma: true
16
- }
17
- },
18
- {
19
- /**
20
- * Use spaces for Markdown files instead of tabs.
21
- *
22
- * This is because Markdown files rendered with tabs in GitHub use pretty
23
- * large indentation, which is not ideal.
24
- */
25
- files: ["*.md"],
26
- options: {
27
- useTabs: false
28
- }
29
- }
30
- ]
31
- };
32
- var src_default = config;
33
- export {
34
- src_default as default
35
- };