Last 12 weeks · 32 commits
2 of 6 standards met
Fixes #164. This un-reverts #165 (re-introducing the JSDoc type cast support from #162) and fixes the regression that prompted the revert. Problem #162 detected JSDoc type casts with the guard , but (and patterns) are in that table even when they appear in binding positions. A comment attached to the of a — as emitted by the svelte compiler for hoisted declarations in server output — was wrapped in parens, producing invalid output like: Fix Track nodes in binding positions (variable declarator ids, function/method/arrow/TS-signature params, catch clause params) in a and exclude them from type cast detection. Genuine casts () still keep their parentheses. Tests New sample covering declarator ids, multiple declarators, function/arrow params, catch params, alongside a genuine cast.
Description esrap 2.3.3 (via #162, "preserve parentheses of jsdoc type casts") emits invalid JavaScript when a comment is attached to a binding identifier of a variable declaration rather than to an expression. The identifier gets wrapped in parentheses as if it were a JSDoc type cast, producing output like: which is a (rollup: `letThe keyword 'let' is reservedis_jsdoc_type_castsrc/languages/ts/index.jsconst foo = /* @type {number} / (1);IdentifierVariableDeclaratorletsvelteesrap: ^2.1.0let /* ... / ( /* ... / (computed));carbon-components-svelteletThe keyword 'let' is reservedesrap` to 2.3.2 via package manager overrides restores correct output.
Repository: sveltejs/esrap. Description: Parse in reverse Stars: 137, Forks: 16. Primary language: JavaScript. Languages: JavaScript (93.7%), TypeScript (6.3%). License: MIT. Homepage: https://svelte.dev/playground/1bfe207e15c841d49ceff859b342260d Latest release: v2.3.4 (13h ago). Open PRs: 3, open issues: 1. Last activity: 11h ago. Community health: 50%. Top contributors: Rich-Harris, manuel3108, github-actions[bot], MathiasWP, jycouet, andylovescode, dummdidumm, paoloricciuti, elliott-with-the-longest-name-on-github, Ocean-OS and others.