1
Fork 0

Update dependencies and fix linting issues.

This commit is contained in:
Bauke 2020-12-16 17:46:20 +01:00
parent fdcb938def
commit 013bd6a2e3
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
10 changed files with 746 additions and 857 deletions

View File

@ -23,25 +23,25 @@
"htm": "^3.0.4", "htm": "^3.0.4",
"modern-normalize": "^1.0.0", "modern-normalize": "^1.0.0",
"platform": "^1.3.6", "platform": "^1.3.6",
"preact": "^10.5.3", "preact": "^10.5.7",
"webextension-polyfill-ts": "^0.20.0" "webextension-polyfill-ts": "^0.22.0"
}, },
"devDependencies": { "devDependencies": {
"@types/debounce": "^1.2.0", "@types/debounce": "^1.2.0",
"@types/platform": "^1.3.3", "@types/platform": "^1.3.3",
"eslint-config-xo-typescript": "^0.33.0", "eslint-config-xo-typescript": "^0.37.0",
"husky": "^4.3.0", "husky": "^4.3.6",
"parcel-bundler": "^1.12.4", "parcel-bundler": "^1.12.4",
"parcel-plugin-web-extension": "^1.6.1", "parcel-plugin-web-extension": "^1.6.1",
"sass": "^1.26.11", "sass": "^1.30.0",
"stylelint": "^13.7.2", "stylelint": "^13.8.0",
"stylelint-config-xo-scss": "^0.13.0", "stylelint-config-xo-scss": "^0.14.0",
"stylelint-config-xo-space": "^0.14.0", "stylelint-config-xo-space": "^0.15.1",
"trash-cli": "^3.1.0", "trash-cli": "^4.0.0",
"typescript": "^4.0.3", "typescript": "^4.1.3",
"web-ext": "^5.1.0", "web-ext": "^5.4.1",
"web-ext-types": "^3.2.1", "web-ext-types": "^3.2.1",
"xo": "^0.33.1" "xo": "^0.36.1"
}, },
"stylelint": { "stylelint": {
"extends": [ "extends": [

View File

@ -3,7 +3,7 @@
"manifest_version": 2, "manifest_version": 2,
"name": "Tildes ReExtended", "name": "Tildes ReExtended",
"description": "An updated and reimagined recreation of Tildes Extended to enhance and improve the experience of Tildes.net.", "description": "An updated and reimagined recreation of Tildes Extended to enhance and improve the experience of Tildes.net.",
"version": "1.0.0", "version": "1.0.1",
"permissions": [ "permissions": [
"downloads", "downloads",
"storage", "storage",

View File

@ -73,9 +73,9 @@ export class AutocompleteFeature extends Component<Props, State> {
if (event.key === prefix && !activeElement.getAttribute(dataAttribute)) { if (event.key === prefix && !activeElement.getAttribute(dataAttribute)) {
activeElement.setAttribute(dataAttribute, 'true'); activeElement.setAttribute(dataAttribute, 'true');
activeElement.addEventListener('keyup', (event) => activeElement.addEventListener('keyup', (event) => {
this.textareaInputHandler(event, prefix, target, values) this.textareaInputHandler(event, prefix, target, values);
); });
this.textareaInputHandler(event, prefix, target, values); this.textareaInputHandler(event, prefix, target, values);
} }

View File

@ -100,8 +100,9 @@ export class UserLabelsFeature extends Component<Props, State> {
const addLabel = html` const addLabel = html`
<span <span
class="trx-user-label-add" class="trx-user-label-add"
onClick=${(event: MouseEvent) => onClick=${(event: MouseEvent) => {
this.addLabelHandler(event, username)} this.addLabelHandler(event, username);
}}
> >
[+] [+]
</span> </span>
@ -139,9 +140,9 @@ export class UserLabelsFeature extends Component<Props, State> {
${userLabel.text} ${userLabel.text}
</span>`); </span>`);
label.addEventListener('click', (event: MouseEvent) => label.addEventListener('click', (event: MouseEvent) => {
this.editLabelHandler(event, userLabel.id) this.editLabelHandler(event, userLabel.id);
); });
element.after(label); element.after(label);
label.setAttribute('style', `background-color: ${userLabel.color};`); label.setAttribute('style', `background-color: ${userLabel.color};`);
@ -312,9 +313,9 @@ export class UserLabelsFeature extends Component<Props, State> {
return; return;
} }
querySelectorAll(`[data-trx-label-id="${id}"]`).map((value) => querySelectorAll(`[data-trx-label-id="${id}"]`).forEach((value) => {
value.remove() value.remove();
); });
settings.data.userLabels.splice(index, 1); settings.data.userLabels.splice(index, 1);
void setSettings(settings); void setSettings(settings);

View File

@ -93,7 +93,9 @@ function App(props: Props) {
key=${key} key=${key}
class="${activeFeature === key ? 'active' : ''} class="${activeFeature === key ? 'active' : ''}
${enabledFeatures.has(key) ? 'enabled' : ''}" ${enabledFeatures.has(key) ? 'enabled' : ''}"
onClick="${() => setActiveFeature(key)}" onClick="${() => {
setActiveFeature(key);
}}"
> >
${value} ${value}
</li>` </li>`

View File

@ -17,7 +17,7 @@ async function logSettings() {
export function AboutSetting(props: SettingProps): TRXComponent { export function AboutSetting(props: SettingProps): TRXComponent {
const importSettings = () => { const importSettings = () => {
(document.querySelector('#import-settings') as HTMLInputElement).click(); document.querySelector<HTMLElement>('#import-settings')!.click();
}; };
const communityLink = html` const communityLink = html`

View File

@ -35,7 +35,9 @@ export function HideVotesSetting(props: SettingProps): TRXComponent {
<input <input
type="checkbox" type="checkbox"
checked=${checked[target]} checked=${checked[target]}
onClick=${() => toggle(target)} onClick=${() => {
toggle(target);
}}
/> />
${label} ${label}
</label> </label>

View File

@ -20,7 +20,13 @@ function Header(props: SettingProps): TRXComponent {
return html`<header> return html`<header>
<h2>${props.title}</h2> <h2>${props.title}</h2>
<button onClick="${() => toggleFeature(props.feature)}">${enabled}</button> <button
onClick="${() => {
toggleFeature(props.feature);
}}"
>
${enabled}
</button>
</header>`; </header>`;
} }

View File

@ -23,6 +23,8 @@ export async function exportSettings(event: MouseEvent): Promise<void> {
// According to MDN, when creating an object URL we should also revoke it // According to MDN, when creating an object URL we should also revoke it
// when "it's safe to do so" to prevent excessive memory/storage use. // when "it's safe to do so" to prevent excessive memory/storage use.
// 60 seconds should probably be enough time to download the settings. // 60 seconds should probably be enough time to download the settings.
setTimeout(() => URL.revokeObjectURL(objectURL), 60 * 1000); setTimeout(() => {
URL.revokeObjectURL(objectURL);
}, 60 * 1000);
} }
} }

1532
yarn.lock

File diff suppressed because it is too large Load Diff