@jmlweb/eslint-config-astro 1.0.3 → 1.0.5

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/CHANGELOG.md +16 -0
  2. package/README.md +30 -4
  3. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @jmlweb/eslint-config-astro
2
2
 
3
+ ## 1.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 30f8ffb: Add "Why Use This?" sections to package READMEs explaining configuration philosophy and design decisions
8
+ - Updated dependencies [30f8ffb]
9
+ - @jmlweb/eslint-config-base@2.0.5
10
+
11
+ ## 1.0.4
12
+
13
+ ### Patch Changes
14
+
15
+ - 4a9ece1: Update documentation to use pnpm commands instead of npm
16
+ - Updated dependencies [4a9ece1]
17
+ - @jmlweb/eslint-config-base@2.0.4
18
+
3
19
  ## 1.0.3
4
20
 
5
21
  ### Patch Changes
package/README.md CHANGED
@@ -22,7 +22,7 @@
22
22
  ## 📦 Installation
23
23
 
24
24
  ```bash
25
- npm install --save-dev @jmlweb/eslint-config-astro eslint @eslint/js typescript-eslint eslint-config-prettier eslint-plugin-astro eslint-plugin-simple-import-sort @jmlweb/eslint-config-base
25
+ pnpm add -D @jmlweb/eslint-config-astro eslint @eslint/js typescript-eslint eslint-config-prettier eslint-plugin-astro eslint-plugin-simple-import-sort @jmlweb/eslint-config-base
26
26
  ```
27
27
 
28
28
  > 💡 **Upgrading from a previous version?** See the [Migration Guide](#-migration-guide) for breaking changes and upgrade instructions.
@@ -148,9 +148,35 @@ import { Component } from './component';
148
148
  Fix import order automatically:
149
149
 
150
150
  ```bash
151
- npx eslint --fix .
151
+ pnpm exec eslint --fix .
152
152
  ```
153
153
 
154
+ ## 🤔 Why Use This?
155
+
156
+ > **Philosophy**: Astro components should follow Astro's mental model - islands of interactivity with server-first rendering.
157
+
158
+ This package extends the base TypeScript config with Astro-specific rules that enforce best practices for `.astro` files, prevent common pitfalls with Astro's unique component model, and ensure proper usage of Astro directives.
159
+
160
+ ### Design Decisions
161
+
162
+ **Astro Plugin (`eslint-plugin-astro`)**: Enforces Astro-specific rules and patterns
163
+
164
+ - **Why**: Astro has a unique component format that blends frontmatter, markup, and optional client-side interactivity. The plugin catches misuse of directives, style conflicts, and component structure issues
165
+ - **Trade-off**: Additional rules specific to Astro, but prevents framework-specific bugs
166
+ - **When to override**: When you have a legitimate reason to deviate from Astro conventions (rare)
167
+
168
+ **Astro File Support**: Properly lints `.astro` files with awareness of their structure
169
+
170
+ - **Why**: `.astro` files have three sections (frontmatter, template, style) that need different parsing. Standard linters don't understand this format
171
+ - **Trade-off**: None - this is essential for Astro development
172
+ - **When to override**: Never - Astro files require Astro-aware linting
173
+
174
+ **Extends Base TypeScript Config**: Inherits all strict type checking rules for TypeScript in frontmatter
175
+
176
+ - **Why**: Astro components often contain complex TypeScript logic in frontmatter. Strict typing catches bugs early
177
+ - **Trade-off**: More verbose frontmatter code, but prevents runtime errors
178
+ - **When to override**: Follow the same guidelines as the base TypeScript config
179
+
154
180
  ## 🎯 When to Use
155
181
 
156
182
  Use this configuration when you want:
@@ -203,8 +229,8 @@ Add linting scripts to your `package.json`:
203
229
  Then run:
204
230
 
205
231
  ```bash
206
- npm run lint # Lint all files
207
- npm run lint:fix # Fix auto-fixable issues
232
+ pnpm lint # Lint all files
233
+ pnpm lint:fix # Fix auto-fixable issues
208
234
  ```
209
235
 
210
236
  ## 📋 Requirements
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jmlweb/eslint-config-astro",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "ESLint configuration for Astro projects with TypeScript. Extends @jmlweb/eslint-config-base with Astro-specific rules.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -52,10 +52,10 @@
52
52
  "eslint-plugin-astro": "^1.5.0",
53
53
  "eslint-plugin-simple-import-sort": "^12.0.0",
54
54
  "typescript-eslint": "^8.0.0",
55
- "@jmlweb/eslint-config-base": "2.0.3"
55
+ "@jmlweb/eslint-config-base": "2.0.5"
56
56
  },
57
57
  "dependencies": {
58
- "@jmlweb/eslint-config-base": "2.0.3"
58
+ "@jmlweb/eslint-config-base": "2.0.5"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@eslint/js": "^9.39.2",
@@ -67,8 +67,8 @@
67
67
  "tsup": "^8.5.1",
68
68
  "typescript": "^5.9.3",
69
69
  "typescript-eslint": "^8.34.1",
70
- "@jmlweb/eslint-config-base": "2.0.3",
71
- "@jmlweb/tsconfig-internal": "0.0.1"
70
+ "@jmlweb/tsconfig-internal": "0.0.1",
71
+ "@jmlweb/eslint-config-base": "2.0.5"
72
72
  },
73
73
  "scripts": {
74
74
  "build": "tsup",