Skip to content

always set markers for spaced-comment rule to support reference types #318

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

Closed
wants to merge 1 commit into from

Conversation

beenotung
Copy link
Contributor

PR Checklist

Overview

Always set markers for spaced-comment rule to support reference types.

Example:

/// <reference types="path-to-file" />

Example:
```ts
/// <reference types="path-to-file" />
```

fixing for issue typescript-eslint#317
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for sending in this PR @beenotung! There are a few small things that'll need to be addressed. I can take a deeper look at the rule configuration logic then.

@@ -18,6 +18,13 @@ module.exports = {
},
plugins: ["@typescript-eslint"],
rules: {
"@typescript-eslint/array-type": [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔If you're interested in enabling another rule, would you mind filing a separate issue/PR? I'm generally in favor of this change but it'd be good to keep it separate.

@@ -4,8 +4,10 @@
*.map
coverage/
node_modules/
pnpm-lock.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with these: +1 to including this in a separate issue and/or PR?

Guessing you're a happy pnpm user? 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, shall we put this and array-type settings separately?

const capitalizedNotices: string[] = [];

if (!tslintRule.ruleArguments.includes("check-space")) {
spaceCommentRuleArguments.push("never");
if (!spaceCommentRuleArguments.includes("always")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, looks like you're missing unit test coverage for this line per the test coverage report. You'll need to add test coverage for this case to get it to pass.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get your point, will made another update

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I do not know how. I tried to duplicate the test case on line 19, added another version without the check-space in ruleArguments array, but npm run test:ci still complain missing coverage on that line

https://github.com/typescript-eslint/tslint-to-eslint-config/pull/318/files/e51155daa587e4f8d6f54f145c85d76ab7c74ea4#diff-e32ee4f42ec93518baf8586b4fb733caL19

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem on line 15 is that spaceCommentRuleArguments is an empty array so the test suite is not satisfying the condition. Also, shouldn't it be tslintRule.ruleArguments as before?

@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for author The PR author should address requested changes label Jan 29, 2020
@JoshuaKGoldberg
Copy link
Member

👋 hey again @beenotung! Are you still interested in working on this? If you've run out of time, I can continue working on this PR if that's helpful.

@JoshuaKGoldberg
Copy link
Member

Mmhh, closing this PR to keep the PR queue small. I'll send an equivalent PR to finish up the changes. Thanks for getting this started @beenotung! 💖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for author The PR author should address requested changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conflict on reference types
3 participants