@shahrad/prettier-config 1.0.0 → 1.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/README.md +6 -3
- package/dist/index.cjs +58 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +37 -0
- package/package.json +27 -12
- package/index.js +0 -28
package/README.md
CHANGED
|
@@ -27,11 +27,14 @@ pnpm i -D @shahrad/prettier-config
|
|
|
27
27
|
###### `prettier.config.mjs`
|
|
28
28
|
|
|
29
29
|
```javascript
|
|
30
|
-
import
|
|
30
|
+
import DEFAULT_CONFIG from '@shahrad/prettier-config';
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
/** @type {import('prettier').Config} */
|
|
33
|
+
const config = Object.assign(DEFAULT_CONFIG, {
|
|
34
|
+
trailingComma: 'none',
|
|
34
35
|
});
|
|
36
|
+
|
|
37
|
+
export default config;
|
|
35
38
|
```
|
|
36
39
|
|
|
37
40
|
## License
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
default: () => index_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
var DEFAULT_CONFIG = {
|
|
27
|
+
useTabs: false,
|
|
28
|
+
semi: true,
|
|
29
|
+
singleQuote: true,
|
|
30
|
+
jsxSingleQuote: true,
|
|
31
|
+
trailingComma: "es5",
|
|
32
|
+
endOfLine: "lf",
|
|
33
|
+
printWidth: 100,
|
|
34
|
+
overrides: [
|
|
35
|
+
{
|
|
36
|
+
files: "*.md",
|
|
37
|
+
options: {
|
|
38
|
+
tabWidth: 2,
|
|
39
|
+
useTabs: false,
|
|
40
|
+
printWidth: 79
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
files: ["Dockerfile", "*.dockerfile"],
|
|
45
|
+
options: {
|
|
46
|
+
spaceRedirects: false
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
importOrder: ["node:*", "<THIRD_PARTY_MODULES>", "", "^@/(.*)$", "^@/tests/(.*)$", "", "^[./]"],
|
|
51
|
+
importOrderParserPlugins: ["typescript", "jsx", "explicitResourceManagement"],
|
|
52
|
+
plugins: [
|
|
53
|
+
"@ianvs/prettier-plugin-sort-imports",
|
|
54
|
+
"prettier-plugin-packagejson",
|
|
55
|
+
"prettier-plugin-sh"
|
|
56
|
+
]
|
|
57
|
+
};
|
|
58
|
+
var index_default = DEFAULT_CONFIG;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare const DEFAULT_CONFIG: {
|
|
2
|
+
useTabs: false;
|
|
3
|
+
semi: true;
|
|
4
|
+
singleQuote: true;
|
|
5
|
+
jsxSingleQuote: true;
|
|
6
|
+
trailingComma: "es5";
|
|
7
|
+
endOfLine: "lf";
|
|
8
|
+
printWidth: number;
|
|
9
|
+
overrides: ({
|
|
10
|
+
files: string;
|
|
11
|
+
options: {
|
|
12
|
+
tabWidth: number;
|
|
13
|
+
useTabs: false;
|
|
14
|
+
printWidth: number;
|
|
15
|
+
spaceRedirects?: undefined;
|
|
16
|
+
};
|
|
17
|
+
} | {
|
|
18
|
+
files: string[];
|
|
19
|
+
options: {
|
|
20
|
+
spaceRedirects: boolean;
|
|
21
|
+
tabWidth?: undefined;
|
|
22
|
+
useTabs?: undefined;
|
|
23
|
+
printWidth?: undefined;
|
|
24
|
+
};
|
|
25
|
+
})[];
|
|
26
|
+
importOrder: string[];
|
|
27
|
+
importOrderParserPlugins: ("explicitResourceManagement" | "jsx" | "typescript")[];
|
|
28
|
+
plugins: string[];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { DEFAULT_CONFIG as default };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// index.ts
|
|
2
|
+
var DEFAULT_CONFIG = {
|
|
3
|
+
useTabs: false,
|
|
4
|
+
semi: true,
|
|
5
|
+
singleQuote: true,
|
|
6
|
+
jsxSingleQuote: true,
|
|
7
|
+
trailingComma: "es5",
|
|
8
|
+
endOfLine: "lf",
|
|
9
|
+
printWidth: 100,
|
|
10
|
+
overrides: [
|
|
11
|
+
{
|
|
12
|
+
files: "*.md",
|
|
13
|
+
options: {
|
|
14
|
+
tabWidth: 2,
|
|
15
|
+
useTabs: false,
|
|
16
|
+
printWidth: 79
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
files: ["Dockerfile", "*.dockerfile"],
|
|
21
|
+
options: {
|
|
22
|
+
spaceRedirects: false
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
importOrder: ["node:*", "<THIRD_PARTY_MODULES>", "", "^@/(.*)$", "^@/tests/(.*)$", "", "^[./]"],
|
|
27
|
+
importOrderParserPlugins: ["typescript", "jsx", "explicitResourceManagement"],
|
|
28
|
+
plugins: [
|
|
29
|
+
"@ianvs/prettier-plugin-sort-imports",
|
|
30
|
+
"prettier-plugin-packagejson",
|
|
31
|
+
"prettier-plugin-sh"
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
var index_default = DEFAULT_CONFIG;
|
|
35
|
+
export {
|
|
36
|
+
index_default as default
|
|
37
|
+
};
|
package/package.json
CHANGED
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shahrad/prettier-config",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"private": false,
|
|
3
|
+
"version": "1.2.0",
|
|
5
4
|
"description": "My personal Prettier config",
|
|
6
5
|
"homepage": "https://github.com/shahradelahi/prettier-config#readme",
|
|
7
|
-
"repository":
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/shahradelahi/prettier-config.git"
|
|
9
|
+
},
|
|
8
10
|
"license": "MIT",
|
|
9
11
|
"author": "Shahrad Elahi <shahrad@litehex.com> (https://github.com/shahradelahi)",
|
|
10
12
|
"type": "module",
|
|
11
|
-
"
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
|
+
"require": "./dist/index.cjs"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"main": "dist/index.cjs",
|
|
21
|
+
"module": "dist/index.js",
|
|
22
|
+
"types": "dist/index.d.ts",
|
|
12
23
|
"files": [
|
|
13
|
-
"
|
|
24
|
+
"dist/**",
|
|
25
|
+
"!*.d.cts"
|
|
14
26
|
],
|
|
15
27
|
"scripts": {
|
|
16
|
-
"
|
|
28
|
+
"build": "tsup --dts-resolve --format cjs,esm index.ts",
|
|
29
|
+
"clean": "git clean -xdf node_modules dist",
|
|
17
30
|
"format": "prettier --write .",
|
|
18
31
|
"format:check": "prettier --check .",
|
|
19
32
|
"lint": "eslint .",
|
|
@@ -21,20 +34,22 @@
|
|
|
21
34
|
"prepublishOnly": "pnpm lint && pnpm format:check"
|
|
22
35
|
},
|
|
23
36
|
"dependencies": {
|
|
24
|
-
"@ianvs/prettier-plugin-sort-imports": "^4.4.
|
|
25
|
-
"prettier-plugin-packagejson": "^2.5.
|
|
37
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
|
38
|
+
"prettier-plugin-packagejson": "^2.5.8",
|
|
26
39
|
"prettier-plugin-sh": "^0.14.0"
|
|
27
40
|
},
|
|
28
41
|
"devDependencies": {
|
|
29
42
|
"@shahrad/eslint-config": "^1.0.0",
|
|
30
|
-
"
|
|
43
|
+
"@sindresorhus/tsconfig": "^7.0.0",
|
|
44
|
+
"eslint": "^9.21.0",
|
|
45
|
+
"tsup": "^8.3.6",
|
|
46
|
+
"typescript": "^5.7.3"
|
|
31
47
|
},
|
|
32
48
|
"peerDependencies": {
|
|
33
49
|
"prettier": ">=3.0.0"
|
|
34
50
|
},
|
|
35
|
-
"packageManager": "pnpm@9.
|
|
51
|
+
"packageManager": "pnpm@9.15.5",
|
|
36
52
|
"publishConfig": {
|
|
37
|
-
"access": "public"
|
|
38
|
-
"provenance": true
|
|
53
|
+
"access": "public"
|
|
39
54
|
}
|
|
40
55
|
}
|
package/index.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/** @type {import('prettier').Config} */
|
|
2
|
-
const config = {
|
|
3
|
-
useTabs: false,
|
|
4
|
-
semi: true,
|
|
5
|
-
singleQuote: true,
|
|
6
|
-
jsxSingleQuote: true,
|
|
7
|
-
trailingComma: 'es5',
|
|
8
|
-
endOfLine: 'lf',
|
|
9
|
-
printWidth: 100,
|
|
10
|
-
overrides: [
|
|
11
|
-
{
|
|
12
|
-
files: '*.md',
|
|
13
|
-
options: {
|
|
14
|
-
tabWidth: 2,
|
|
15
|
-
useTabs: false,
|
|
16
|
-
printWidth: 79,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
importOrder: ['<THIRD_PARTY_MODULES>', '', '^@/(.*)$', '^@/tests/(.*)$', '', '^[./]'],
|
|
21
|
-
plugins: [
|
|
22
|
-
'@ianvs/prettier-plugin-sort-imports',
|
|
23
|
-
'prettier-plugin-packagejson',
|
|
24
|
-
'prettier-plugin-sh',
|
|
25
|
-
],
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export default config;
|