-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Print rule's documentation links #186
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mizdra
added
Type: Feature
New Feature
Status: Blocked
Progress on the issue is Blocked
help wanted
Extra attention is needed
labels
Feb 24, 2022
|
mizdra
changed the title
Revive rule's documentation links
Print rule's documentation links
Feb 24, 2022
After some investigation, it turns out that it's not a bug of |
mizdra
force-pushed
the
use-table-package
branch
from
March 21, 2022 16:31
abf576a
to
56c425f
Compare
mizdra
force-pushed
the
use-table-package
branch
from
March 22, 2022 10:30
cc1e195
to
d89d18e
Compare
mizdra
force-pushed
the
use-table-package
branch
from
March 22, 2022 14:58
897d3e2
to
eaed562
Compare
mizdra
force-pushed
the
use-table-package
branch
from
March 22, 2022 15:07
eaed562
to
73475a5
Compare
mizdra
commented
Mar 22, 2022
// - However, due to the specifications of Node.js, the decision does not work well on worker_threads. | ||
// - So here we use a special environment variable to force the printing mode to be switched. | ||
// ref: https://github.com/chalk/supports-color/issues/97, https://github.com/nodejs/node/issues/26946 | ||
FORCE_HYPERLINK: terminalLink.isSupported ? '1' : '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.
Workaround 1
mizdra
commented
Mar 22, 2022
Comment on lines
+40
to
+52
// The `table` package does not print the terminal link correctly. So eslint-interactive avoids | ||
// this by first printing the table in the `table` package without the link, | ||
// then converting it to a link by replacement. | ||
// ref: https://github.com/gajus/table/issues/113 | ||
let result = table.table(rows); | ||
ruleStatistics.forEach((ruleStatistic) => { | ||
const { ruleId } = ruleStatistic; | ||
const ruleMetaData = data?.rulesMeta[ruleId]; | ||
const ruleCell = ruleMetaData?.docs?.url | ||
? terminalLink(ruleId, ruleMetaData?.docs.url, { fallback: false }) | ||
: ruleId; | ||
result = result.replace(` ${ruleId} `, ` ${ruleCell} `); | ||
}); |
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.
Workaround 2
LGTM |
mizdra
removed
help wanted
Extra attention is needed
Status: Blocked
Progress on the issue is Blocked
labels
Mar 22, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix: #89
blocked by:
chalk/supports-color#97, gajus/table#113Try it out
$ yarn run dev
Before
After