@teo-garcia/prettier-config-shared 0.2.1 → 0.2.8

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.
@@ -0,0 +1,41 @@
1
+ name: Publish to npm
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ publish:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+ id-token: write
14
+ steps:
15
+ - name: Checkout code
16
+ uses: actions/checkout@v4
17
+
18
+ - name: Setup pnpm
19
+ uses: pnpm/action-setup@v4
20
+ with:
21
+ version: 9
22
+
23
+ - name: Setup Node.js
24
+ uses: actions/setup-node@v4
25
+ with:
26
+ node-version: '22'
27
+ registry-url: 'https://registry.npmjs.org'
28
+
29
+ - name: Setup npm for Trusted Publishing
30
+ run: npm install -g npm@latest && npm --version
31
+
32
+ - name: Install dependencies
33
+ run: pnpm install --no-frozen-lockfile
34
+
35
+ - name: Publish to npm via OIDC
36
+ run: npm publish --provenance --access public
37
+
38
+ - name: Create GitHub Release
39
+ uses: softprops/action-gh-release@v2
40
+ with:
41
+ generate_release_notes: true
@@ -0,0 +1,17 @@
1
+ # Dependencies
2
+ node_modules/
3
+
4
+ # Build output
5
+ dist/
6
+
7
+ # Lockfiles (auto-generated, format varies by package manager version)
8
+ pnpm-lock.yaml
9
+ package-lock.json
10
+ yarn.lock
11
+
12
+
13
+
14
+
15
+
16
+
17
+
@@ -0,0 +1,5 @@
1
+ {
2
+ "semi": false,
3
+ "singleQuote": true,
4
+ "trailingComma": "es5"
5
+ }
package/README.md CHANGED
@@ -1,20 +1,49 @@
1
+ <div align="center">
2
+
1
3
  # @teo-garcia/prettier-config-shared
2
4
 
3
- Shared Prettier configuration used across the fullstack web templates.
5
+ **Shared Prettier configuration for consistent code formatting**
4
6
 
5
- ## Install
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
8
+ [![npm](https://img.shields.io/npm/v/@teo-garcia/prettier-config-shared?color=blue)](https://www.npmjs.com/package/@teo-garcia/prettier-config-shared)
9
+ [![Prettier](https://img.shields.io/badge/Prettier-3-F7B93E?logo=prettier&logoColor=black)](https://prettier.io)
6
10
 
7
- ```sh
8
- # with pnpm
9
- pnpm add -D @teo-garcia/prettier-config-shared prettier
11
+ Part of the [@teo-garcia/templates](https://github.com/teo-garcia/templates) ecosystem
10
12
 
11
- # or with npm
12
- npm add -D @teo-garcia/prettier-config-shared prettier
13
- ```
13
+ </div>
14
+
15
+ ---
16
+
17
+ ## Features
18
+
19
+ | Setting | Value |
20
+ |---------|-------|
21
+ | **Semicolons** | No |
22
+ | **Quotes** | Single |
23
+ | **Tab Width** | 2 spaces |
24
+ | **Trailing Commas** | ES5 |
25
+ | **JSX Quotes** | Single |
26
+ | **Print Width** | 80 |
27
+
28
+ **File-specific rules:**
29
+ - Markdown: Always wrap prose
30
+ - Prisma: Proper `.prisma` file formatting
31
+ - YAML: No single quotes, 2-space indent
32
+ - JSON: No trailing commas
33
+
34
+ ## Requirements
14
35
 
15
- ## Usage
36
+ - Node.js 20+
37
+ - Prettier 3+
16
38
 
17
- ### Option 1: Package.json (Recommended)
39
+ ## Quick Start
40
+
41
+ ```bash
42
+ # Install the package
43
+ pnpm add -D @teo-garcia/prettier-config-shared prettier
44
+ ```
45
+
46
+ ### Package.json (Recommended)
18
47
 
19
48
  ```json
20
49
  {
@@ -22,43 +51,44 @@ npm add -D @teo-garcia/prettier-config-shared prettier
22
51
  }
23
52
  ```
24
53
 
25
- ### Option 2: Configuration file
54
+ ### Configuration File
26
55
 
27
- ```js
56
+ ```javascript
28
57
  // prettier.config.js
29
- import sharedConfig from "@teo-garcia/prettier-config-shared";
58
+ import sharedConfig from '@teo-garcia/prettier-config-shared'
30
59
 
31
- export default sharedConfig;
60
+ export default sharedConfig
32
61
  ```
33
62
 
34
- ### Option 3: Extend and override
63
+ ## Extending
35
64
 
36
- ```js
65
+ Override settings as needed:
66
+
67
+ ```javascript
37
68
  // prettier.config.js
38
- import sharedConfig from "@teo-garcia/prettier-config-shared";
69
+ import sharedConfig from '@teo-garcia/prettier-config-shared'
39
70
 
40
71
  export default {
41
72
  ...sharedConfig,
42
- // Your project-specific overrides
43
73
  printWidth: 100,
44
- };
74
+ semi: true,
75
+ }
45
76
  ```
46
77
 
47
- ## Configuration
78
+ ## Related Packages
48
79
 
49
- This config includes:
80
+ | Package | Description |
81
+ |---------|-------------|
82
+ | [@teo-garcia/eslint-config-shared](https://github.com/teo-garcia/eslint-config-shared) | ESLint rules |
83
+ | [@teo-garcia/tsconfig-shared](https://github.com/teo-garcia/tsconfig-shared) | TypeScript settings |
84
+ | [@teo-garcia/vitest-config-shared](https://github.com/teo-garcia/vitest-config-shared) | Test configuration |
50
85
 
51
- - **Core rules**: Semi-colons disabled, single quotes, 2-space tabs, ES5 trailing commas
52
- - **JSX rules**: Single quotes for JSX attributes
53
- - **Markdown**: Always wrap prose, 80 character width
54
- - **Prisma**: Proper formatting for `.prisma` files
55
- - **YAML**: No single quotes, 2-space indentation
56
- - **JSON**: No trailing commas, 2-space indentation
86
+ ## License
57
87
 
58
- ---
88
+ MIT
59
89
 
60
- ### Notes
90
+ ---
61
91
 
62
- - Compatible with Prettier 3.x
63
- - Designed to work seamlessly with `@teo-garcia/eslint-config-shared`
64
- - All file type overrides are included for consistent formatting across the monorepo
92
+ <div align="center">
93
+ <sub>Built by <a href="https://github.com/teo-garcia">teo-garcia</a></sub>
94
+ </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teo-garcia/prettier-config-shared",
3
- "version": "0.2.1",
3
+ "version": "0.2.8",
4
4
  "description": "Shared Prettier configuration for fullstack web templates",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -18,10 +18,18 @@
18
18
  ],
19
19
  "author": "teo-garcia",
20
20
  "license": "MIT",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/teo-garcia/prettier-config-shared.git"
24
+ },
21
25
  "engines": {
22
26
  "node": ">=20.11"
23
27
  },
24
28
  "peerDependencies": {
25
29
  "prettier": "^3.0.0"
30
+ },
31
+ "scripts": {
32
+ "format": "prettier --write .",
33
+ "format:check": "prettier --check ."
26
34
  }
27
35
  }