-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a29076b
commit e38636f
Showing
11 changed files
with
246 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@bfra.me/prettier-config": minor | ||
--- | ||
|
||
Add the `prettier-config` shareable Prettier configuration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1 @@ | ||
arrowParens: avoid | ||
bracketSpacing: false | ||
overrides: | ||
- files: | ||
- '.vscode/*.json' | ||
options: | ||
tabWidth: 4 | ||
singleQuote: true | ||
semi: false | ||
printWidth: 100 | ||
tabWidth: 2 | ||
'@bfra.me/prettier-config' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"name": "@bfra.me/prettier-config", | ||
"description": "Shared Prettier configuration for bfra.me", | ||
"version": "0.0.0", | ||
"author": "Marcus R. Brown <contact@bfra.me>", | ||
"license": "MIT", | ||
"type": "module", | ||
"main": "prettier.config.js", | ||
"types": "prettier.config.d.ts", | ||
"homepage": "https://github.com/bfra-me/works/tree/main/packages/prettier-config#readme", | ||
"repository": { | ||
"directory": "packages/prettier-config", | ||
"type": "git", | ||
"url": "https://github.com/bfra-me/works.git" | ||
}, | ||
"bugs": "https://github.com/bfra-me/works/issues", | ||
"keywords": [ | ||
"bfra.me", | ||
"works", | ||
"prettier", | ||
"prettier-config", | ||
"config", | ||
"shared" | ||
], | ||
"publishConfig": { | ||
"access": "public", | ||
"provenance": true | ||
}, | ||
"files": [ | ||
"prettier.config.*", | ||
"!*.map" | ||
], | ||
"exports": { | ||
".": { | ||
"import": "./prettier.config.js", | ||
"types": "./prettier.config.d.ts" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"devDependencies": { | ||
"@bfra.me/tsconfig": "workspace:*", | ||
"prettier": "3.2.5" | ||
}, | ||
"peerDependencies": { | ||
"prettier": "^3.0.0" | ||
}, | ||
"scripts": { | ||
"build": "tsc && prettier --log-level silent --write prettier.config.*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type {Config} from 'prettier' | ||
/** | ||
* Shared Prettier configuration for bfra.me projects. | ||
*/ | ||
declare const config: Config | ||
export default config |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import type {Config} from 'prettier' | ||
|
||
/** | ||
* Shared Prettier configuration for bfra.me projects. | ||
*/ | ||
const config: Config = { | ||
arrowParens: 'avoid', | ||
bracketSpacing: false, | ||
endOfLine: 'auto', | ||
printWidth: 100, | ||
semi: false, | ||
singleQuote: true, | ||
|
||
overrides: [ | ||
// VS Code configuration files: | ||
// Use 4 spaces for indentation to match the default VS Code settings. | ||
{ | ||
files: ['.vscode/*.json'], | ||
options: { | ||
tabWidth: 4, | ||
}, | ||
}, | ||
|
||
// Markdown: | ||
// - Disable single quotes for Markdown files. | ||
// - Disable `proseWrap` to avoid wrapping prose. | ||
{ | ||
files: ['*.md'], | ||
options: { | ||
proseWrap: 'never', | ||
singleQuote: false, | ||
}, | ||
}, | ||
|
||
// Adapted from https://github.com/sxzz/prettier-config/blob/1e5cc3021e5816aceebe0b90af1d530239442ecf/index.js. | ||
// Require a pragma for paths typically not under version control or written by build tools. | ||
{ | ||
files: [ | ||
'**/node_modules/**', | ||
'**/dist/**', | ||
'**/lib/**', | ||
'**/coverage/**', | ||
'**/out/**', | ||
'**/.changeset/**', | ||
'**/.idea/**', | ||
'**/.nuxt/**', | ||
'**/.vercel/**', | ||
'**/.vitepress/cache/**', | ||
'**/.vite-inspect/**', | ||
'**/__snapshots__/**', | ||
|
||
'**/CHANGELOG*.md', | ||
'**/changelog*.md', | ||
'**/LICENSE*', | ||
'**/license*', | ||
'**/*.min.*', | ||
], | ||
options: { | ||
requirePragma: true, | ||
}, | ||
}, | ||
], | ||
} | ||
|
||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# @bfra.me/prettier-config | ||
|
||
> Shared Prettier configuration for bfra.me. | ||
## Install | ||
|
||
### NPM | ||
|
||
```sh | ||
npm install --save-dev @bfra.me/prettier-config prettier | ||
``` | ||
|
||
### PNPM | ||
|
||
```sh | ||
pnpm add --save-dev @bfra.me/prettier-config prettier | ||
``` | ||
|
||
### Yarn | ||
|
||
```sh | ||
yarn add --dev @bfra.me/prettier-config prettier | ||
``` | ||
|
||
## Usage | ||
|
||
Add the following entry to your `package.json` file: | ||
|
||
```json | ||
"prettier": "@bfra.me/prettier-config" | ||
``` | ||
|
||
## License | ||
|
||
[MIT](../../LICENSE.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/tsconfig", | ||
"extends": "@bfra.me/tsconfig", | ||
"compilerOptions": { | ||
"inlineSourceMap": true, | ||
"sourceMap": false, | ||
"outDir": ".", | ||
"rootDir": "." | ||
}, | ||
"exclude": ["node_modules"] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.