Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Allow comment-description suffix to csharpier-ignore comments #835

Closed
Strepto opened this issue Feb 21, 2023 · 1 comment · Fixed by #837
Closed

Request: Allow comment-description suffix to csharpier-ignore comments #835

Strepto opened this issue Feb 21, 2023 · 1 comment · Fixed by #837

Comments

@Strepto
Copy link
Contributor

Strepto commented Feb 21, 2023

I would like to be able to specify a "WHY" comment after I add //csharpier-ignore

Example (which is not possible today)

// csharpier-ignore-start -- Keep Matrix formatting
float m11 = m.M11, m12 = m.M12, m13 = m.M13;
float m21 = m.M21, m22 = m.M22, m23 = m.M23;
float m31 = m.M31, m32 = m.M32, m33 = m.M33;
// csharpier-ignore-end

or

// csharpier-ignore -- Class copied as-is from other project, want to keep formatting
internal class Euler {

CSharpier v0.21 does not find comments which start with // csharpier-ignore but have a different ending.

This is a suggestion seen in eslint, and I find it useful to keep the "why-comment" inline.

Example from eslint docs on this feature: https://eslint.org/docs/latest/use/configure/rules#configuration-comment-descriptions
/* eslint eqeqeq: "off", curly: "error" -- Here's a description about why this configuration is necessary. */

Suggested allowed (regexish) format (tests):

\/\/ csharpier-ignore($| --)

This is NOT supported by prettier though, so feel free to close this if you feel it is out of scope.

@belav
Copy link
Owner

belav commented Feb 25, 2023

I'm not sure why prettier doesn't support this, it seems like a good idea to me. If someone was using // csharpier-ignore at work I'd like to understand why they were and this is cleaner than adding another comment above or below it.

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

Successfully merging a pull request may close this issue.

2 participants