Repository navigation
Conversation
馃 Changeset detectedLatest commit: 69bf9d7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
benjie
left a comment
There was a problem hiding this comment.
If this drops support for earlier ESLint, we should change the peer dependency range, and change this to semver major. TBH I doubt we support back that far in ESLint history anyway...
Seems this could be done in a backwards compatible way though: const getFilename = (context: {filename?: string, getFilename?(): string}) => context.filename ?? context.getFilename?.() for example?
|
Done in ea94be7: added Re-verified: |
Description
eslint-plugin-graphile-exportcallscontext.getFilename()(inexport-subclasses) andcontext.getPhysicalFilename()(in theGRAPHILE_ENV=developmentdebug output ofexport-methods). ESLint deprecatedboth in v8.40.0 in favour of the
context.filenameandcontext.physicalFilenameproperties, andremoved them in v10.0.0
(v8.40.0 release notes).
This is one of the things the plugin needs before it can support ESLint 10.
This PR adds
getFilename(context)andgetPhysicalFilename(context)helpersto
utils/eslint-plugin-graphile-export/src/utils.ts. They read the propertieswhen present and fall back to the old methods otherwise, so older ESLint
versions keep working. The three call sites use them:
utils/eslint-plugin-graphile-export/src/ExportSubclasses.ts(2 sites)utils/eslint-plugin-graphile-export/src/ExportMethods.ts(1 site)The peer range is unchanged. A patch changeset is included.
Performance impact
None.
Security impact
None.
Verification
Run in a
node:22-bookwormcontainer afteryarn --immutableandyarn build. Each check was run onmainfirst, then again with this change.Both runs gave the same results:
yarn tsc -binutils/eslint-plugin-graphile-export: passes.eslint --ext .js,.jsx,.ts,.tsx utils grafast/grafast(the repo config,which enables the plugin's recommended rules): exit 0, no reports. The
full
yarn eslint .needs more memory than the container had.Linteronclass MyStep extends Step {}and{ plan() {}, notAllowed: 1 }in/work/src/MyStep.ts. The "convert to importable" suggestion contains"./MyStep.ts", and the development debug message contains/work/src/MyStep.ts:3:13.yarn prettier --checkon the changed files: passes.After the change to the helpers (ea94be7), re-run in the same container:
yarn tsc -binutils/eslint-plugin-graphile-export: passes.yarn eslint --ext .js,.jsx,.ts,.tsx utils/eslint-plugin-graphile-export:exit 0. The wider
utils grafast/grafastrun now exits 129 with no output onboth
mainand this branch, so it is not counted here.filenameandphysicalFilenameare
undefinedand onlygetFilename()/getPhysicalFilename()exist (ason ESLint < 8.40): same results, with the fallback methods called for all
three sites.
yarn prettier --checkon the changed files: passes.Checklist
yarn lint:fixpasses. (ESLint and Prettier were run on the scope above, not the fulllint:fix.)yarn testpasses. (The plugin has no test suite. It was checked with the script above.)RELEASE_NOTES.mdfile (if one exists). (A changeset is included instead.)Found with unstale, a tool I'm building so nobody has to read every changelog to catch changes like this one. Prepared with AI assistance (Claude Code) and verified as described above.