@bfra.me/prettier-config 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- package/120-proof.d.ts +8 -3
- package/120-proof.js +7 -5
- package/120-proof.ts +4 -2
- package/package.json +11 -4
- package/plugins.d.ts +6 -3
- package/plugins.js +7 -2
- package/prettier.config.d.ts +4 -2
- package/prettier.config.js +6 -6
- package/prettier.config.ts +1 -0
- package/tsup.config.ts +11 -0
package/120-proof.d.ts
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
-
import
|
1
|
+
import {Config} from 'prettier'
|
2
|
+
|
3
|
+
declare const preset: {
|
4
|
+
readonly printWidth: 120
|
5
|
+
}
|
2
6
|
/**
|
3
7
|
* Shared Prettier configuration for bfra.me projects with `printWidth` set to 120 characters.
|
4
8
|
*/
|
5
|
-
declare const config: Config
|
6
|
-
|
9
|
+
declare const config: Config & typeof preset
|
10
|
+
|
11
|
+
export {config as default}
|
package/120-proof.js
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
import prettierConfig from '@bfra.me/prettier-config'
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
const preset = {
|
3
|
+
printWidth: 120,
|
4
|
+
}
|
5
5
|
const config = {
|
6
6
|
...prettierConfig,
|
7
|
-
|
7
|
+
...preset,
|
8
8
|
}
|
9
|
-
|
9
|
+
var proof_default = config
|
10
|
+
export {proof_default as default}
|
11
|
+
//# sourceMappingURL=120-proof.js.map
|
package/120-proof.ts
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
import prettierConfig from '@bfra.me/prettier-config'
|
2
2
|
import type {Config} from 'prettier'
|
3
3
|
|
4
|
+
const preset = {printWidth: 120} as const
|
5
|
+
|
4
6
|
/**
|
5
7
|
* Shared Prettier configuration for bfra.me projects with `printWidth` set to 120 characters.
|
6
8
|
*/
|
7
|
-
const config: Config = {
|
9
|
+
const config: Config & typeof preset = {
|
8
10
|
...prettierConfig,
|
9
|
-
|
11
|
+
...preset,
|
10
12
|
}
|
11
13
|
|
12
14
|
export default config
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@bfra.me/prettier-config",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.6.0",
|
4
4
|
"description": "Shared Prettier configuration for bfra.me",
|
5
5
|
"keywords": [
|
6
6
|
"bfra.me",
|
@@ -40,9 +40,15 @@
|
|
40
40
|
"@bfra.me/prettier-plugins": "0.3.0"
|
41
41
|
},
|
42
42
|
"devDependencies": {
|
43
|
+
"@types/fs-extra": "11.0.4",
|
44
|
+
"execa": "9.3.1",
|
45
|
+
"fast-glob": "3.3.2",
|
46
|
+
"fs-extra": "11.2.0",
|
43
47
|
"prettier": "3.3.3",
|
48
|
+
"tsup": "8.2.0",
|
49
|
+
"vitest": "2.0.2",
|
44
50
|
"@bfra.me/tsconfig": "0.6.0",
|
45
|
-
"@bfra.me/prettier-config": "0.
|
51
|
+
"@bfra.me/prettier-config": "0.6.0"
|
46
52
|
},
|
47
53
|
"peerDependencies": {
|
48
54
|
"prettier": "^3.0.0"
|
@@ -52,7 +58,8 @@
|
|
52
58
|
"provenance": true
|
53
59
|
},
|
54
60
|
"scripts": {
|
55
|
-
"build": "
|
56
|
-
"format": "prettier --ignore-path .prettierignore --log-level log --write ."
|
61
|
+
"build": "tsup && pnpm run format",
|
62
|
+
"format": "prettier --ignore-path .prettierignore --log-level log --write .",
|
63
|
+
"test": "vitest"
|
57
64
|
}
|
58
65
|
}
|
package/plugins.d.ts
CHANGED
@@ -1,10 +1,13 @@
|
|
1
|
-
import
|
2
|
-
|
1
|
+
import {Plugin} from 'prettier'
|
2
|
+
|
3
|
+
type InteropDefault<T> = T extends {
|
3
4
|
default: infer U
|
4
5
|
}
|
5
6
|
? U
|
6
7
|
: T
|
7
|
-
|
8
|
+
declare const resolve: <T extends Plugin>(
|
8
9
|
resolver: (id: string) => string,
|
9
10
|
plugin: string,
|
10
11
|
) => string | T
|
12
|
+
|
13
|
+
export {type InteropDefault, resolve}
|
package/plugins.js
CHANGED
@@ -1,11 +1,14 @@
|
|
1
|
+
var __defProp = Object.defineProperty
|
2
|
+
var __name = (target, value) => __defProp(target, 'name', {value, configurable: true})
|
1
3
|
function interopDefault(m) {
|
2
4
|
return m.default || m
|
3
5
|
}
|
6
|
+
__name(interopDefault, 'interopDefault')
|
4
7
|
import {default as pluginPackageJson} from '@bfra.me/prettier-plugins/package-json'
|
5
8
|
const resolvedPlugins = {
|
6
9
|
'@bfra.me/prettier-plugins/package-json': interopDefault(pluginPackageJson),
|
7
10
|
}
|
8
|
-
|
11
|
+
const resolve = /* @__PURE__ */ __name((resolver, plugin) => {
|
9
12
|
try {
|
10
13
|
if (resolvedPlugins[plugin]) {
|
11
14
|
return resolvedPlugins[plugin]
|
@@ -14,4 +17,6 @@ export const resolve = (resolver, plugin) => {
|
|
14
17
|
} finally {
|
15
18
|
return plugin
|
16
19
|
}
|
17
|
-
}
|
20
|
+
}, 'resolve')
|
21
|
+
export {resolve}
|
22
|
+
//# sourceMappingURL=plugins.js.map
|
package/prettier.config.d.ts
CHANGED
package/prettier.config.js
CHANGED
@@ -1,10 +1,7 @@
|
|
1
1
|
import {resolve} from './plugins.js'
|
2
2
|
import {createRequire} from 'module'
|
3
|
-
const
|
4
|
-
const resolvePlugin = resolve.bind(null,
|
5
|
-
/**
|
6
|
-
* Shared Prettier configuration for bfra.me projects.
|
7
|
-
*/
|
3
|
+
const require2 = createRequire(import.meta.url)
|
4
|
+
const resolvePlugin = resolve.bind(null, require2.resolve)
|
8
5
|
const config = {
|
9
6
|
arrowParens: 'avoid',
|
10
7
|
bracketSpacing: false,
|
@@ -31,6 +28,7 @@ const config = {
|
|
31
28
|
'**/.vitepress/cache/**',
|
32
29
|
'**/.vite-inspect/**',
|
33
30
|
'**/__snapshots__/**',
|
31
|
+
'**/test/fixtures/**',
|
34
32
|
'**/auto-import?(s).d.ts',
|
35
33
|
'**/.changeset/*.md',
|
36
34
|
'**/CHANGELOG*.md',
|
@@ -70,4 +68,6 @@ const config = {
|
|
70
68
|
],
|
71
69
|
plugins: ['@bfra.me/prettier-plugins/package-json'].map(resolvePlugin),
|
72
70
|
}
|
73
|
-
|
71
|
+
var prettier_config_default = config
|
72
|
+
export {prettier_config_default as default}
|
73
|
+
//# sourceMappingURL=prettier.config.js.map
|
package/prettier.config.ts
CHANGED
package/tsup.config.ts
ADDED