@bfra.me/prettier-config 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- package/120-proof.d.ts +1 -0
- package/120-proof.js +2 -0
- package/120-proof.ts +5 -1
- package/package.json +5 -2
- package/prettier.config.js +2 -1
- package/prettier.config.ts +3 -1
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.0",
|
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",
|
@@ -48,7 +51,7 @@
|
|
48
51
|
"tsup": "8.2.0",
|
49
52
|
"vitest": "2.0.2",
|
50
53
|
"@bfra.me/tsconfig": "0.6.0",
|
51
|
-
"@bfra.me/prettier-config": "0.
|
54
|
+
"@bfra.me/prettier-config": "0.7.0"
|
52
55
|
},
|
53
56
|
"peerDependencies": {
|
54
57
|
"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: [
|