mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add some linting rules for the CI (#587)
* enable one-var rule * enable indent rule * enable no-multiple-empty-lines rule * enable no-empty rule * enable no-trailing-spaces rule * enable no-extra-semi rule * add eslint rules to fix block spacing * enable max-statements-per-line rule * enable brace-style rule * fix some spacing issues and add future rules * add code suggestions
This commit is contained in:
parent
0b0ea7f406
commit
3739741786
101 changed files with 883 additions and 1051 deletions
|
@ -34,18 +34,14 @@ define([], function () {
|
|||
// when parsing previous hi-surrogate, 3 is added to byteLength
|
||||
if (prevCodePoint != null && isHighSurrogate(prevCodePoint)) {
|
||||
byteLength += 1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
byteLength += 3;
|
||||
}
|
||||
}
|
||||
else if (codePoint <= 0x7f) {
|
||||
} else if (codePoint <= 0x7f) {
|
||||
byteLength += 1;
|
||||
}
|
||||
else if (codePoint >= 0x80 && codePoint <= 0x7ff) {
|
||||
} else if (codePoint >= 0x80 && codePoint <= 0x7ff) {
|
||||
byteLength += 2;
|
||||
}
|
||||
else if (codePoint >= 0x800 && codePoint <= 0xffff) {
|
||||
} else if (codePoint >= 0x800 && codePoint <= 0xffff) {
|
||||
byteLength += 3;
|
||||
}
|
||||
prevCodePoint = codePoint;
|
||||
|
@ -77,8 +73,7 @@ define([], function () {
|
|||
|
||||
if (curByteLength === byteLength) {
|
||||
return string.slice(0, i + 1);
|
||||
}
|
||||
else if (curByteLength > byteLength) {
|
||||
} else if (curByteLength > byteLength) {
|
||||
return string.slice(0, i - segment.length + 1);
|
||||
}
|
||||
}
|
||||
|
@ -89,11 +84,11 @@ define([], function () {
|
|||
return {
|
||||
sanitize: function (input, replacement) {
|
||||
var sanitized = input
|
||||
.replace(illegalRe, replacement)
|
||||
.replace(controlRe, replacement)
|
||||
.replace(reservedRe, replacement)
|
||||
.replace(windowsReservedRe, replacement)
|
||||
.replace(windowsTrailingRe, replacement);
|
||||
.replace(illegalRe, replacement)
|
||||
.replace(controlRe, replacement)
|
||||
.replace(reservedRe, replacement)
|
||||
.replace(windowsReservedRe, replacement)
|
||||
.replace(windowsTrailingRe, replacement);
|
||||
return truncate(sanitized, 255);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue