@jmlweb/eslint-config-astro 1.0.2 → 1.0.4
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/CHANGELOG.md +16 -0
- package/README.md +57 -4
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @jmlweb/eslint-config-astro
|
|
2
2
|
|
|
3
|
+
## 1.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4a9ece1: Update documentation to use pnpm commands instead of npm
|
|
8
|
+
- Updated dependencies [4a9ece1]
|
|
9
|
+
- @jmlweb/eslint-config-base@2.0.4
|
|
10
|
+
|
|
11
|
+
## 1.0.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 6b73301: Add changelog section with link to CHANGELOG.md in package READMEs
|
|
16
|
+
- Updated dependencies [6b73301]
|
|
17
|
+
- @jmlweb/eslint-config-base@2.0.3
|
|
18
|
+
|
|
3
19
|
## 1.0.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -22,9 +22,11 @@
|
|
|
22
22
|
## 📦 Installation
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
|
|
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
|
+
> 💡 **Upgrading from a previous version?** See the [Migration Guide](#-migration-guide) for breaking changes and upgrade instructions.
|
|
29
|
+
|
|
28
30
|
## 🚀 Quick Start
|
|
29
31
|
|
|
30
32
|
Create an `eslint.config.js` file in your project root:
|
|
@@ -146,9 +148,35 @@ import { Component } from './component';
|
|
|
146
148
|
Fix import order automatically:
|
|
147
149
|
|
|
148
150
|
```bash
|
|
149
|
-
|
|
151
|
+
pnpm exec eslint --fix .
|
|
150
152
|
```
|
|
151
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
|
+
|
|
152
180
|
## 🎯 When to Use
|
|
153
181
|
|
|
154
182
|
Use this configuration when you want:
|
|
@@ -201,8 +229,8 @@ Add linting scripts to your `package.json`:
|
|
|
201
229
|
Then run:
|
|
202
230
|
|
|
203
231
|
```bash
|
|
204
|
-
|
|
205
|
-
|
|
232
|
+
pnpm lint # Lint all files
|
|
233
|
+
pnpm lint:fix # Fix auto-fixable issues
|
|
206
234
|
```
|
|
207
235
|
|
|
208
236
|
## 📋 Requirements
|
|
@@ -227,10 +255,35 @@ This package requires the following peer dependencies:
|
|
|
227
255
|
|
|
228
256
|
## 🔗 Related Packages
|
|
229
257
|
|
|
258
|
+
### Internal Packages
|
|
259
|
+
|
|
230
260
|
- [`@jmlweb/eslint-config-base`](../eslint-config-base) - Base TypeScript ESLint config (extended by this package)
|
|
231
261
|
- [`@jmlweb/tsconfig-astro`](../tsconfig-astro) - TypeScript configuration for Astro projects
|
|
232
262
|
- [`@jmlweb/prettier-config-base`](../prettier-config-base) - Prettier config for consistent formatting
|
|
233
263
|
|
|
264
|
+
### External Tools
|
|
265
|
+
|
|
266
|
+
- [ESLint](https://eslint.org/) - Pluggable linting utility for JavaScript and TypeScript
|
|
267
|
+
- [Astro](https://astro.build/) - The web framework for content-driven websites
|
|
268
|
+
- [eslint-plugin-astro](https://ota-meshi.github.io/eslint-plugin-astro/) - ESLint plugin for Astro components
|
|
269
|
+
- [Prettier Plugin Astro](https://github.com/withastro/prettier-plugin-astro) - Prettier plugin for .astro files
|
|
270
|
+
|
|
271
|
+
## 🔄 Migration Guide
|
|
272
|
+
|
|
273
|
+
### Upgrading to a New Version
|
|
274
|
+
|
|
275
|
+
> **Note:** If no breaking changes were introduced in a version, it's safe to upgrade without additional steps.
|
|
276
|
+
|
|
277
|
+
**No breaking changes have been introduced yet.** This package follows semantic versioning. When breaking changes are introduced, detailed migration instructions will be provided here.
|
|
278
|
+
|
|
279
|
+
For version history, see the [Changelog](./CHANGELOG.md).
|
|
280
|
+
|
|
281
|
+
**Need Help?** If you encounter issues during migration, please [open an issue](https://github.com/jmlweb/tooling/issues/new).
|
|
282
|
+
|
|
283
|
+
## 📜 Changelog
|
|
284
|
+
|
|
285
|
+
See [CHANGELOG.md](./CHANGELOG.md) for version history and release notes.
|
|
286
|
+
|
|
234
287
|
## 📄 License
|
|
235
288
|
|
|
236
289
|
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jmlweb/eslint-config-astro",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
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.
|
|
55
|
+
"@jmlweb/eslint-config-base": "2.0.4"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@jmlweb/eslint-config-base": "2.0.
|
|
58
|
+
"@jmlweb/eslint-config-base": "2.0.4"
|
|
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/
|
|
71
|
-
"@jmlweb/
|
|
70
|
+
"@jmlweb/tsconfig-internal": "0.0.1",
|
|
71
|
+
"@jmlweb/eslint-config-base": "2.0.4"
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|
|
74
74
|
"build": "tsup",
|