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.

JSDoc compatibility: support prettier-ignore inside multi-line/JSDoc comment?

See original GitHub issue

Prettier 1.14.3 Playground link

I value human readability, so I often adjust the position of the colon and the position of the comment.

/**
 * Constants of ranking
 */
// prettier-ignore
export const RankingConstant = {
  KEY_DAILY_RANKING  : 'DAILY_RANKING',   // Key of daily ranking
  KEY_WEEKLY_RANKING : 'WEEKLY_RANKING',  // Key of weekly ranking
  KEY_MONTHLY_RANKING: 'MONTHLY_RANKING', // Key of monthly ranking
  LIMIT_OF_PAGE      : 50,                // Limit of page
  MAX_PAGE           : 100,               // Max page
};

Problem

I can adjust it using prettier-ignore comment, but the way to write single-line comments under multi-line comments is ugly and It may affect JSDoc (unconfirmed though).

Expect

Could you please write like this?

/**
 * Constants of ranking
 * prettier-ignore
 */

or

/**
 * Constants of ranking
 * @prettier-ignore
 */

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
lydellcommented, Oct 15, 2018

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSDoc Reference - TypeScript: Documentation
The list below outlines which constructs are currently supported when using JSDoc annotations to provide type information in JavaScript files.
Read more >
What is the correct way to write multi-line code in JSDoc ...
So I wonder what is the correct way to write multi-line code in comment? Update 2020/9/25. I can confirm this problem doesn't exist...
Read more >
jsdoc | Yarn - Package Manager
An API documentation generator for JavaScript. Want to contribute to JSDoc? Please read CONTRIBUTING.md . Installation and Usage. JSDoc supports stable versions ...
Read more >
Type-safe JavaScript code with JsDoc - Prisma
JsDoc is compatible with both JavaScript and TypeScript. ... JavaScript's primitive type types are supported in JsDocs.
Read more >
NetSuite Applications Suite - SuiteScript 2.x JSDoc Validation
The JSDoc tags are added to the comment blocks, and they are used to ... Some of these tags are required in each...
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