Add multiline-comment-style lint rule and fix violations
Enable multiline-comment-style with starred-block to require JSDoc-style block comments with content on separate lines from the opening delimiter. Auto-fix existing violations across the codebase. Fixes #5899 Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
This commit is contained in:
co-authored by
Daniel Imms
parent
1a67b6f4b3
commit
4ec85e67ba
@@ -73,8 +73,10 @@ export class LinkComputer {
|
||||
continue;
|
||||
}
|
||||
|
||||
// map string positions back to buffer positions
|
||||
// values are 0-based right side excluding
|
||||
/*
|
||||
* map string positions back to buffer positions
|
||||
* values are 0-based right side excluding
|
||||
*/
|
||||
const [startY, startX] = LinkComputer._mapStrIdx(terminal, startLineIndex, 0, match.index);
|
||||
const [endY, endX] = LinkComputer._mapStrIdx(terminal, startY, startX, text.length);
|
||||
|
||||
@@ -172,11 +174,13 @@ export class LinkComputer {
|
||||
if (width) {
|
||||
stringIndex -= chars.length || 1;
|
||||
|
||||
// correct stringIndex for early wrapped wide chars:
|
||||
// - currently only happens at last cell
|
||||
// - cells to the right are reset with chars='' and width=1 in InputHandler.print
|
||||
// - follow-up line must be wrapped and contain wide char at first cell
|
||||
// --> if all these conditions are met, correct stringIndex by +1
|
||||
/*
|
||||
* correct stringIndex for early wrapped wide chars:
|
||||
* - currently only happens at last cell
|
||||
* - cells to the right are reset with chars='' and width=1 in InputHandler.print
|
||||
* - follow-up line must be wrapped and contain wide char at first cell
|
||||
* --> if all these conditions are met, correct stringIndex by +1
|
||||
*/
|
||||
if (i === line.length - 1 && chars === '') {
|
||||
const line = buf.getLine(lineIndex + 1);
|
||||
if (line && line.isWrapped) {
|
||||
|
||||
@@ -7,17 +7,19 @@ import type { Terminal, ITerminalAddon, IDisposable } from '@xterm/xterm';
|
||||
import type { WebLinksAddon as IWebLinksApi } from '@xterm/addon-web-links';
|
||||
import { ILinkProviderOptions, WebLinkProvider } from './WebLinkProvider';
|
||||
|
||||
// consider everthing starting with http:// or https://
|
||||
// up to first whitespace, `"` or `'` as url
|
||||
// NOTE: The repeated end clause is needed to not match a dangling `:`
|
||||
// resembling the old (...)*([^:"\'\\s]) final path clause
|
||||
// additionally exclude early + final:
|
||||
// - unsafe from rfc3986: !*'()
|
||||
// - unsafe chars from rfc1738: {}|\^~[]` (minus [] as we need them for ipv6 adresses, also allow ~)
|
||||
// also exclude as finals:
|
||||
// - final interpunction like ,.!?
|
||||
// - any sort of brackets <>()[]{} (not spec conform, but often used to enclose urls)
|
||||
// - unsafe chars from rfc1738: {}|\^~[]`
|
||||
/*
|
||||
* consider everthing starting with http:// or https://
|
||||
* up to first whitespace, `"` or `'` as url
|
||||
* NOTE: The repeated end clause is needed to not match a dangling `:`
|
||||
* resembling the old (...)*([^:"\'\\s]) final path clause
|
||||
* additionally exclude early + final:
|
||||
* - unsafe from rfc3986: !*'()
|
||||
* - unsafe chars from rfc1738: {}|\^~[]` (minus [] as we need them for ipv6 adresses, also allow ~)
|
||||
* also exclude as finals:
|
||||
* - final interpunction like ,.!?
|
||||
* - any sort of brackets <>()[]{} (not spec conform, but often used to enclose urls)
|
||||
* - unsafe chars from rfc1738: {}|\^~[]`
|
||||
*/
|
||||
const strictUrlRegex = /(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user