@shahrad/prettier-config 2.0.0 → 2.0.1

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/lib/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { Config } from 'prettier';
2
+
3
+ export default Config;
package/lib/index.js ADDED
@@ -0,0 +1,43 @@
1
+ import ImportOrderParserPlugin from '@trivago/prettier-plugin-sort-imports';
2
+ import PackageJsonPlugin from 'prettier-plugin-packagejson';
3
+ import * as ShellPlugin from 'prettier-plugin-sh';
4
+
5
+ const DEFAULT_CONFIG = {
6
+ useTabs: false,
7
+ semi: true,
8
+ singleQuote: true,
9
+ jsxSingleQuote: true,
10
+ trailingComma: 'es5',
11
+ endOfLine: 'lf',
12
+ printWidth: 100,
13
+ overrides: [
14
+ {
15
+ files: '*.md',
16
+ options: {
17
+ tabWidth: 2,
18
+ useTabs: false,
19
+ printWidth: 79,
20
+ },
21
+ },
22
+ {
23
+ files: ['Dockerfile', '*.dockerfile'],
24
+ options: {
25
+ spaceRedirects: false,
26
+ },
27
+ },
28
+ ],
29
+ importOrder: [
30
+ 'node:*',
31
+ '<THIRD_PARTY_MODULES>',
32
+ '<SEPARATOR>',
33
+ '^@/(.*)$',
34
+ '^@/tests/(.*)$',
35
+ '<SEPARATOR>',
36
+ '^[./]',
37
+ ],
38
+ importOrderParserPlugins: ['typescript', 'jsx', 'explicitResourceManagement'],
39
+ importOrderSeparation: true,
40
+ plugins: [ImportOrderParserPlugin, PackageJsonPlugin, ShellPlugin],
41
+ };
42
+
43
+ export default DEFAULT_CONFIG;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shahrad/prettier-config",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "My personal Prettier config",
5
5
  "homepage": "https://github.com/shahradelahi/prettier-config#readme",
6
6
  "repository": {
@@ -10,40 +10,15 @@
10
10
  "license": "MIT",
11
11
  "author": "Shahrad Elahi <shahrad@litehex.com> (https://github.com/shahradelahi)",
12
12
  "type": "module",
13
- "exports": {
14
- ".": {
15
- "import": {
16
- "types": "./dist/index.d.ts",
17
- "default": "./dist/index.js"
18
- },
19
- "require": {
20
- "types": "./dist/index.d.cts",
21
- "default": "./dist/index.cjs"
22
- }
23
- }
24
- },
25
- "main": "dist/index.cjs",
26
- "module": "dist/index.js",
27
- "types": "dist/index.d.ts",
13
+ "main": "lib/index.js",
14
+ "types": "lib/index.d.ts",
28
15
  "files": [
29
- "dist/**"
16
+ "lib/*"
30
17
  ],
31
18
  "scripts": {
32
- "build": "tsup",
33
- "clean": "git clean -xdf node_modules dist",
34
19
  "format": "prettier --write .",
35
20
  "format:check": "prettier --check .",
36
- "lint": "pnpm typecheck && eslint .",
37
- "lint:fix": "eslint --fix .",
38
- "prepublishOnly": "pnpm build && pnpm lint && pnpm format:check",
39
- "typecheck": "tsc --noEmit"
40
- },
41
- "devDependencies": {
42
- "@shahrad/eslint-config": "^1.1.0",
43
- "@shahrad/tsconfig": "^1.3.0",
44
- "eslint": "^10.15.0",
45
- "tsup": "^9.0.0",
46
- "typescript": "^6.0.3"
21
+ "prepublishOnly": "pnpm format:check"
47
22
  },
48
23
  "peerDependencies": {
49
24
  "@trivago/prettier-plugin-sort-imports": "^6",
package/dist/index.cjs DELETED
@@ -1,68 +0,0 @@
1
- "use strict";
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 __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/index.ts
31
- var index_exports = {};
32
- __export(index_exports, {
33
- default: () => index_default
34
- });
35
- module.exports = __toCommonJS(index_exports);
36
- var SortImportPlugin = __toESM(require("@trivago/prettier-plugin-sort-imports"), 1);
37
- var PackageJsonPlugin = __toESM(require("prettier-plugin-packagejson"), 1);
38
- var ShellPlugin = __toESM(require("prettier-plugin-sh"), 1);
39
- var DEFAULT_CONFIG = {
40
- useTabs: false,
41
- semi: true,
42
- singleQuote: true,
43
- jsxSingleQuote: true,
44
- trailingComma: "es5",
45
- endOfLine: "lf",
46
- printWidth: 100,
47
- overrides: [
48
- {
49
- files: "*.md",
50
- options: {
51
- tabWidth: 2,
52
- useTabs: false,
53
- printWidth: 79
54
- }
55
- },
56
- {
57
- files: ["Dockerfile", "*.dockerfile"],
58
- options: {
59
- spaceRedirects: false
60
- }
61
- }
62
- ],
63
- importOrder: ["node:*", "<THIRD_PARTY_MODULES>", "", "^@/(.*)$", "^@/tests/(.*)$", "", "^[./]"],
64
- importOrderSeparation: true,
65
- importOrderSortSpecifiers: true,
66
- plugins: [SortImportPlugin, PackageJsonPlugin, ShellPlugin]
67
- };
68
- var index_default = DEFAULT_CONFIG;
package/dist/index.d.cts DELETED
@@ -1,34 +0,0 @@
1
- import * as SortImportPlugin from '@trivago/prettier-plugin-sort-imports';
2
-
3
- declare const DEFAULT_CONFIG: {
4
- useTabs: false;
5
- semi: true;
6
- singleQuote: true;
7
- jsxSingleQuote: true;
8
- trailingComma: "es5";
9
- endOfLine: "lf";
10
- printWidth: number;
11
- overrides: ({
12
- files: string;
13
- options: {
14
- tabWidth: number;
15
- useTabs: false;
16
- printWidth: number;
17
- spaceRedirects?: undefined;
18
- };
19
- } | {
20
- files: string[];
21
- options: {
22
- spaceRedirects: boolean;
23
- tabWidth?: undefined;
24
- useTabs?: undefined;
25
- printWidth?: undefined;
26
- };
27
- })[];
28
- importOrder: string[];
29
- importOrderSeparation: boolean;
30
- importOrderSortSpecifiers: boolean;
31
- plugins: (typeof SortImportPlugin)[];
32
- };
33
-
34
- export { DEFAULT_CONFIG as default };
package/dist/index.d.ts DELETED
@@ -1,34 +0,0 @@
1
- import * as SortImportPlugin from '@trivago/prettier-plugin-sort-imports';
2
-
3
- declare const DEFAULT_CONFIG: {
4
- useTabs: false;
5
- semi: true;
6
- singleQuote: true;
7
- jsxSingleQuote: true;
8
- trailingComma: "es5";
9
- endOfLine: "lf";
10
- printWidth: number;
11
- overrides: ({
12
- files: string;
13
- options: {
14
- tabWidth: number;
15
- useTabs: false;
16
- printWidth: number;
17
- spaceRedirects?: undefined;
18
- };
19
- } | {
20
- files: string[];
21
- options: {
22
- spaceRedirects: boolean;
23
- tabWidth?: undefined;
24
- useTabs?: undefined;
25
- printWidth?: undefined;
26
- };
27
- })[];
28
- importOrder: string[];
29
- importOrderSeparation: boolean;
30
- importOrderSortSpecifiers: boolean;
31
- plugins: (typeof SortImportPlugin)[];
32
- };
33
-
34
- export { DEFAULT_CONFIG as default };
package/dist/index.js DELETED
@@ -1,37 +0,0 @@
1
- // src/index.ts
2
- import * as SortImportPlugin from "@trivago/prettier-plugin-sort-imports";
3
- import * as PackageJsonPlugin from "prettier-plugin-packagejson";
4
- import * as ShellPlugin from "prettier-plugin-sh";
5
- var DEFAULT_CONFIG = {
6
- useTabs: false,
7
- semi: true,
8
- singleQuote: true,
9
- jsxSingleQuote: true,
10
- trailingComma: "es5",
11
- endOfLine: "lf",
12
- printWidth: 100,
13
- overrides: [
14
- {
15
- files: "*.md",
16
- options: {
17
- tabWidth: 2,
18
- useTabs: false,
19
- printWidth: 79
20
- }
21
- },
22
- {
23
- files: ["Dockerfile", "*.dockerfile"],
24
- options: {
25
- spaceRedirects: false
26
- }
27
- }
28
- ],
29
- importOrder: ["node:*", "<THIRD_PARTY_MODULES>", "", "^@/(.*)$", "^@/tests/(.*)$", "", "^[./]"],
30
- importOrderSeparation: true,
31
- importOrderSortSpecifiers: true,
32
- plugins: [SortImportPlugin, PackageJsonPlugin, ShellPlugin]
33
- };
34
- var index_default = DEFAULT_CONFIG;
35
- export {
36
- index_default as default
37
- };