Skip to content

chore: adopt shared eslint base config - #320

Merged
harlan-zw merged 4 commits into
mainfrom
chore/adopt-eslint-base
Aug 18, 2026
Merged

chore: adopt shared eslint base config#320
harlan-zw merged 4 commits into
mainfrom
chore/adopt-eslint-base

Conversation

@harlan-zw

@harlan-zw harlan-zw commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

The same three override blocks (shared ignores, node globals, test relaxations, the examples/**/package.json catalog opt-out) were copy-pasted into every one of my repos, and they drifted apart. eslint-plugin-harlanzw 0.19.2 ships them as base(), so this routes them through harlanzw({ base: ... }) and keeps only what is actually specific to this repo inline: the docs/** ignore, e18e/prefer-static-regex off, and the two harlanzw/vue-* composable rules off under server/ and src/.

Config goes 45 lines to 25. I diffed eslint --print-config for a src file, a test file, and a .vue file before and after. Three resolved-severity changes across all three, no others:

  • ts/no-use-before-define error to off. The old config only turned off the core no-use-before-define, so the TS variant stayed on; base() turns off both, which was the intent.
  • harlanzw/prefer-satisfies and harlanzw/nuxt-no-redundant-component-imports appear as warnings. New rules in 0.18.x. Zero findings in this repo.

The linted file set is identical, 129 files, and eslint . -f json produces byte-identical messages before and after.

One thing I did not touch: src/generated-bot-matcher.ts:3 trips regexp/no-useless-non-capturing-group. pnpm lint autofixes it, and the next build regenerates the unfixed version. Pre-existing, but the generator should probably emit the tighter pattern.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

Routes the copy-pasted override blocks through harlanzw({ base }) from
eslint-plugin-harlanzw 0.18.1.
@pkg-pr-new

pkg-pr-new Bot commented Aug 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nuxtjs/robots@320

commit: 0b1d200

@github-actions

Copy link
Copy Markdown

📦 Package Size

No notable size changes

All tracked output (10)
Package output Gzipped Raw
@nuxtjs/robots · dependency @fingerprintjs/botd 13 kB 55 kB
@nuxtjs/robots · dependency h3 34 kB 146 kB
@nuxtjs/robots · dependency nuxt-site-config 9.8 kB 24 kB
@nuxtjs/robots · dependency nuxtseo-shared 20 kB 65 kB
@nuxtjs/robots · export . 5.3 kB 20 kB
@nuxtjs/robots · export ./content 292 B 503 B
@nuxtjs/robots · export ./util 6.6 kB 25 kB
@nuxtjs/robots · published payload 36 kB 121 kB
@nuxtjs/robots · app runtime 2.5 kB 6.2 kB
@nuxtjs/robots · server runtime 8.6 kB 22 kB
Runtime dependencies (10)
Package Dependency Requested Resolved Cost
@nuxtjs/robots @fingerprintjs/botd ^2.0.0 2.0.0 📦 13 kB gzip
@nuxtjs/robots @nuxt/kit ^4.5.2 4.5.2 ♻️ free via Nuxt 4.5.2
@nuxtjs/robots consola ^3.4.2 3.4.2 ♻️ free via Nuxt 4.5.2
@nuxtjs/robots defu ^6.1.7 6.1.7 ♻️ free via Nuxt 4.5.2
@nuxtjs/robots h3 ^1.15.11 1.15.11 📦 34 kB gzip
@nuxtjs/robots nuxt-site-config ^4.2.0 4.2.0 📦 9.8 kB gzip
@nuxtjs/robots nuxtseo-shared ^5.3.11 5.3.11 📦 20 kB gzip
@nuxtjs/robots pathe ^2.0.3 2.0.3 ♻️ free via Nuxt 4.5.2
@nuxtjs/robots pkg-types ^2.3.1 2.3.1 ♻️ free via Nuxt 4.5.2
@nuxtjs/robots ufo ^1.6.4 1.6.4 ♻️ free via Nuxt 4.5.2

Baseline: main_@_ab34ffa___2026-08-12 · gzip is the comparison metric · changes below 16 B gzip are ignored

@harlan-zw
harlan-zw force-pushed the chore/adopt-eslint-base branch from 6f28baf to f3a754f Compare August 18, 2026 04:05
`/(?=(?:A|B))/` and `/(?=A|B)/` are the same regex: a lookahead already scopes
its alternation. The extra group tripped `regexp/no-useless-non-capturing-group`
in a file whose header says do not edit, so `pnpm lint` rewrote it on every run
and the next build put it back.

Fixed in the generator and regenerated. Checked both matchers over all 215 bot
patterns plus negatives: identical results.
@harlan-zw
harlan-zw merged commit 8908c2b into main Aug 18, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant