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

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,33 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ check:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Setup pnpm
17
+ uses: pnpm/action-setup@v4
18
+
19
+ - name: Setup Node.js
20
+ uses: actions/setup-node@v4
21
+ with:
22
+ node-version: '24'
23
+ cache: 'pnpm'
24
+
25
+ - name: Install dependencies
26
+ run: pnpm install --frozen-lockfile
27
+
28
+ - name: Security audit
29
+ run: pnpm audit --audit-level=high
30
+ continue-on-error: true
31
+
32
+ - name: Check
33
+ run: pnpm check
@@ -0,0 +1,43 @@
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@v6
17
+
18
+ - name: Setup pnpm
19
+ uses: pnpm/action-setup@v4
20
+
21
+ - name: Setup Node.js
22
+ uses: actions/setup-node@v6
23
+ with:
24
+ node-version: '24'
25
+ registry-url: 'https://registry.npmjs.org'
26
+
27
+ - name: Setup npm for Trusted Publishing
28
+ run: npm install -g npm@latest && npm --version
29
+
30
+ - name: Install dependencies
31
+ run: pnpm install --no-frozen-lockfile
32
+
33
+ - name: Security audit
34
+ run: pnpm audit --audit-level=high
35
+ continue-on-error: true
36
+
37
+ - name: Publish to npm via OIDC
38
+ run: npm publish --provenance --access public
39
+
40
+ - name: Create GitHub Release
41
+ uses: softprops/action-gh-release@v2
42
+ with:
43
+ 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,50 @@
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
+
30
+ - Markdown: Always wrap prose
31
+ - Prisma: Proper `.prisma` file formatting
32
+ - YAML: No single quotes, 2-space indent
33
+ - JSON: No trailing commas
14
34
 
15
- ## Usage
35
+ ## Requirements
16
36
 
17
- ### Option 1: Package.json (Recommended)
37
+ - Node.js 20+
38
+ - Prettier 3+
39
+
40
+ ## Quick Start
41
+
42
+ ```bash
43
+ # Install the package
44
+ pnpm add -D @teo-garcia/prettier-config-shared prettier
45
+ ```
46
+
47
+ ### Package.json (Recommended)
18
48
 
19
49
  ```json
20
50
  {
@@ -22,43 +52,44 @@ npm add -D @teo-garcia/prettier-config-shared prettier
22
52
  }
23
53
  ```
24
54
 
25
- ### Option 2: Configuration file
55
+ ### Configuration File
26
56
 
27
- ```js
57
+ ```javascript
28
58
  // prettier.config.js
29
- import sharedConfig from "@teo-garcia/prettier-config-shared";
59
+ import sharedConfig from '@teo-garcia/prettier-config-shared'
30
60
 
31
- export default sharedConfig;
61
+ export default sharedConfig
32
62
  ```
33
63
 
34
- ### Option 3: Extend and override
64
+ ## Extending
35
65
 
36
- ```js
66
+ Override settings as needed:
67
+
68
+ ```javascript
37
69
  // prettier.config.js
38
- import sharedConfig from "@teo-garcia/prettier-config-shared";
70
+ import sharedConfig from '@teo-garcia/prettier-config-shared'
39
71
 
40
72
  export default {
41
73
  ...sharedConfig,
42
- // Your project-specific overrides
43
74
  printWidth: 100,
44
- };
75
+ semi: true,
76
+ }
45
77
  ```
46
78
 
47
- ## Configuration
79
+ ## Related Packages
48
80
 
49
- This config includes:
81
+ | Package | Description |
82
+ | -------------------------------------------------------------------------------------- | ------------------- |
83
+ | [@teo-garcia/eslint-config-shared](https://github.com/teo-garcia/eslint-config-shared) | ESLint rules |
84
+ | [@teo-garcia/tsconfig-shared](https://github.com/teo-garcia/tsconfig-shared) | TypeScript settings |
85
+ | [@teo-garcia/vitest-config-shared](https://github.com/teo-garcia/vitest-config-shared) | Test configuration |
50
86
 
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
87
+ ## License
57
88
 
58
- ---
89
+ MIT
59
90
 
60
- ### Notes
91
+ ---
61
92
 
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
93
+ <div align="center">
94
+ <sub>Built by <a href="https://github.com/teo-garcia">teo-garcia</a></sub>
95
+ </div>
package/index.js CHANGED
@@ -3,7 +3,7 @@ const config = {
3
3
  semi: false,
4
4
  singleQuote: true,
5
5
  tabWidth: 2,
6
- trailingComma: "es5",
6
+ trailingComma: 'es5',
7
7
  printWidth: 80,
8
8
  useTabs: false,
9
9
 
@@ -15,27 +15,27 @@ const config = {
15
15
  // Other languages
16
16
  overrides: [
17
17
  {
18
- files: "*.md",
18
+ files: '*.md',
19
19
  options: {
20
- proseWrap: "always",
20
+ proseWrap: 'always',
21
21
  printWidth: 80,
22
22
  },
23
23
  },
24
24
  {
25
- files: "*.{yml,yaml}",
25
+ files: '*.{yml,yaml}',
26
26
  options: {
27
27
  tabWidth: 2,
28
28
  singleQuote: false,
29
29
  },
30
30
  },
31
31
  {
32
- files: "*.json",
32
+ files: '*.json',
33
33
  options: {
34
34
  tabWidth: 2,
35
- trailingComma: "none",
35
+ trailingComma: 'none',
36
36
  },
37
37
  },
38
38
  ],
39
- };
39
+ }
40
40
 
41
- export default config;
41
+ export default config
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.9",
4
4
  "description": "Shared Prettier configuration for fullstack web templates",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -18,10 +18,23 @@
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
+ },
25
+ "packageManager": "pnpm@10.2.0",
21
26
  "engines": {
22
- "node": ">=20.11"
27
+ "node": ">=24"
23
28
  },
24
29
  "peerDependencies": {
25
30
  "prettier": "^3.0.0"
31
+ },
32
+ "scripts": {
33
+ "check": "pnpm format:check",
34
+ "format": "prettier --write .",
35
+ "format:check": "prettier --check ."
36
+ },
37
+ "devDependencies": {
38
+ "prettier": "^3.8.1"
26
39
  }
27
40
  }