eslint-config-efe13 1.1.4 → 1.2.0
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 +10 -0
- package/README.md +2 -1
- package/package.json +4 -4
- package/src/deps.js +6 -9
- package/src/generate-config.js +24 -31
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Todas las notas de cambios para `eslint-config-efe13`.
|
|
4
4
|
|
|
5
|
+
## [1.2.0] - 2026-09-10
|
|
6
|
+
|
|
7
|
+
- fix(backend-ts): Reemplaza `eslint-config-semistandard` por `neostandard`. Semistandard es config eslintrc legacy: su peer `eslint ^8` rompía la instalación con npm (`ERESOLVE` contra ESLint 9) y sus `.rules` solo contenían `semi`/`no-extra-semi`, con lo que el ruleset Standard nunca se aplicaba en flat config.
|
|
8
|
+
- fix(backend-ts): Usa `parserOptions.projectService` con `allowDefaultProject` en lugar de `project`, para que archivos TS fuera del `include` del tsconfig (`drizzle.config.ts`, `vitest.config.ts`, etc.) no rompan el lint.
|
|
9
|
+
- fix(backend-ts): `tsconfigRootDir` anclado al propio `eslint.config.mjs` (`import.meta`) en lugar de `process.cwd()`.
|
|
10
|
+
- feat(backend-ts): Se lintan también archivos `.mts`, `.cts` y `.tsx`.
|
|
11
|
+
- chore(backend-ts): Desactiva `n/process-exit-as-throw` (queda cubierto por `n/no-process-exit: warn`; `process.exit()` es válido en scripts/CLIs).
|
|
12
|
+
- chore(backend-ts): Reduce las dependencias instaladas — `eslint-plugin-n`, `eslint-plugin-promise`, `globals` y `typescript-eslint` vienen incluidos en `neostandard`.
|
|
13
|
+
- fix: Instala `eslint@^9` en todos los presets — `neostandard`, `eslint-plugin-import`, `eslint-plugin-react` y `eslint-plugin-jsx-a11y` aún no declaran soporte para ESLint 10 (evita resoluciones rotas en pnpm/bun/yarn).
|
|
14
|
+
|
|
5
15
|
## [1.1.4] - 2026-09-09
|
|
6
16
|
|
|
7
17
|
- chore: Renombra el paquete a `eslint-config-efe13`.
|
package/README.md
CHANGED
|
@@ -28,7 +28,8 @@ Si tu proyecto fue creado con Vite, elimina el archivo `eslint.config.js` que Vi
|
|
|
28
28
|
|
|
29
29
|
### Nota para proyectos backend-ts
|
|
30
30
|
|
|
31
|
-
-
|
|
31
|
+
- El preset usa [neostandard](https://github.com/neostandard/neostandard) (`ts: true`), el sucesor de `standard`/`semistandard` compatible con flat config y ESLint 9.
|
|
32
|
+
- Asegúrate de tener un `tsconfig.json` en la raíz del proyecto; el preset usa lint con información de tipos (`projectService`). Los archivos `.ts` sueltos de la raíz (`drizzle.config.ts`, `vitest.config.ts`, etc.) se lintan con el proyecto por defecto.
|
|
32
33
|
- El preset apunta a entornos Node.js y también habilita APIs de `serviceworker` (para soportar `fetch`, `Request`, `Response` en runtimes tipo Bun/Workers si fuese necesario).
|
|
33
34
|
|
|
34
35
|
## Requisitos
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-efe13",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"eslint-config-efe13": "bin/index.js"
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"description": "Configuración de ESLint + Prettier inspirada en Goncy con un CLI para proyectos Next.js, Vite y backend-ts (Node/TypeScript).",
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|
|
35
|
-
"url": "git+https://github.com/efe13dev/eslint-config-
|
|
35
|
+
"url": "git+https://github.com/efe13dev/eslint-config-efe13.git"
|
|
36
36
|
},
|
|
37
37
|
"bugs": {
|
|
38
|
-
"url": "https://github.com/efe13dev/eslint-config-
|
|
38
|
+
"url": "https://github.com/efe13dev/eslint-config-efe13/issues"
|
|
39
39
|
},
|
|
40
|
-
"homepage": "https://github.com/efe13dev/eslint-config-
|
|
40
|
+
"homepage": "https://github.com/efe13dev/eslint-config-efe13#readme",
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"chalk": "^5.6.2",
|
|
43
43
|
"inquirer": "^9.3.8",
|
package/src/deps.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
// eslint@^9: neostandard, eslint-plugin-import, eslint-plugin-react y
|
|
2
|
+
// eslint-plugin-jsx-a11y aún no soportan ESLint 10 — quitar el pin cuando lo hagan.
|
|
1
3
|
export const depsByFramework = {
|
|
2
4
|
nextjs: [
|
|
3
|
-
"eslint",
|
|
5
|
+
"eslint@^9",
|
|
4
6
|
"@eslint/compat",
|
|
5
7
|
"@next/eslint-plugin-next",
|
|
6
8
|
"eslint-config-next",
|
|
@@ -18,7 +20,7 @@ export const depsByFramework = {
|
|
|
18
20
|
"globals",
|
|
19
21
|
],
|
|
20
22
|
vite: [
|
|
21
|
-
"eslint",
|
|
23
|
+
"eslint@^9",
|
|
22
24
|
"@eslint/compat",
|
|
23
25
|
"eslint-config-prettier",
|
|
24
26
|
"eslint-plugin-import",
|
|
@@ -33,17 +35,12 @@ export const depsByFramework = {
|
|
|
33
35
|
"globals",
|
|
34
36
|
],
|
|
35
37
|
"backend-ts": [
|
|
36
|
-
"eslint",
|
|
38
|
+
"eslint@^9",
|
|
37
39
|
"@eslint/compat",
|
|
38
|
-
"@typescript-eslint/eslint-plugin",
|
|
39
|
-
"@typescript-eslint/parser",
|
|
40
40
|
"eslint-config-prettier",
|
|
41
|
-
"eslint-config-semistandard",
|
|
42
41
|
"eslint-plugin-import",
|
|
43
|
-
"eslint-plugin-n",
|
|
44
42
|
"eslint-plugin-prettier",
|
|
45
|
-
"
|
|
46
|
-
"globals",
|
|
43
|
+
"neostandard",
|
|
47
44
|
"prettier",
|
|
48
45
|
"typescript",
|
|
49
46
|
],
|
package/src/generate-config.js
CHANGED
|
@@ -240,46 +240,42 @@ export default [
|
|
|
240
240
|
|
|
241
241
|
function generateBackendTsConfig() {
|
|
242
242
|
return `import { fixupPluginRules } from "@eslint/compat";
|
|
243
|
-
import
|
|
244
|
-
import tsparser from "@typescript-eslint/parser";
|
|
245
|
-
import eslintConfigPrettier from "eslint-config-prettier";
|
|
246
|
-
import semistandard from "eslint-config-semistandard";
|
|
243
|
+
import { fileURLToPath } from "node:url";
|
|
247
244
|
import importPlugin from "eslint-plugin-import";
|
|
248
|
-
import
|
|
245
|
+
import neostandard from "neostandard";
|
|
249
246
|
import prettierRecommended from "eslint-plugin-prettier/recommended";
|
|
250
|
-
import promisePlugin from "eslint-plugin-promise";
|
|
251
|
-
import globals from "globals";
|
|
252
247
|
|
|
253
248
|
export default [
|
|
254
249
|
{
|
|
255
250
|
ignores: ["node_modules", "dist", "coverage", ".idea"],
|
|
256
251
|
},
|
|
252
|
+
|
|
253
|
+
// Base: Standard + TypeScript (neostandard, sucesor flat-config de standard/semistandard)
|
|
254
|
+
// El formato (punto y coma incluido) lo maneja Prettier
|
|
255
|
+
...neostandard({
|
|
256
|
+
ts: true,
|
|
257
|
+
noStyle: true,
|
|
258
|
+
env: ["node", "serviceworker"], // serviceworker: fetch, Request, Response
|
|
259
|
+
filesTs: ["**/*.mts", "**/*.cts"],
|
|
260
|
+
}),
|
|
261
|
+
|
|
262
|
+
// TypeScript: lint con información de tipos + reglas del proyecto
|
|
257
263
|
{
|
|
258
|
-
files: ["**/*.ts"],
|
|
264
|
+
files: ["**/*.{ts,tsx,mts,cts}"],
|
|
259
265
|
languageOptions: {
|
|
260
|
-
parser: tsparser,
|
|
261
266
|
parserOptions: {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
globals: {
|
|
269
|
-
...globals.node,
|
|
270
|
-
...globals.es2021,
|
|
271
|
-
...globals.serviceworker, // fetch, Request, Response
|
|
267
|
+
// Resuelve el tsconfig más cercano a cada archivo
|
|
268
|
+
projectService: {
|
|
269
|
+
// Archivos sueltos de la raíz: drizzle.config.ts, vitest.config.ts, ...
|
|
270
|
+
allowDefaultProject: ["*.ts", "*.tsx", "*.mts", "*.cts"],
|
|
271
|
+
},
|
|
272
|
+
tsconfigRootDir: fileURLToPath(new URL(".", import.meta.url)),
|
|
272
273
|
},
|
|
273
274
|
},
|
|
274
275
|
plugins: {
|
|
275
|
-
"@typescript-eslint": tseslint,
|
|
276
276
|
import: fixupPluginRules(importPlugin),
|
|
277
|
-
n: nPlugin,
|
|
278
|
-
promise: promisePlugin,
|
|
279
277
|
},
|
|
280
278
|
rules: {
|
|
281
|
-
...semistandard.rules,
|
|
282
|
-
|
|
283
279
|
// Adaptaciones para TS
|
|
284
280
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
285
281
|
"@typescript-eslint/no-empty-function": "off",
|
|
@@ -346,22 +342,21 @@ export default [
|
|
|
346
342
|
"error",
|
|
347
343
|
{
|
|
348
344
|
devDependencies: [
|
|
349
|
-
"**/*.test.ts",
|
|
350
|
-
"**/*.spec.ts",
|
|
351
|
-
"
|
|
345
|
+
"**/*.test.{ts,mts,cts}",
|
|
346
|
+
"**/*.spec.{ts,mts,cts}",
|
|
347
|
+
"**/*.config.{ts,mts,cts}",
|
|
352
348
|
"eslint.config.mjs",
|
|
353
|
-
"bunfig.toml",
|
|
354
349
|
],
|
|
355
350
|
},
|
|
356
351
|
],
|
|
357
352
|
|
|
358
353
|
// Promesas
|
|
359
354
|
"promise/no-return-wrap": "error",
|
|
360
|
-
"promise/param-names": "error",
|
|
361
355
|
|
|
362
356
|
// Node
|
|
363
357
|
"n/no-missing-import": "off", // TS resuelve imports
|
|
364
358
|
"n/no-process-exit": "warn",
|
|
359
|
+
"n/process-exit-as-throw": "off", // cubierto por no-process-exit; process.exit() es válido en scripts
|
|
365
360
|
"n/shebang": "off",
|
|
366
361
|
"n/no-unsupported-features/es-syntax": "off",
|
|
367
362
|
},
|
|
@@ -387,8 +382,6 @@ export default [
|
|
|
387
382
|
],
|
|
388
383
|
},
|
|
389
384
|
},
|
|
390
|
-
// Desactivar reglas en conflicto con Prettier
|
|
391
|
-
eslintConfigPrettier,
|
|
392
385
|
];
|
|
393
386
|
`;
|
|
394
387
|
}
|