@javalce/prettier-config 1.0.2 → 2.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/dist/index.cjs +47 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +22 -0
- package/package.json +29 -11
- package/src/index.js +0 -24
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
defineConfig: () => defineConfig
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
function defineConfig(config) {
|
|
27
|
+
const { plugins = [], overrides = [], ...customConfig } = config ?? {};
|
|
28
|
+
return {
|
|
29
|
+
printWidth: 100,
|
|
30
|
+
tabWidth: 2,
|
|
31
|
+
useTabs: false,
|
|
32
|
+
endOfLine: "lf",
|
|
33
|
+
trailingComma: "all",
|
|
34
|
+
semi: true,
|
|
35
|
+
singleQuote: true,
|
|
36
|
+
jsxSingleQuote: true,
|
|
37
|
+
bracketSpacing: true,
|
|
38
|
+
arrowParens: "always",
|
|
39
|
+
...customConfig,
|
|
40
|
+
plugins: ["prettier-plugin-packagejson", ...plugins],
|
|
41
|
+
overrides
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
+
0 && (module.exports = {
|
|
46
|
+
defineConfig
|
|
47
|
+
});
|
package/dist/index.d.cts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
function defineConfig(config) {
|
|
3
|
+
const { plugins = [], overrides = [], ...customConfig } = config ?? {};
|
|
4
|
+
return {
|
|
5
|
+
printWidth: 100,
|
|
6
|
+
tabWidth: 2,
|
|
7
|
+
useTabs: false,
|
|
8
|
+
endOfLine: "lf",
|
|
9
|
+
trailingComma: "all",
|
|
10
|
+
semi: true,
|
|
11
|
+
singleQuote: true,
|
|
12
|
+
jsxSingleQuote: true,
|
|
13
|
+
bracketSpacing: true,
|
|
14
|
+
arrowParens: "always",
|
|
15
|
+
...customConfig,
|
|
16
|
+
plugins: ["prettier-plugin-packagejson", ...plugins],
|
|
17
|
+
overrides
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
defineConfig
|
|
22
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@javalce/prettier-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Javier's Prettier configuration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"prettier"
|
|
@@ -15,25 +15,41 @@
|
|
|
15
15
|
},
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"author": "Javier Valero <javalce29@gmail.com>",
|
|
18
|
-
"
|
|
18
|
+
"type": "module",
|
|
19
|
+
"exports": {
|
|
20
|
+
"./package.json": "./package.json",
|
|
21
|
+
".": {
|
|
22
|
+
"import": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"require": {
|
|
27
|
+
"types": "./dist/index.d.cts",
|
|
28
|
+
"default": "./dist/index.cjs"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
19
32
|
"files": [
|
|
20
|
-
"
|
|
33
|
+
"dist"
|
|
21
34
|
],
|
|
22
35
|
"lint-staged": {
|
|
23
36
|
"*": "prettier -w --ignore-unknown"
|
|
24
37
|
},
|
|
25
|
-
"prettier": "./
|
|
38
|
+
"prettier": "./dist/index.js",
|
|
26
39
|
"dependencies": {
|
|
27
|
-
"prettier-plugin-packagejson": "^2.5.
|
|
40
|
+
"prettier-plugin-packagejson": "^2.5.7"
|
|
28
41
|
},
|
|
29
42
|
"devDependencies": {
|
|
30
|
-
"@
|
|
31
|
-
"@commitlint/
|
|
32
|
-
"
|
|
43
|
+
"@arethetypeswrong/cli": "^0.17.3",
|
|
44
|
+
"@commitlint/cli": "^19.6.1",
|
|
45
|
+
"@commitlint/config-conventional": "^19.6.0",
|
|
46
|
+
"bumpp": "^9.10.1",
|
|
33
47
|
"conventional-changelog-cli": "^5.0.0",
|
|
34
|
-
"husky": "^9.1.
|
|
35
|
-
"lint-staged": "^15.
|
|
36
|
-
"prettier": "^3.
|
|
48
|
+
"husky": "^9.1.7",
|
|
49
|
+
"lint-staged": "^15.4.1",
|
|
50
|
+
"prettier": "^3.4.2",
|
|
51
|
+
"tsup": "^8.3.5",
|
|
52
|
+
"typescript": "^5.7.3"
|
|
37
53
|
},
|
|
38
54
|
"peerDependencies": {
|
|
39
55
|
"prettier": ">=3.0.0 <4"
|
|
@@ -47,7 +63,9 @@
|
|
|
47
63
|
"access": "public"
|
|
48
64
|
},
|
|
49
65
|
"scripts": {
|
|
66
|
+
"build": "tsup",
|
|
50
67
|
"changelog": "conventional-changelog -i CHANGELOG.md -s -t v -p angular && git add CHANGELOG.md",
|
|
68
|
+
"check-exports": "attw --pack .",
|
|
51
69
|
"format": "prettier --write .",
|
|
52
70
|
"format:check": "prettier --check .",
|
|
53
71
|
"release": "bumpp && pnpm publish",
|
package/src/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Some of Prettier's defaults can be overridden by an EditorConfig file. We
|
|
3
|
-
* define those here to ensure that doesn't happen.
|
|
4
|
-
*
|
|
5
|
-
* See: https://github.com/prettier/prettier/blob/main/docs/configuration.md#editorconfig
|
|
6
|
-
*/
|
|
7
|
-
const overridableDefaults = {
|
|
8
|
-
printWidth: 100,
|
|
9
|
-
tabWidth: 2,
|
|
10
|
-
useTabs: false,
|
|
11
|
-
endOfLine: 'lf',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/** @type {import('prettier').Config} */
|
|
15
|
-
module.exports = {
|
|
16
|
-
...overridableDefaults,
|
|
17
|
-
trailingComma: 'all',
|
|
18
|
-
semi: true,
|
|
19
|
-
singleQuote: true,
|
|
20
|
-
jsxSingleQuote: true,
|
|
21
|
-
bracketSpacing: true,
|
|
22
|
-
arrowParens: 'always',
|
|
23
|
-
plugins: ['prettier-plugin-packagejson'],
|
|
24
|
-
};
|