@wkovacs64/prettier-config 4.0.1 → 4.1.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.
Files changed (3) hide show
  1. package/README.md +34 -30
  2. package/index.js +2 -2
  3. package/package.json +4 -3
package/README.md CHANGED
@@ -8,27 +8,29 @@ This is my personal [Prettier][prettier] configuration.
8
8
  ### Install
9
9
 
10
10
  ```
11
- npm install --save-dev prettier @wkovacs64/prettier-config
11
+ npm install --save-dev @wkovacs64/prettier-config
12
12
  ```
13
13
 
14
+ > Be sure to install the appropriately versioned `prettier` peer dependency as well.
15
+
14
16
  ### Usage
15
17
 
16
18
  Follow the Prettier documentation on [sharing configurations][prettier-sharing].
17
19
 
18
20
  ### Examples
19
21
 
20
- #### `prettier.config.js`
21
-
22
- ```js
23
- import prettierConfig from '@wkovacs64/prettier-config';
24
-
25
- /** @type {import("prettier").Options} */
26
- export const config = {
27
- ...prettierConfig,
28
- // overrides here
29
- };
22
+ #### `package.json`
30
23
 
31
- export default config;
24
+ ```
25
+ {
26
+ "prettier": "@wkovacs64/prettier-config",
27
+ "scripts": {
28
+ ...
29
+ "format": "prettier --cache --write .",
30
+ "format:check": "prettier --cache --check .",
31
+ ...
32
+ }
33
+ }
32
34
  ```
33
35
 
34
36
  #### `.prettierignore`
@@ -39,29 +41,31 @@ package.json
39
41
  package-lock.json
40
42
  ```
41
43
 
42
- #### `package.json`
44
+ ### Customization
43
45
 
44
- ```
45
- {
46
- "scripts": {
47
- ...
48
- "format": "prettier --cache --write .",
49
- "format:check": "prettier --cache --check .",
50
- ...
51
- }
52
- }
46
+ If you need to customize the configuration, you can use a dedicated Prettier config file instead of
47
+ the one-liner in package.json:
48
+
49
+ #### `prettier.config.js`
50
+
51
+ ```js
52
+ import prettierConfig from '@wkovacs64/prettier-config';
53
+
54
+ /** @type {import("prettier").Options} */
55
+ export const config = {
56
+ ...prettierConfig,
57
+ // overrides here
58
+ };
59
+
60
+ export default config;
53
61
  ```
54
62
 
55
- [npm-image]:
56
- https://img.shields.io/npm/v/@wkovacs64/prettier-config.svg?style=flat-square
63
+ [npm-image]: https://img.shields.io/npm/v/@wkovacs64/prettier-config.svg?style=flat-square
57
64
  [npm-url]: https://www.npmjs.com/package/@wkovacs64/prettier-config
58
65
  [ci-image]:
59
66
  https://img.shields.io/github/actions/workflow/status/wKovacs64/prettier-config/ci.yml?logo=github&style=flat-square
60
- [ci-url]:
61
- https://github.com/wKovacs64/prettier-config/actions?query=workflow%3Aci
62
- [changesets-image]:
63
- https://img.shields.io/badge/maintained%20with-changesets-blue?style=flat-square
67
+ [ci-url]: https://github.com/wKovacs64/prettier-config/actions?query=workflow%3Aci
68
+ [changesets-image]: https://img.shields.io/badge/maintained%20with-changesets-blue?style=flat-square
64
69
  [changesets-url]: https://github.com/changesets/changesets
65
70
  [prettier]: https://prettier.io/
66
- [prettier-sharing]:
67
- https://prettier.io/docs/en/configuration.html#sharing-configurations
71
+ [prettier-sharing]: https://prettier.io/docs/en/configuration.html#sharing-configurations
package/index.js CHANGED
@@ -11,7 +11,6 @@ export default {
11
11
  htmlWhitespaceSensitivity: 'css',
12
12
  insertPragma: false,
13
13
  jsxSingleQuote: false,
14
- printWidth: 80,
15
14
  proseWrap: 'preserve',
16
15
  quoteProps: 'as-needed',
17
16
  rangeEnd: Infinity,
@@ -20,12 +19,13 @@ export default {
20
19
  semi: true,
21
20
  singleAttributePerLine: false,
22
21
  tabWidth: 2,
22
+ trailingComma: 'all',
23
23
  useTabs: false,
24
24
  vueIndentScriptAndStyle: false,
25
25
 
26
26
  // customized
27
+ printWidth: 100,
27
28
  singleQuote: true,
28
- trailingComma: 'all',
29
29
 
30
30
  plugins: ['prettier-plugin-tailwindcss'],
31
31
  tailwindAttributes: ['class', 'className', '.*[cC]lassName'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wkovacs64/prettier-config",
3
- "version": "4.0.1",
3
+ "version": "4.1.1",
4
4
  "description": "@wKovacs64 Prettier config",
5
5
  "keywords": [
6
6
  "prettier",
@@ -15,7 +15,8 @@
15
15
  "type": "module",
16
16
  "main": "index.js",
17
17
  "exports": {
18
- ".": "./index.js"
18
+ ".": "./index.js",
19
+ "./package.json": "./package.json"
19
20
  },
20
21
  "files": [
21
22
  "index.js"
@@ -54,6 +55,6 @@
54
55
  "eslint": "8.57.0",
55
56
  "eslint-plugin-wkovacs64": "16.2.0",
56
57
  "npm-run-all2": "6.2.0",
57
- "prettier": "3.3.0"
58
+ "prettier": "3.3.2"
58
59
  }
59
60
  }