Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 25, 2025

  • Investigate the TS7053 issue
  • Identify root cause: Parser pattern '([^']+)' fails when types contain nested single quotes (e.g., object literal property names like '/3-ui/heading.md': { ... })
  • Fix the parser to handle nested quotes in type definitions by using non-greedy matching (.-)
  • Add test case for complex types with nested quotes
  • Run tests and verify fix
  • Restore type docs in db.lua that were accidentally deleted
  • Audit all db/error tests for substitution correctness
  • Fix TS2324 test to check for both {0} and {1} substitutions
  • Fix TS2741 test to check for all three {0}, {1}, {2} substitutions
Original prompt

This section details on the original issue you should resolve

<issue_title>Missing translations/serializations for error:TS7053</issue_title>
<issue_description>Original error (from the CLI)

tests/application/pages-test.ts:71:32 - error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ '/3-ui/heading.md': { 'landmark-main-is-top-level': { enabled: boolean; }; 'landmark-no-duplicate-main': { enabled: boolean; }; }; }'.
  No index signature with a parameter of type 'string' was found on type '{ '/3-ui/heading.md': { 'landmark-main-is-top-level': { enabled: boolean; }; 'landmark-no-duplicate-main': { enabled: boolean; }; }; }'.

71       const settings: object = a11yChecks[page.path] ?? {};
                                  ~~~~~~~~~~~~~~~~~~~~~


Found 1 error in tests/application/pages-test.ts:71

what I see in my editor:

Diagnostics:
1. typescript: You can't use '{0}' to index into '{1}'. [This article](https://www.totaltypescript.com/concepts/type-string-cannot-be-used-to-index-type) might help. [7053]

As an aside, is there a way to make neovim render proper markdown links?</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 25, 2025 15:52
Co-authored-by: dmmulroy <2755722+dmmulroy@users.noreply.github.com>
Co-authored-by: dmmulroy <2755722+dmmulroy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix missing translations for error TS7053 Fix parser to handle TypeScript types with nested quotes Nov 25, 2025
Copilot AI requested a review from dmmulroy November 25, 2025 15:58
@dmmulroy
Copy link
Owner

@copilot why did you delete the type docs in db.lua, also i need you to double check all the tests and make sure they're all correctly passing

Co-authored-by: dmmulroy <2755722+dmmulroy@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 26, 2025

@copilot why did you delete the type docs in db.lua, also i need you to double check all the tests and make sure they're all correctly passing

The type docs were accidentally deleted when I ran npm run build which regenerated the db.lua file without the header comments. Restored them in 941ff2a.

All tests pass: 134 tests, 0 failures.

@dmmulroy dmmulroy marked this pull request as ready for review November 26, 2025 02:07
@dmmulroy
Copy link
Owner

@copilot please review and audit all of our db/error tests and make sure we're correctly testing each error substitution. Correct any tests that are wrong and give me a detailed report in a comment about your findings and work

Co-authored-by: dmmulroy <2755722+dmmulroy@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 26, 2025

@copilot please review and audit all of our db/error tests and make sure we're correctly testing each error substitution. Correct any tests that are wrong and give me a detailed report in a comment ab...

Completed audit of all db/error tests. Here's my detailed report:

Summary:

  • Total errors in database: 67
  • Errors with placeholders (need substitution): 36
  • Errors without placeholders: 31
  • All 134 tests passing

Issues Found & Fixed (9de7db1):

  1. TS2324 - Test only checked for {0} (name) but improved_message uses both {0} and {1} (User). Added assertion for User.
  2. TS2741 - Test checked {0} and {2} but improved_message also uses {1} (User). Added assertion for User.

Intentional Design Decisions (Not Bugs):
These 11 errors have placeholders in patterns but improved_messages are intentionally generic:

  • TS1208: Generic message about isolatedModules flag
  • TS2304: Generic "can't find variable" message
  • TS2327: Uses {0} and {2} but not {1} (intermediate type)
  • TS2339: Uses {0} but not {1} (type name)
  • TS2551: Uses {0} and {2} but not {1} (type name)
  • TS2552: Generic message, doesn't use either name
  • TS2686: Generic JSX config advice
  • TS2749: Generic explanation
  • TS5075: Uses {0} and {2} but not {1}
  • TS6142: Generic JSX advice
  • TS7026: Generic JSX advice

All substitutions that ARE used in improved_messages are correctly tested and working.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing translations/serializations for error:TS7053

2 participants