@benhigham/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/LICENSE.md +21 -0
- package/README.md +71 -0
- package/index.js +14 -0
- package/package.json +62 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Benjamin Higham
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# `@benhigham/prettier-config`
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@benhigham/prettier-config)
|
|
4
|
+
[](https://www.npmjs.com/package/@benhigham/prettier-config)
|
|
5
|
+
[](LICENSE.md)
|
|
6
|
+
|
|
7
|
+
My personal [Prettier](https://prettier.io) configuration, designed to enforce consistent code formatting across my JavaScript and TypeScript projects.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- Sensible defaults for modern JavaScript/TypeScript development
|
|
12
|
+
- Ensures consistent formatting across different IDEs and editors
|
|
13
|
+
- Optimized for readability and maintainability
|
|
14
|
+
- Compatible with Prettier v3
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
# npm
|
|
20
|
+
npm install --save-dev @benhigham/prettier-config
|
|
21
|
+
|
|
22
|
+
# yarn
|
|
23
|
+
yarn add --dev @benhigham/prettier-config
|
|
24
|
+
|
|
25
|
+
# pnpm
|
|
26
|
+
pnpm add --save-dev @benhigham/prettier-config
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
### Method 1: Use in `package.json` (recommended)
|
|
32
|
+
|
|
33
|
+
```jsonc
|
|
34
|
+
{
|
|
35
|
+
// ...
|
|
36
|
+
"prettier": "@benhigham/prettier-config",
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Method 2: Use in `prettier.config.js`
|
|
41
|
+
|
|
42
|
+
If you need to extend the configuration:
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
import benhighamPrettierConfig from '@benhigham/prettier-config';
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @type {import('prettier').Config}
|
|
49
|
+
*/
|
|
50
|
+
const config = {
|
|
51
|
+
...benhighamPrettierConfig,
|
|
52
|
+
// your overrides here
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default config;
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Method 3: Use in `.prettierrc`
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
"@benhigham/prettier-config"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Requirements
|
|
65
|
+
|
|
66
|
+
- Node.js 18.20.x or higher
|
|
67
|
+
- [Prettier](https://prettier.io/) 3.x
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
|
package/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @import { Config } from 'prettier' */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* My personal Prettier configuration.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/benhigham/prettier-config
|
|
7
|
+
* @type {Config}
|
|
8
|
+
*/
|
|
9
|
+
const config = {
|
|
10
|
+
singleQuote: true,
|
|
11
|
+
trailingComma: 'all',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default config;
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@benhigham/prettier-config",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "My personal Prettier configuration.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/benhigham/prettier-config#readme",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/benhigham/prettier-config/issues/new"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/benhigham/prettier-config.git"
|
|
13
|
+
},
|
|
14
|
+
"author": {
|
|
15
|
+
"name": "Ben Higham",
|
|
16
|
+
"url": "https://benhigham.com"
|
|
17
|
+
},
|
|
18
|
+
"type": "module",
|
|
19
|
+
"module": "./index.js",
|
|
20
|
+
"exports": "./index.js",
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": "^18.20.0 || ^20.10.0 || >=21.0.0"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"./index.js"
|
|
27
|
+
],
|
|
28
|
+
"keywords": [
|
|
29
|
+
"prettier",
|
|
30
|
+
"format",
|
|
31
|
+
"formatter",
|
|
32
|
+
"code",
|
|
33
|
+
"config",
|
|
34
|
+
"editorconfig",
|
|
35
|
+
"enforce",
|
|
36
|
+
"quality",
|
|
37
|
+
"standard",
|
|
38
|
+
"strict",
|
|
39
|
+
"style",
|
|
40
|
+
"styleguide"
|
|
41
|
+
],
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@benhigham/commitlint-config": "^0.1.0",
|
|
44
|
+
"@changesets/changelog-github": "^0.5.1",
|
|
45
|
+
"@changesets/cli": "^2.28.1",
|
|
46
|
+
"@commitlint/cli": "^19.8.0",
|
|
47
|
+
"@commitlint/prompt-cli": "^19.8.0",
|
|
48
|
+
"lefthook": "^1.11.5",
|
|
49
|
+
"prettier": "^3.5.3"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"prettier": ">=3.0.0"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"format": "prettier --write .",
|
|
56
|
+
"format:check": "prettier --check .",
|
|
57
|
+
"changeset": "changeset",
|
|
58
|
+
"changeset:status": "changeset status",
|
|
59
|
+
"version": "changeset version",
|
|
60
|
+
"release": "changeset publish"
|
|
61
|
+
}
|
|
62
|
+
}
|