Repository navigation
Conversation
Adds @pnpm/eslint-config with eslint-plugin-regexp's recommended rules, the same setup as pnpm/pnpm and get-pnpm, and a `pnpm run lint` script and a lint job in pr-check. The shared config only covers TypeScript, so its rules are applied to the JavaScript tests as well, without the ones that need type information. typescript-eslint needs TypeScript's compiler API, which TypeScript 7.0 does not ship. Following the TypeScript 7.0 release notes, `typescript` is now the 6.0 compatibility package and `@typescript/native` provides 7.0's `tsc`, which the type check still runs. The violations are fixed: relative imports carry their extension, modules use named exports, exported functions declare return types, and the rest is formatting. Six files that exceed the size and shape limits are listed in PENDING_SIZE_AND_SHAPE_REFACTOR, as pnpm/pnpm does, until they are refactored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 29 minutes. View limit details
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 |
PR Summary by QodoEnforce pnpm ESLint rules across source and tests
AI Description
Diagram
High-Level Assessment
Files changed (43)
|
Instead of exempting them from the lint rules: - packageManagerManifest: finding the workspace root, checking membership against its `packages` patterns, and picking the root manifest are functions of their own. - readEnvDocument: reading is a lazy generator of decoded chunks, and scanning for the separator is separate from it. - runSelfInstaller: choosing the version spec is its own step. - resolveRuntimeRequests: an explicit `runtime` resolves in its own function. - readNodeVersionFile: reading one candidate and finding the workspace are separate; normalizeNodeVersion hands `lts/` selectors to a helper. - runPnpmInstall: building the arguments, checking for a required lockfile, and reporting the result are separate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Sets up the same ESLint rules as pnpm/pnpm and get-pnpm (pnpm/get.pnpm.io).
Config
eslint.config.mjsuses@pnpm/eslint-configpluseslint-plugin-regexp'sflat/recommended, like both repos.tsconfig.lint.jsonis the project the type-aware rules read.**/*.ts, and this repo's tests are.mjs. Its.tsblocks are reused for**/*.mjswithtseslint.configs.disableTypeChecked, so the tests get the same style, import and naming rules, minus the ones that need type information (including pnpm'sconditions/no-object-methods-on-map). Dev dependencies are allowed in*.test.mjsand the config file, and the config file may export its default.pnpm run lintlintssrc/**/*.ts,src/**/*.mjsand the config itself. A newlintjob inpr-check.yamlruns it.TypeScript 7
typescript-eslint needs TypeScript's compiler API, which TypeScript 7.0 does not ship (it refuses to run: "typescript-eslint does not support TS 7.0"). Following the TypeScript 7.0 release notes:
typescriptis aliased to@typescript/typescript6, the 6.0 compatibility package that tools importingtypescriptresolve;@typescript/nativeis aliased totypescript@^7.0.2, sotsc(used byupdate-dependencies.yaml) is still 7.0.2.pnpm/pnpm does the equivalent with
typescript@6.0.3plus@typescript/native-preview.Fixes
./download.js,../inputs/index.js), perimport-x/extensions. The test stubs that match import specifiers follow.node:prefix.catchkeeps itscause.node:testcontext parametertis renamed totestContext, and single-letter loop variables are renamed.awaits in loops and theprocess.exit()influshAndExitcarry disable directives with a reason, which the shared config requires.packageManagerManifest: workspace root lookup, membership check and root manifest selection;readEnvDocument: a lazy chunk generator and a separator scan;runSelfInstaller: version spec selection;resolveRuntimeRequests: an explicitruntime;readNodeVersionFile: reading one candidate, andlts/selectors innormalizeNodeVersion;runPnpmInstall: arguments, the required-lockfile check, and result reporting.--fix: a space before function parentheses, no trailing comma in parameter lists, import order and quotes.The bundle is rebuilt. Lint,
tsc --noEmit(7.0.2) and all 138 tests pass.This conflicts with #90 in
src/install-runtime/. Whichever lands second needs a rebase and apnpm run lint --fix.🤖 Generated with Claude Code