Make npm run lint work in stay-scout-hub - #249
Open
Hotragn wants to merge 1 commit into
Open
Conversation
The lint script is `eslint .` with eslint@^9 and no eslint.config.*, so it exits 2 without linting anything -- ESLint 9 only reads flat config. This recipe has had no working lint at all. eslint-config-next@15.x still ships core-web-vitals.js and typescript.js as legacy eslintrc objects with no exports subpaths, so the flat style the Next 16 recipes use cannot be copied here. Bridged with FlatCompat from @eslint/eslintrc instead, which is what create-next-app generated for Next 15, extending the same next/core-web-vitals + next/typescript pair. Added @eslint/eslintrc as an explicit devDependency rather than relying on it being hoisted out of eslint's own tree. Turning lint on surfaced 8 errors that were never being checked, all fixed here so lint lands green rather than merely running: - dropped the unused `purpose` parameter from generateFallbackAreas and its four call sites - escaped quotes in AreaCard and an apostrophe in SearchFormV2 - replaced the empty InputProps/TextareaProps interfaces with type aliases of the attribute types they extended - imported tailwindcss-animate instead of require()ing it npm run lint and tsc --noEmit both exit 0. First of the recipes in tinyfish-io#248; the other five follow the same shape once the approach looks right.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Aug 4, 2026
This was referenced Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of the recipes in #248. Independent of #246, which touches different files in this recipe.
The bug
The script is
eslint .witheslint@^9and noeslint.config.*anywhere in the recipe. ESLint 9 only reads flat config, so it exits before linting a single file. This recipe has never had working lint.Why
FlatCompatand not the style the other recipes useThe 10 recipes that already have
eslint.config.mjsare all on Next 16 and import the flat subpaths:That can't be copied here.
eslint-config-next@15.3.3ships those files as legacy eslintrc objects —— and declares no
exportssubpaths at all, only"main". Spreading that into a flat config array doesn't work.So this uses
FlatCompatfrom@eslint/eslintrc, which is exactly whatcreate-next-appgenerated for Next 15, extending the samenext/core-web-vitals+next/typescriptpair the Next 16 recipes get.@eslint/eslintrcis added as an explicitdevDependencyrather than relying on it being hoisted out ofeslint's own dependency tree.The alternative is upgrading this recipe to Next 16 and using the subpath style. That's a much bigger diff with real behaviour risk, so I raised it as a question on #248 rather than assuming.
The 8 errors turning lint on surfaced
A config-only change would have left
npm run lintred, which is worse than failing loudly. All fixed here:api/discover-areas/route.tsno-unused-varspurposeparam fromgenerateFallbackAreas+ its 4 call sitesAreaCard.tsx×2react/no-unescaped-entities"→"SearchFormV2.tsxreact/no-unescaped-entities'→'ui/input.tsxno-empty-object-typeinterface InputProps extends X {}→type InputProps = Xui/textarea.tsxno-empty-object-typehooks/useAreaSearch.tsno-unused-varsAreaSuggestionimporttailwind.config.tsno-require-importsrequire("tailwindcss-animate")→import(already a declared dependency)All behaviour-preserving.
purposeis still read elsewhere in that route forgetPurposeDescription; it was only ever unused insidegenerateFallbackAreas.Verification
The
package-lock.jsonchange is just@eslint/eslintrcmoving to a direct devDependency (it was already present transitively at 3.3.5) plus a transitivejs-yamlbump.Remaining five
restaurant-comparison-tool,tutor-finder,scholarship-finder,summer-school-finder,tenders-finder— same shape, three different root causes, all measured in #248. Sending this one first so the approach can be checked before I repeat it five times.