@jmlweb/eslint-config-base 2.0.2 → 2.0.3
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 +8 -0
- package/README.md +139 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @jmlweb/eslint-config-base
|
|
2
2
|
|
|
3
|
+
## 2.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6b73301: Add changelog section with link to CHANGELOG.md in package READMEs
|
|
8
|
+
- Updated dependencies [6b73301]
|
|
9
|
+
- @jmlweb/eslint-config-base-js@1.0.3
|
|
10
|
+
|
|
3
11
|
## 2.0.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
npm install --save-dev @jmlweb/eslint-config-base eslint @eslint/js typescript-eslint eslint-config-prettier eslint-plugin-simple-import-sort @jmlweb/eslint-config-base-js
|
|
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:
|
|
@@ -302,11 +304,148 @@ See real-world usage examples:
|
|
|
302
304
|
|
|
303
305
|
## 🔗 Related Packages
|
|
304
306
|
|
|
307
|
+
### Internal Packages
|
|
308
|
+
|
|
305
309
|
- [`@jmlweb/eslint-config-base-js`](../eslint-config-base-js) - JavaScript ESLint config (extended by this package)
|
|
306
310
|
- [`@jmlweb/eslint-config-react`](../eslint-config-react) - ESLint config for React projects
|
|
307
311
|
- [`@jmlweb/prettier-config-base`](../prettier-config-base) - Prettier config for consistent formatting
|
|
308
312
|
- [`@jmlweb/tsconfig-base`](../tsconfig-base) - TypeScript configuration
|
|
309
313
|
|
|
314
|
+
### External Tools
|
|
315
|
+
|
|
316
|
+
- [ESLint](https://eslint.org/) - Pluggable linting utility for JavaScript and TypeScript
|
|
317
|
+
- [TypeScript ESLint](https://typescript-eslint.io/) - TypeScript tooling for ESLint
|
|
318
|
+
- [Prettier](https://prettier.io/) - Opinionated code formatter (pairs with eslint-config-prettier)
|
|
319
|
+
- [eslint-plugin-simple-import-sort](https://github.com/lydell/eslint-plugin-simple-import-sort) - Auto-sorts imports
|
|
320
|
+
|
|
321
|
+
## ⚠️ Common Issues
|
|
322
|
+
|
|
323
|
+
> **Note:** This section documents known issues and their solutions. If you encounter a problem not listed here, please [open an issue](https://github.com/jmlweb/tooling/issues/new).
|
|
324
|
+
|
|
325
|
+
### Peer Dependency Warnings
|
|
326
|
+
|
|
327
|
+
**Symptoms:**
|
|
328
|
+
|
|
329
|
+
- `npm WARN` messages about unmet peer dependencies during installation
|
|
330
|
+
- Messages like "requires a peer of eslint@^8.0.0 but none is installed"
|
|
331
|
+
|
|
332
|
+
**Cause:**
|
|
333
|
+
|
|
334
|
+
- Some ESLint plugins haven't updated their peer dependencies to support ESLint 9.x
|
|
335
|
+
- This is a transitional issue as the ecosystem adapts to ESLint's flat config
|
|
336
|
+
|
|
337
|
+
**Solution:**
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
# Use --legacy-peer-deps flag during installation
|
|
341
|
+
npm install --legacy-peer-deps
|
|
342
|
+
|
|
343
|
+
# Or with pnpm (automatically handles peer dependencies)
|
|
344
|
+
pnpm install
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
The warnings are usually safe to ignore if your linting works correctly. The plugins typically work fine with ESLint 9.x despite the warnings.
|
|
348
|
+
|
|
349
|
+
### ESLint Not Picking Up Configuration
|
|
350
|
+
|
|
351
|
+
**Symptoms:**
|
|
352
|
+
|
|
353
|
+
- ESLint rules not being applied
|
|
354
|
+
- IDE showing no linting errors
|
|
355
|
+
- Files outside `src/` directory not being linted
|
|
356
|
+
|
|
357
|
+
**Cause:**
|
|
358
|
+
|
|
359
|
+
- Missing TypeScript project service configuration
|
|
360
|
+
- `tsconfig.json` not in the correct location
|
|
361
|
+
- IDE ESLint extension not configured for flat config
|
|
362
|
+
|
|
363
|
+
**Solution:**
|
|
364
|
+
|
|
365
|
+
1. Ensure your `tsconfig.json` is in your project root
|
|
366
|
+
2. Verify your `eslint.config.js` is using flat config format
|
|
367
|
+
3. For VS Code, update `.vscode/settings.json`:
|
|
368
|
+
|
|
369
|
+
```json
|
|
370
|
+
{
|
|
371
|
+
"eslint.experimental.useFlatConfig": true
|
|
372
|
+
}
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
4. Restart your IDE/ESLint server
|
|
376
|
+
|
|
377
|
+
### Type-Aware Linting Not Working
|
|
378
|
+
|
|
379
|
+
**Symptoms:**
|
|
380
|
+
|
|
381
|
+
- Type-aware rules like `@typescript-eslint/no-unnecessary-condition` not triggering
|
|
382
|
+
- "Parsing error: Cannot read file" messages
|
|
383
|
+
|
|
384
|
+
**Cause:**
|
|
385
|
+
|
|
386
|
+
- TypeScript project service not finding your `tsconfig.json`
|
|
387
|
+
- Multiple `tsconfig.json` files causing confusion
|
|
388
|
+
|
|
389
|
+
**Solution:**
|
|
390
|
+
|
|
391
|
+
Check your project structure:
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
# Your tsconfig.json should be in the root
|
|
395
|
+
project/
|
|
396
|
+
├── tsconfig.json
|
|
397
|
+
├── eslint.config.js
|
|
398
|
+
└── src/
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
If you have multiple tsconfig files, this config uses TypeScript project service which automatically detects them.
|
|
402
|
+
|
|
403
|
+
### Conflicts with Prettier
|
|
404
|
+
|
|
405
|
+
**Symptoms:**
|
|
406
|
+
|
|
407
|
+
- ESLint auto-fix and Prettier format fighting each other
|
|
408
|
+
- Code gets reformatted back and forth
|
|
409
|
+
|
|
410
|
+
**Cause:**
|
|
411
|
+
|
|
412
|
+
- ESLint formatting rules conflicting with Prettier
|
|
413
|
+
- Running both tools without proper integration
|
|
414
|
+
|
|
415
|
+
**Solution:**
|
|
416
|
+
|
|
417
|
+
This config already includes `eslint-config-prettier` to disable conflicting rules. Ensure you:
|
|
418
|
+
|
|
419
|
+
1. Run Prettier before ESLint:
|
|
420
|
+
|
|
421
|
+
```json
|
|
422
|
+
{
|
|
423
|
+
"scripts": {
|
|
424
|
+
"format": "prettier --write .",
|
|
425
|
+
"lint": "eslint .",
|
|
426
|
+
"check": "prettier --check . && eslint ."
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
2. Configure your IDE to format with Prettier first, then lint with ESLint
|
|
432
|
+
|
|
433
|
+
## 🔄 Migration Guide
|
|
434
|
+
|
|
435
|
+
### Upgrading to a New Version
|
|
436
|
+
|
|
437
|
+
> **Note:** If no breaking changes were introduced in a version, it's safe to upgrade without additional steps.
|
|
438
|
+
|
|
439
|
+
**No breaking changes have been introduced yet.** This package follows semantic versioning. When breaking changes are introduced, detailed migration instructions will be provided here.
|
|
440
|
+
|
|
441
|
+
For version history, see the [Changelog](./CHANGELOG.md).
|
|
442
|
+
|
|
443
|
+
**Need Help?** If you encounter issues during migration, please [open an issue](https://github.com/jmlweb/tooling/issues/new).
|
|
444
|
+
|
|
445
|
+
## 📜 Changelog
|
|
446
|
+
|
|
447
|
+
See [CHANGELOG.md](./CHANGELOG.md) for version history and release notes.
|
|
448
|
+
|
|
310
449
|
## 📄 License
|
|
311
450
|
|
|
312
451
|
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jmlweb/eslint-config-base",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Base ESLint configuration for TypeScript projects with strict type checking and best practices",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"typescript-eslint": "^8.0.0"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@jmlweb/eslint-config-base-js": "1.0.
|
|
56
|
+
"@jmlweb/eslint-config-base-js": "1.0.3"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@eslint/js": "^9.39.2",
|