fix(eslint-plugin): 发布白名单后续 — 测试/pack:verify/DRY 收敛 - #60
Merged
Tanya7z merged 4 commits intoJul 24, 2026
Conversation
exclude *.test.ts 后 npm test 不再 emit dist/**/*.test.js; 新增 tsconfig.test.json,并从发布 build 排除仅测试用的 rule-tester。 RuleTester 改用 node:test 的 describe/it/after,避免嵌套用例被取消。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
注册 eslint-plugin 后根脚本仍手抄 npm pack 列表会漏包; 改为 tools/pack-verify.mjs 遍历权威清单,并补齐发布文档表格。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
抽取 visitModuleSourceLiterals;SDK 公开子路径优先读 package.json#exports; plugin.meta.version 从本包 package.json 读取,避免双份版本。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
Tanya7z
marked this pull request as ready for review
July 24, 2026 11:11
Contributor
Author
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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.
背景
main@a6ae7d1将@sfmc-bds/eslint-plugin登记进NPM_PUBLISH_PACKAGES,并在tsconfig排除*.test.ts(避免测试进发布产物)。ootb / npm-publish@sfmc-bds/eslint-plugin@v0.1.0均已绿。本 PR 修复该推送暴露的可验证 DRY/DIP 问题。
审查(DRY / OCP / DIP / LSP / Demeter)
exclude *.test.ts后npm test仍期望dist/**/*.test.js,测试永不 emitRuleTester把describe/it都绑到顶层test,嵌套用例被 parent 取消(74→0)pack:verify手抄npm pack -w列表,漏掉刚登记的 eslint-pluginSDK_PUBLIC_EXPORTS与 SDKpackage.json#exports双份维护plugin.meta.version硬编码,与 package.json 漂移改动
tsconfig.test.json+build:test:发布 build 继续排除测试/rule-tester;测试走独立编译node:test的describe/it/aftertools/pack-verify.mjs:从NPM_PUBLISH_PACKAGES派生 pack 列表;根脚本改为调用它visitModuleSourceLiterals:收敛 import/export 字面量访问loadSdkPublicExports():优先读 sibling/已安装 SDK 的exports;否则回落静态表plugin.meta:name/version 读本包package.json验证
npm run build -w @sfmc-bds/eslint-plugin(dist 无*.test.js/rule-tester)npm test -w @sfmc-bds/eslint-plugin(74 pass)npm pack -w @sfmc-bds/eslint-plugin(tarball 无测试产物)assertPublishPackageInWorkspaces覆盖全部清单包未改