Skip to content

chore(eslint-plugin-internal): [no-dynamic-tests] restrict where noFormat can occur#12416

Open
kirkwaiblinger wants to merge 3 commits into
typescript-eslint:mainfrom
kirkwaiblinger:prohibit-noFormat-on-output
Open

chore(eslint-plugin-internal): [no-dynamic-tests] restrict where noFormat can occur#12416
kirkwaiblinger wants to merge 3 commits into
typescript-eslint:mainfrom
kirkwaiblinger:prohibit-noFormat-on-output

Conversation

@kirkwaiblinger

Copy link
Copy Markdown
Member

PR Checklist

Overview

I've been seeing various contributors put output: noFormat`foo` in the test cases lately.

For example:

Figured let's use our internal linting to ensure those don't creep in.

@typescript-eslint

Copy link
Copy Markdown
Contributor

Thanks for the PR, @kirkwaiblinger!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

@nx-cloud

nx-cloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit fcb7e94

Command Status Duration Result
nx run-many -t lint --projects=eslint-plugin --... ✅ Succeeded 52s View ↗
nx run-many -t typecheck:tsgo ✅ Succeeded 45s View ↗
nx run-many -t lint --projects=typescript-estre... ✅ Succeeded 50s View ↗
nx run-many -t typecheck ✅ Succeeded 40s View ↗
nx run-many -t lint --projects=ast-spec,utils,s... ✅ Succeeded 29s View ↗
nx run-many -t lint --projects=parser,type-util... ✅ Succeeded 27s View ↗
nx test eslint-plugin-internal --coverage=false ✅ Succeeded 9s View ↗
nx run types:build ✅ Succeeded 1s View ↗
Additional runs (14) ✅ Succeeded ... View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-06-16 00:18:43 UTC

@netlify

netlify Bot commented Jun 9, 2026

Copy link
Copy Markdown

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit fcb7e94
🔍 Latest deploy log https://app.netlify.com/projects/typescript-eslint/deploys/6a3095872e7a250008a04ed7
😎 Deploy Preview https://deploy-preview-12416--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (no change from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 90 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.37%. Comparing base (aaad718) to head (fcb7e94).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...lint-plugin-internal/src/rules/no-dynamic-tests.ts 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12416      +/-   ##
==========================================
+ Coverage   87.00%   94.37%   +7.37%     
==========================================
  Files         513      235     -278     
  Lines       16570    11826    -4744     
  Branches     5175     3934    -1241     
==========================================
- Hits        14417    11161    -3256     
+ Misses       1463      285    -1178     
+ Partials      690      380     -310     
Flag Coverage Δ
unittest 94.37% <94.44%> (+7.37%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...lint-plugin-internal/src/rules/no-dynamic-tests.ts 89.79% <94.44%> (+2.95%) ⬆️

... and 278 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 👍 agreed.

@JoshuaKGoldberg JoshuaKGoldberg added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Jun 13, 2026

@StyleShit StyleShit Jun 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea!

Just wondering - maybe it should be its own rule? Not sure whether it's related to no-dynamic-tests

@kirkwaiblinger kirkwaiblinger Jun 16, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I thought about too... But the way I would frame this is: the fundamental issue is that output wasn't being inspected at all by no-dynamic-tests and it should always have been, so I fixed that. Secondarily, I made sure that the existing exception for noFormat was only permitted in the input code rather than being extended to any location in the error object where a string appears. IMO these are both fixes within the existing scope of the rule, not added analysis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants