@bfra.me/prettier-config 0.1.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/package.json +50 -0
- package/prettier.config.d.ts +6 -0
- package/prettier.config.js +59 -0
- package/prettier.config.ts +65 -0
- package/readme.md +35 -0
package/package.json
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
{
|
2
|
+
"name": "@bfra.me/prettier-config",
|
3
|
+
"description": "Shared Prettier configuration for bfra.me",
|
4
|
+
"version": "0.1.0",
|
5
|
+
"author": "Marcus R. Brown <contact@bfra.me>",
|
6
|
+
"license": "MIT",
|
7
|
+
"type": "module",
|
8
|
+
"main": "prettier.config.js",
|
9
|
+
"types": "prettier.config.d.ts",
|
10
|
+
"homepage": "https://github.com/bfra-me/works/tree/main/packages/prettier-config#readme",
|
11
|
+
"repository": {
|
12
|
+
"directory": "packages/prettier-config",
|
13
|
+
"type": "git",
|
14
|
+
"url": "https://github.com/bfra-me/works.git"
|
15
|
+
},
|
16
|
+
"bugs": "https://github.com/bfra-me/works/issues",
|
17
|
+
"keywords": [
|
18
|
+
"bfra.me",
|
19
|
+
"works",
|
20
|
+
"prettier",
|
21
|
+
"prettier-config",
|
22
|
+
"config",
|
23
|
+
"shared"
|
24
|
+
],
|
25
|
+
"publishConfig": {
|
26
|
+
"access": "public",
|
27
|
+
"provenance": true
|
28
|
+
},
|
29
|
+
"files": [
|
30
|
+
"prettier.config.*",
|
31
|
+
"!*.map"
|
32
|
+
],
|
33
|
+
"exports": {
|
34
|
+
".": {
|
35
|
+
"import": "./prettier.config.js",
|
36
|
+
"types": "./prettier.config.d.ts"
|
37
|
+
},
|
38
|
+
"./package.json": "./package.json"
|
39
|
+
},
|
40
|
+
"devDependencies": {
|
41
|
+
"prettier": "3.2.5",
|
42
|
+
"@bfra.me/tsconfig": "0.2.5"
|
43
|
+
},
|
44
|
+
"peerDependencies": {
|
45
|
+
"prettier": "^3.0.0"
|
46
|
+
},
|
47
|
+
"scripts": {
|
48
|
+
"build": "tsc && prettier --log-level silent --write prettier.config.*"
|
49
|
+
}
|
50
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
/**
|
2
|
+
* Shared Prettier configuration for bfra.me projects.
|
3
|
+
*/
|
4
|
+
const config = {
|
5
|
+
arrowParens: 'avoid',
|
6
|
+
bracketSpacing: false,
|
7
|
+
endOfLine: 'auto',
|
8
|
+
printWidth: 100,
|
9
|
+
semi: false,
|
10
|
+
singleQuote: true,
|
11
|
+
overrides: [
|
12
|
+
// VS Code configuration files:
|
13
|
+
// Use 4 spaces for indentation to match the default VS Code settings.
|
14
|
+
{
|
15
|
+
files: ['.vscode/*.json'],
|
16
|
+
options: {
|
17
|
+
tabWidth: 4,
|
18
|
+
},
|
19
|
+
},
|
20
|
+
// Markdown:
|
21
|
+
// - Disable single quotes for Markdown files.
|
22
|
+
// - Disable `proseWrap` to avoid wrapping prose.
|
23
|
+
{
|
24
|
+
files: ['*.md'],
|
25
|
+
options: {
|
26
|
+
proseWrap: 'never',
|
27
|
+
singleQuote: false,
|
28
|
+
},
|
29
|
+
},
|
30
|
+
// Adapted from https://github.com/sxzz/prettier-config/blob/1e5cc3021e5816aceebe0b90af1d530239442ecf/index.js.
|
31
|
+
// Require a pragma for paths typically not under version control or written by build tools.
|
32
|
+
{
|
33
|
+
files: [
|
34
|
+
'**/node_modules/**',
|
35
|
+
'**/dist/**',
|
36
|
+
'**/lib/**',
|
37
|
+
'**/coverage/**',
|
38
|
+
'**/out/**',
|
39
|
+
'**/.changeset/**',
|
40
|
+
'**/.idea/**',
|
41
|
+
'**/.nuxt/**',
|
42
|
+
'**/.vercel/**',
|
43
|
+
'**/.vitepress/cache/**',
|
44
|
+
'**/.vite-inspect/**',
|
45
|
+
'**/__snapshots__/**',
|
46
|
+
'**/CHANGELOG*.md',
|
47
|
+
'**/changelog*.md',
|
48
|
+
'**/LICENSE*',
|
49
|
+
'**/license*',
|
50
|
+
'**/*.min.*',
|
51
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mLHdCQUF3QjtnQkFDeEIscUJBQXFCO2dCQUNyQixxQkFBcUI7Z0JBRXJCLGtCQUFrQjtnQkFDbEIsa0JBQWtCO2dCQUNsQixhQUFhO2dCQUNiLGFBQWE7Z0JBQ2IsWUFBWTthQUNiO1lBQ0QsT0FBTyxFQUFFO2dCQUNQLGFBQWEsRUFBRSxJQUFJO2FBQ3BCO1NBQ0Y7S0FDRjtDQUNGLENBQUE7QUFFRCxlQUFlLE1BQU0sQ0FBQSJ9
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import type {Config} from 'prettier'
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Shared Prettier configuration for bfra.me projects.
|
5
|
+
*/
|
6
|
+
const config: Config = {
|
7
|
+
arrowParens: 'avoid',
|
8
|
+
bracketSpacing: false,
|
9
|
+
endOfLine: 'auto',
|
10
|
+
printWidth: 100,
|
11
|
+
semi: false,
|
12
|
+
singleQuote: true,
|
13
|
+
|
14
|
+
overrides: [
|
15
|
+
// VS Code configuration files:
|
16
|
+
// Use 4 spaces for indentation to match the default VS Code settings.
|
17
|
+
{
|
18
|
+
files: ['.vscode/*.json'],
|
19
|
+
options: {
|
20
|
+
tabWidth: 4,
|
21
|
+
},
|
22
|
+
},
|
23
|
+
|
24
|
+
// Markdown:
|
25
|
+
// - Disable single quotes for Markdown files.
|
26
|
+
// - Disable `proseWrap` to avoid wrapping prose.
|
27
|
+
{
|
28
|
+
files: ['*.md'],
|
29
|
+
options: {
|
30
|
+
proseWrap: 'never',
|
31
|
+
singleQuote: false,
|
32
|
+
},
|
33
|
+
},
|
34
|
+
|
35
|
+
// Adapted from https://github.com/sxzz/prettier-config/blob/1e5cc3021e5816aceebe0b90af1d530239442ecf/index.js.
|
36
|
+
// Require a pragma for paths typically not under version control or written by build tools.
|
37
|
+
{
|
38
|
+
files: [
|
39
|
+
'**/node_modules/**',
|
40
|
+
'**/dist/**',
|
41
|
+
'**/lib/**',
|
42
|
+
'**/coverage/**',
|
43
|
+
'**/out/**',
|
44
|
+
'**/.changeset/**',
|
45
|
+
'**/.idea/**',
|
46
|
+
'**/.nuxt/**',
|
47
|
+
'**/.vercel/**',
|
48
|
+
'**/.vitepress/cache/**',
|
49
|
+
'**/.vite-inspect/**',
|
50
|
+
'**/__snapshots__/**',
|
51
|
+
|
52
|
+
'**/CHANGELOG*.md',
|
53
|
+
'**/changelog*.md',
|
54
|
+
'**/LICENSE*',
|
55
|
+
'**/license*',
|
56
|
+
'**/*.min.*',
|
57
|
+
],
|
58
|
+
options: {
|
59
|
+
requirePragma: true,
|
60
|
+
},
|
61
|
+
},
|
62
|
+
],
|
63
|
+
}
|
64
|
+
|
65
|
+
export default config
|
package/readme.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# @bfra.me/prettier-config
|
2
|
+
|
3
|
+
> Shared Prettier configuration for bfra.me.
|
4
|
+
|
5
|
+
## Install
|
6
|
+
|
7
|
+
### NPM
|
8
|
+
|
9
|
+
```sh
|
10
|
+
npm install --save-dev @bfra.me/prettier-config prettier
|
11
|
+
```
|
12
|
+
|
13
|
+
### PNPM
|
14
|
+
|
15
|
+
```sh
|
16
|
+
pnpm add --save-dev @bfra.me/prettier-config prettier
|
17
|
+
```
|
18
|
+
|
19
|
+
### Yarn
|
20
|
+
|
21
|
+
```sh
|
22
|
+
yarn add --dev @bfra.me/prettier-config prettier
|
23
|
+
```
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
Add the following entry to your `package.json` file:
|
28
|
+
|
29
|
+
```json
|
30
|
+
"prettier": "@bfra.me/prettier-config"
|
31
|
+
```
|
32
|
+
|
33
|
+
## License
|
34
|
+
|
35
|
+
[MIT](../../LICENSE.md)
|