-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Addon Storysource improvements #3040
Conversation
} | ||
|
||
function prettifyCode(source) { | ||
return prettier.format(source, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make it optional and configurable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only the prettier or the whole comments removal? Also. why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prettier. Users may have their own preferences about how their code should be formatted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I thought we won't expose it to users 😂 But I can make it configurable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we won't expose it to users
Why? I would like to use it in my project (and we don't use semicolons =)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
Probably I needed to spend a bit more time on writing a Readme 🤔
let lastIndex = 0; | ||
const parts = [source]; | ||
|
||
const isUgly = comment => comment.value.trim().indexOf('eslint-') === 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also "global", "flow", "$FlowFixMe", probably others. Let's make it an array of regexp patterns, probably also configurable from outside
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added "global" and "eslint" as defaults. Do you think we need to support flow as well? I'm not familiar with its comments syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's good defaults
Codecov Report
@@ Coverage Diff @@
## master #3040 +/- ##
========================================
Coverage ? 92.5%
========================================
Files ? 6
Lines ? 40
Branches ? 2
========================================
Hits ? 37
Misses ? 2
Partials ? 1 Continue to review full report at Codecov.
|
}; | ||
|
||
function isUglyComment(comment, uglyCommentsRegex) { | ||
return uglyCommentsRegex.find(regex => regex.test(comment)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.some
not .find
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's fix array method and update README — and we're good to go
Please fix remark warning |
What I did