[dev] ESLint: Ignore max length for comments (#2220)
This commit is contained in:
parent
ccc178c2fd
commit
171d42ac1f
@ -20,7 +20,10 @@
|
|||||||
],
|
],
|
||||||
"max-len": [
|
"max-len": [
|
||||||
"error",
|
"error",
|
||||||
120
|
{
|
||||||
|
"code": 120,
|
||||||
|
"ignoreComments": true
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"array-bracket-newline": [
|
"array-bracket-newline": [
|
||||||
2,
|
2,
|
||||||
|
|||||||
@ -130,9 +130,12 @@ function replaceEmojis(textParts: TextPart[], size: 'big' | 'small', type: 'jsx'
|
|||||||
}
|
}
|
||||||
if (type === 'html') {
|
if (type === 'html') {
|
||||||
emojiResult.push(
|
emojiResult.push(
|
||||||
// For preventing extra spaces in html
|
`<img\
|
||||||
// eslint-disable-next-line max-len
|
draggable="false"\
|
||||||
`<img draggable="false" class="${className}" src="./img-apple-${size === 'big' ? '160' : '64'}/${code}.png" alt="${emoji}" />`,
|
class="${className}"\
|
||||||
|
src="./img-apple-${size === 'big' ? '160' : '64'}/${code}.png"\
|
||||||
|
alt="${emoji}"\
|
||||||
|
/>`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,6 @@ import AnimatedSticker from '../../common/AnimatedSticker';
|
|||||||
|
|
||||||
import './Sticker.scss';
|
import './Sticker.scss';
|
||||||
|
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
// https://github.com/telegramdesktop/tdesktop/blob/master/Telegram/SourceFiles/history/view/media/history_view_sticker.cpp#L42
|
// https://github.com/telegramdesktop/tdesktop/blob/master/Telegram/SourceFiles/history/view/media/history_view_sticker.cpp#L42
|
||||||
const EFFECT_SIZE_MULTIPLIER = 1 + 0.245 * 2;
|
const EFFECT_SIZE_MULTIPLIER = 1 + 0.245 * 2;
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,6 @@ export default function calculateAuthorWidth(text: string) {
|
|||||||
|
|
||||||
if (!element) {
|
if (!element) {
|
||||||
element = document.createElement('span');
|
element = document.createElement('span');
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
element.style.font = `400 12px ${fontFamily}`;
|
element.style.font = `400 12px ${fontFamily}`;
|
||||||
element.style.whiteSpace = 'nowrap';
|
element.style.whiteSpace = 'nowrap';
|
||||||
element.style.position = 'absolute';
|
element.style.position = 'absolute';
|
||||||
|
|||||||
@ -262,7 +262,6 @@ export function getUserIdDividend(userId: string) {
|
|||||||
return Math.abs(Number(userId));
|
return Math.abs(Number(userId));
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
// https://github.com/telegramdesktop/tdesktop/blob/371510cfe23b0bd226de8c076bc49248fbe40c26/Telegram/SourceFiles/data/data_peer.cpp#L53
|
// https://github.com/telegramdesktop/tdesktop/blob/371510cfe23b0bd226de8c076bc49248fbe40c26/Telegram/SourceFiles/data/data_peer.cpp#L53
|
||||||
export function getUserColorKey(peer: ApiUser | ApiChat | undefined) {
|
export function getUserColorKey(peer: ApiUser | ApiChat | undefined) {
|
||||||
const index = peer ? getUserIdDividend(peer.id) % 7 : 0;
|
const index = peer ? getUserIdDividend(peer.id) % 7 : 0;
|
||||||
|
|||||||
@ -191,7 +191,6 @@ export function getColorLuma(rgbColor: [number, number, number]) {
|
|||||||
return luma;
|
return luma;
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
// Function was adapted from https://github.com/telegramdesktop/tdesktop/blob/35ff621b5b52f7e3553fb0f990ea13ade7101b8e/Telegram/SourceFiles/data/data_wall_paper.cpp#L518
|
// Function was adapted from https://github.com/telegramdesktop/tdesktop/blob/35ff621b5b52f7e3553fb0f990ea13ade7101b8e/Telegram/SourceFiles/data/data_wall_paper.cpp#L518
|
||||||
export function getPatternColor(rgbColor: [number, number, number]) {
|
export function getPatternColor(rgbColor: [number, number, number]) {
|
||||||
let [hue, saturation, value] = rgb2hsb(rgbColor);
|
let [hue, saturation, value] = rgb2hsb(rgbColor);
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
const PROVIDER = 'https://maps.google.com/maps';
|
const PROVIDER = 'https://maps.google.com/maps';
|
||||||
|
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
// https://github.com/TelegramMessenger/Telegram-iOS/blob/2a32c871882c4e1b1ccdecd34fccd301723b30d9/submodules/LocationResources/Sources/VenueIconResources.swift#L82
|
// https://github.com/TelegramMessenger/Telegram-iOS/blob/2a32c871882c4e1b1ccdecd34fccd301723b30d9/submodules/LocationResources/Sources/VenueIconResources.swift#L82
|
||||||
const VENUE_COLORS = new Map(Object.entries({
|
const VENUE_COLORS = new Map(Object.entries({
|
||||||
'building/medical': '#43b3f4',
|
'building/medical': '#43b3f4',
|
||||||
@ -42,7 +41,6 @@ export function getVenueIconUrl(type?: string) {
|
|||||||
return `https://ss3.4sqi.net/img/categories_v2/${type}_88.png`;
|
return `https://ss3.4sqi.net/img/categories_v2/${type}_88.png`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
// https://github.com/TelegramMessenger/Telegram-iOS/blob/2a32c871882c4e1b1ccdecd34fccd301723b30d9/submodules/LocationResources/Sources/VenueIconResources.swift#L104
|
// https://github.com/TelegramMessenger/Telegram-iOS/blob/2a32c871882c4e1b1ccdecd34fccd301723b30d9/submodules/LocationResources/Sources/VenueIconResources.swift#L104
|
||||||
export function getVenueColor(type?: string) {
|
export function getVenueColor(type?: string) {
|
||||||
if (!type) return '#008df2';
|
if (!type) return '#008df2';
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
/* eslint-disable no-bitwise */
|
/* eslint-disable no-bitwise */
|
||||||
|
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
// Ref: https://github.com/telegramdesktop/tdesktop/blob/0743e71ab6b928d2ee5bae1aed991849b1e2b291/Telegram/SourceFiles/data/data_document.cpp#L1018
|
// Ref: https://github.com/telegramdesktop/tdesktop/blob/0743e71ab6b928d2ee5bae1aed991849b1e2b291/Telegram/SourceFiles/data/data_document.cpp#L1018
|
||||||
export function decodeWaveform(encoded5bit: Uint8Array) {
|
export function decodeWaveform(encoded5bit: Uint8Array) {
|
||||||
const bitsCount = encoded5bit.length * 8;
|
const bitsCount = encoded5bit.length * 8;
|
||||||
|
|||||||
@ -72,7 +72,6 @@ function isLandscape() {
|
|||||||
return window.matchMedia('(orientation: landscape)').matches;
|
return window.matchMedia('(orientation: landscape)').matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
// Source: https://web.archive.org/web/20160509220835/http://blog.abouthalf.com/development/orientation-media-query-challenges-in-android-browsers/
|
// Source: https://web.archive.org/web/20160509220835/http://blog.abouthalf.com/development/orientation-media-query-challenges-in-android-browsers/
|
||||||
// Feature is marked as deprecated now, but it is still supported
|
// Feature is marked as deprecated now, but it is still supported
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/CSS/@media/device-aspect-ratio#browser_compatibility
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/@media/device-aspect-ratio#browser_compatibility
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user