1
Fork 0

Refactor: Fix linting issues introduced with new versions.

This commit is contained in:
Bauke 2020-03-03 19:16:40 +01:00
parent b27f73ad20
commit 947ddfb224
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
5 changed files with 28 additions and 24 deletions

View File

@ -58,7 +58,8 @@
"rules": { "rules": {
"scss/at-rule-no-unknown": null, "scss/at-rule-no-unknown": null,
"at-rule-no-unknown": null, "at-rule-no-unknown": null,
"block-no-empty": null "block-no-empty": null,
"no-descending-specificity": null
} }
}, },
"xo": { "xo": {
@ -83,6 +84,8 @@
"SwitchCase": 1 "SwitchCase": 1
} }
], ],
"@typescript-eslint/member-ordering": "off",
"unicorn/prefer-modern-dom-apis": "off",
"capitalized-comments": "off", "capitalized-comments": "off",
"no-await-in-loop": "off" "no-await-in-loop": "off"
}, },

View File

@ -23,7 +23,8 @@ import git from 'simple-git/promise';
if (manifestJSON.version !== packageJSON.version) { if (manifestJSON.version !== packageJSON.version) {
console.log( console.log(
`manifest.json and package.json versions are not the same:\n${manifestJSON.version} | ${packageJSON.version}` `manifest.json and package.json versions are not the same:\n` +
`${String(manifestJSON.version)} | ${String(packageJSON.version)}`
); );
return; return;
} }
@ -39,7 +40,7 @@ import git from 'simple-git/promise';
description: `${currentVersion} -> ${semver.inc( description: `${currentVersion} -> ${semver.inc(
currentVersion, currentVersion,
'major' 'major'
)}`, )!}`,
value: 'major' value: 'major'
}, },
{ {
@ -47,7 +48,7 @@ import git from 'simple-git/promise';
description: `${currentVersion} -> ${semver.inc( description: `${currentVersion} -> ${semver.inc(
currentVersion, currentVersion,
'minor' 'minor'
)}`, )!}`,
value: 'minor' value: 'minor'
}, },
{ {
@ -55,7 +56,7 @@ import git from 'simple-git/promise';
description: `${currentVersion} -> ${semver.inc( description: `${currentVersion} -> ${semver.inc(
currentVersion, currentVersion,
'patch' 'patch'
)}`, )!}`,
value: 'patch' value: 'patch'
} }
] as Array<prompts.Choice & {description?: string}> | undefined, ] as Array<prompts.Choice & {description?: string}> | undefined,
@ -70,7 +71,7 @@ import git from 'simple-git/promise';
case 'patch': case 'patch':
break; break;
default: default:
console.log(`Unknown input: ${input.type}`); console.log(`Unknown input: ${String(input.type)}`);
return; return;
} }

View File

@ -6,7 +6,7 @@ html {
} }
body { body {
background-color: darken($background, 5%); background-color: adjust-color($background, $lightness: -5%);
color: $foreground; color: $foreground;
font-family: sans-serif; font-family: sans-serif;
font-size: 2rem; font-size: 2rem;
@ -14,7 +14,7 @@ body {
a, a,
a:visited { a:visited {
color: lighten($blue, 10%); color: adjust-color($blue, $lightness: 10%);
&:hover { &:hover {
color: $magenta; color: $magenta;
@ -39,7 +39,7 @@ button {
} }
code { code {
background-color: darken($background, 5%); background-color: adjust-color($background, $lightness: -5%);
} }
details { details {
@ -123,8 +123,8 @@ p > .red-re {
margin-right: 1rem; margin-right: 1rem;
> a { > a {
background-color: lighten($background, 5%); background-color: adjust-color($background, $lightness: 5%);
border-bottom: 0.25rem solid darken($background, 5%); border-bottom: 0.25rem solid adjust-color($background, $lightness: -5%);
color: $foreground; color: $foreground;
padding: 2rem; padding: 2rem;
@ -133,12 +133,12 @@ p > .red-re {
} }
&:hover:not(.active) { &:hover:not(.active) {
background-color: darken($blue, 20%); background-color: adjust-color($blue, $lightness: -20%);
cursor: pointer; cursor: pointer;
} }
&.active { &.active {
background-color: darken($blue, 10%); background-color: adjust-color($blue, $lightness: -10%);
} }
} }
} }
@ -163,7 +163,7 @@ p > .red-re {
min-width: 10rem; min-width: 10rem;
&:hover { &:hover {
background-color: darken($red, 10%); background-color: adjust-color($red, $lightness: -10%);
} }
} }
} }
@ -175,7 +175,7 @@ p > .red-re {
background-color: $green; background-color: $green;
&:hover { &:hover {
background-color: darken($green, 10%); background-color: adjust-color($green, $lightness: -10%);
} }
} }
} }
@ -223,7 +223,7 @@ p > .red-re {
padding: 1rem; padding: 1rem;
&:hover { &:hover {
background-color: darken($cyan, 10%); background-color: adjust-color($cyan, $lightness: -10%);
} }
&:last-child { &:last-child {
@ -254,7 +254,7 @@ p > .red-re {
background-color: $blue; background-color: $blue;
&:hover { &:hover {
background-color: darken($blue, 10%); background-color: adjust-color($blue, $lightness: -10%);
} }
} }
@ -262,7 +262,7 @@ p > .red-re {
background-color: $red; background-color: $red;
&:hover { &:hover {
background-color: darken($red, 10%); background-color: adjust-color($red, $lightness: -10%);
} }
} }

View File

@ -40,7 +40,7 @@ $extra-large-breakpoint: 1800px;
} }
&.trx-flash-error { &.trx-flash-error {
background-color: darken($red, 25%); background-color: adjust-color($red, $lightness: -25%);
border-color: $red; border-color: $red;
} }
} }

View File

@ -118,7 +118,7 @@ window.addEventListener(
// Set the button text to enable/disable based on the current setting. // Set the button text to enable/disable based on the current setting.
const toggleButton: HTMLButtonElement = querySelector(`#${id}-button`); const toggleButton: HTMLButtonElement = querySelector(`#${id}-button`);
toggleButton.addEventListener('click', toggleButtonClickHandler); toggleButton.addEventListener('click', toggleButtonClickHandler);
toggleButton.textContent = value === true ? 'Enabled' : 'Disabled'; toggleButton.textContent = value ? 'Enabled' : 'Disabled';
// Add a checkmark to the list item if the feature is enabled. // Add a checkmark to the list item if the feature is enabled.
const listItem: HTMLAnchorElement = querySelector(`#${id}-list`); const listItem: HTMLAnchorElement = querySelector(`#${id}-list`);
@ -156,7 +156,7 @@ async function toggleButtonClickHandler(event: MouseEvent): Promise<void> {
await setSettings(settings); await setSettings(settings);
// Update the button text. // Update the button text.
target.textContent = wantedSettingValue === true ? 'Enabled' : 'Disabled'; target.textContent = wantedSettingValue ? 'Enabled' : 'Disabled';
// Grab the equivalent list item and update the checkmark. // Grab the equivalent list item and update the checkmark.
const listItem: HTMLAnchorElement = querySelector( const listItem: HTMLAnchorElement = querySelector(
@ -274,12 +274,12 @@ function createReportTemplate(): string {
<h3>Info</h3>\n <h3>Info</h3>\n
| Type | Value | | Type | Value |
|------|-------| |------|-------|
| Operating System | ${platform.os} | | Operating System | ${platform.os!.toString()} |
| Browser | ${platform.name} ${platform.version} (${platform.layout}) |\n`; | Browser | ${platform.name!} ${platform.version!} (${platform.layout!}) |\n`;
// The platform manufacturer and product can be null in certain cases (such as // The platform manufacturer and product can be null in certain cases (such as
// desktops) so only when they're both not null include them. // desktops) so only when they're both not null include them.
if (platform.manufacturer !== null && platform.product !== null) { if (platform.manufacturer !== null && platform.product !== null) {
reportTemplate += `| Device | ${platform.manufacturer} ${platform.product} |\n`; reportTemplate += `| Device | ${platform.manufacturer!} ${platform.product!} |\n`;
} }
reportTemplate += `\n<h3>The Problem</h3> reportTemplate += `\n<h3>The Problem</h3>