question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incremental non-determinism for jsdoc bracketing

See original GitHub issue

I’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

  1. Given the following code fragment in Untitled-1 <kbd>js</kbd>:

    typeof /** @type {typeof Matcher} */ (matcher.constructor).clone !== 'function'
    
  2. Executing Format Document once, rewrites it as:

    typeof (/** @type {typeof Matcher} */ (matcher.constructor).clone) !==
      "function";
    
  3. 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:closed
  • Created 4 years ago
  • Comments:19 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
thorn0commented, Nov 26, 2019

@evilebottnawi That’s what I wrote. #7055 is a separate thing though.

1reaction
alexander-akaitcommented, Nov 26, 2019

@thorn0 oh, yes, I looked wrong place 😄 , everything is fine

Read more comments on GitHub >

github_iconTop Results From Across the Web

Idempotency / Unstable method chain · Issue #2803 - GitHub
In printMemberChain there's no way to know beforehand that the object will break in the 1st case, but in the 2nd output it...
Read more >
Use JSDoc: @param
The @param tag requires you to specify the name of the parameter you are documenting. You can also include the parameter's type, enclosed...
Read more >
Use JSDoc: Index
Describe a function or method. Indicate that a function is a generator function. Document a global object. Indicate that the constructor should not...
Read more >
Use JSDoc: @property
The @property tag is a way to easily document a list of static properties of a class, namespace or other object. Normally JSDoc...
Read more >
Getting Started with JSDoc 3
JSDoc 3 is an API documentation generator for JavaScript, similar to Javadoc or phpDocumentor. You add documentation comments directly to your source code, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found