@bfra.me/prettier-config 0.6.0 → 0.7.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/120-proof.d.ts +1 -0
- package/120-proof.js +2 -0
- package/120-proof.ts +5 -1
- package/package.json +9 -5
- package/prettier.config.js +2 -1
- package/prettier.config.ts +3 -1
- package/tsup.config.ts +0 -11
package/120-proof.d.ts
CHANGED
package/120-proof.js
CHANGED
package/120-proof.ts
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
import prettierConfig from '@bfra.me/prettier-config'
|
2
2
|
import type {Config} from 'prettier'
|
3
3
|
|
4
|
-
const
|
4
|
+
const {searchParams: params} = new URL(import.meta.url)
|
5
|
+
const preset = {
|
6
|
+
semi: params.has('semi') || prettierConfig.semi || false,
|
7
|
+
printWidth: 120,
|
8
|
+
} as const satisfies Pick<Config, 'printWidth' | 'semi'>
|
5
9
|
|
6
10
|
/**
|
7
11
|
* Shared Prettier configuration for bfra.me projects with `printWidth` set to 120 characters.
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@bfra.me/prettier-config",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.7.1",
|
4
4
|
"description": "Shared Prettier configuration for bfra.me",
|
5
5
|
"keywords": [
|
6
6
|
"bfra.me",
|
@@ -27,6 +27,9 @@
|
|
27
27
|
},
|
28
28
|
"./100-proof": "./prettier.config.js",
|
29
29
|
"./120-proof": "./120-proof.js",
|
30
|
+
"./semi/*": "./*.js?semi=true",
|
31
|
+
"./semi": "./prettier.config.js?semi=true",
|
32
|
+
"./*/semi": "./*.js?semi=true",
|
30
33
|
"./package.json": "./package.json"
|
31
34
|
},
|
32
35
|
"main": "prettier.config.js",
|
@@ -34,7 +37,8 @@
|
|
34
37
|
"files": [
|
35
38
|
"*.js",
|
36
39
|
"*.ts",
|
37
|
-
"
|
40
|
+
"!**/*.map",
|
41
|
+
"!tsup.config.ts"
|
38
42
|
],
|
39
43
|
"dependencies": {
|
40
44
|
"@bfra.me/prettier-plugins": "0.3.0"
|
@@ -46,9 +50,9 @@
|
|
46
50
|
"fs-extra": "11.2.0",
|
47
51
|
"prettier": "3.3.3",
|
48
52
|
"tsup": "8.2.0",
|
49
|
-
"vitest": "2.0
|
50
|
-
"@bfra.me/
|
51
|
-
"@bfra.me/
|
53
|
+
"vitest": "2.1.0",
|
54
|
+
"@bfra.me/prettier-config": "0.7.1",
|
55
|
+
"@bfra.me/tsconfig": "0.7.0"
|
52
56
|
},
|
53
57
|
"peerDependencies": {
|
54
58
|
"prettier": "^3.0.0"
|
package/prettier.config.js
CHANGED
@@ -2,12 +2,13 @@ import {resolve} from './plugins.js'
|
|
2
2
|
import {createRequire} from 'module'
|
3
3
|
const require2 = createRequire(import.meta.url)
|
4
4
|
const resolvePlugin = resolve.bind(null, require2.resolve)
|
5
|
+
const {searchParams: params} = new URL(import.meta.url)
|
5
6
|
const config = {
|
6
7
|
arrowParens: 'avoid',
|
7
8
|
bracketSpacing: false,
|
8
9
|
endOfLine: 'auto',
|
9
10
|
printWidth: 100,
|
10
|
-
semi:
|
11
|
+
semi: params.has('semi', 'true'),
|
11
12
|
singleQuote: true,
|
12
13
|
overrides: [
|
13
14
|
// Adapted from https://github.com/sxzz/prettier-config/blob/1e5cc3021e5816aceebe0b90af1d530239442ecf/index.js.
|
package/prettier.config.ts
CHANGED
@@ -6,6 +6,8 @@ import {createRequire} from 'module'
|
|
6
6
|
const require = createRequire(import.meta.url)
|
7
7
|
const resolvePlugin = resolve.bind(null, require.resolve)
|
8
8
|
|
9
|
+
const {searchParams: params} = new URL(import.meta.url)
|
10
|
+
|
9
11
|
/**
|
10
12
|
* Shared Prettier configuration for bfra.me projects.
|
11
13
|
*/
|
@@ -14,7 +16,7 @@ const config: Config = {
|
|
14
16
|
bracketSpacing: false,
|
15
17
|
endOfLine: 'auto',
|
16
18
|
printWidth: 100,
|
17
|
-
semi:
|
19
|
+
semi: params.has('semi', 'true'),
|
18
20
|
singleQuote: true,
|
19
21
|
|
20
22
|
overrides: [
|
package/tsup.config.ts
DELETED