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

[spaced-comment] Support typescript triple slash comments #600

Closed
TabithaLarkin opened this issue Jun 7, 2019 · 2 comments
Closed

[spaced-comment] Support typescript triple slash comments #600

TabithaLarkin opened this issue Jun 7, 2019 · 2 comments
Labels
package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look

Comments

@TabithaLarkin
Copy link

The default eslint rule spaced-comment does not support the triple-slash method of typescript file referencing. If it is turned on it will add a space between the second and third slash, breaking the reference.

Repro

{
  "rules": {
    "spaced-comment": ["error", "always"],
  }
}
/// <reference path="yourFile.ts" />

//A comment

Expected Result

/// <reference path="yourFile.ts" />

// A comment

Actual Result

// / <reference path="yourFile.ts" />

// A comment

Versions

package version
ESLint 5.16.0
@TabithaLarkin TabithaLarkin added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Jun 7, 2019
@kaicataldo
Copy link
Member

kaicataldo commented Jun 7, 2019

Have you tried using spaced-comment's markers configuration option? The following is considered correct by ESLint and won't warn:

/* eslint spaced-comment: ["error", "always", { "markers": ["/"] }] */

/// This is a comment with a marker

@TabithaLarkin
Copy link
Author

@kaicataldo I have not, that's actually perfect. Sorry, I should have double checked the rule, I'm doing a migration from tslint and my life has become rule doc overload.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look
Projects
None yet
Development

No branches or pull requests

2 participants