Incremental non-determinism for jsdoc bracketing
See original GitHub issueI’m sorry, but I am really overwhelmed at the moment and that’s the best I can do to get this on your radar.
Setup
Visual Studio Code
Version: 1.40.1
Commit: 8795a9889db74563ddd43eb0a897a2384129a619
Date: 2019-11-13T16:47:44.719Z
Prettier - Code formatter 3.9.0
Name: Prettier - Code formatter
Id: esbenp.prettier-vscode
Description: Code formatter using prettier
Version: 3.9.0
Publisher: Esben Petersen
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
.prettierrc
"@smotaal.io/tools/prettier.config"
@smotaal.io/tools/prettier.config/.prettierrc.json
<kbd>package.main</kbd>
{
"semi": true,
"arrowParens": "avoid",
"printWidth": 120,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": false,
"jsxBracketSameLine": true,
"endOfLine": "lf",
"tabWidth": 2,
"useTabs": false
}
Presentation
-
Given the following code fragment in
Untitled-1
<kbd>js</kbd>:typeof /** @type {typeof Matcher} */ (matcher.constructor).clone !== 'function'
-
Executing Format Document once, rewrites it as:
typeof (/** @type {typeof Matcher} */ (matcher.constructor).clone) !== "function";
-
Executing Format Document again, as:
typeof (/** @type {typeof Matcher} */ (matcher.constructor.clone)) !== "function";
Synopsis
Deterministic rewrite can be defined as a rewrite for which the generated output remains intact when subsequently processed by the generator for that output.
Incremental non-determinism is when the output of the rewriter is subsequently altered by the same generator.
It is expected that all features of prettier must include testing where the output must not change when run a second time under the same configuration.
How this bug has not made it through with templates is probably why I decided to not follow it.
Thanks 🙏
Issue Analytics
- State:
- Created 4 years ago
- Comments:19 (10 by maintainers)
@evilebottnawi That’s what I wrote. #7055 is a separate thing though.
@thorn0 oh, yes, I looked wrong place 😄 , everything is fine