Merge pull request #1148 from hgiesel/updatetypescript
Update Typescript to 4.2.4
This commit is contained in:
commit
8b4446d044
@ -8,7 +8,7 @@ module.exports = {
|
||||
plugins: ["@typescript-eslint"],
|
||||
rules: {
|
||||
"prefer-const": "warn",
|
||||
"@typescript-eslint/ban-ts-ignore": "warn",
|
||||
"@typescript-eslint/ban-ts-comment": "warn",
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"warn",
|
||||
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
|
||||
|
1
ts/.gitignore
vendored
1
ts/.gitignore
vendored
@ -1 +1,2 @@
|
||||
node_modules
|
||||
yarn-error.log
|
||||
|
@ -186,7 +186,7 @@ export class EditorToolbar extends HTMLElement {
|
||||
customElements.define("anki-editor-toolbar", EditorToolbar);
|
||||
|
||||
/* Exports for editor */
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error insufficient typing of svelte modules
|
||||
export { updateActiveButtons, clearActiveButtons } from "./CommandIconButton.svelte";
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error insufficient typing of svelte modules
|
||||
export { enableButtons, disableButtons } from "./EditorToolbar.svelte";
|
||||
|
@ -140,14 +140,6 @@ export function gatherData(
|
||||
};
|
||||
}
|
||||
|
||||
interface Reviews {
|
||||
mature: number;
|
||||
young: number;
|
||||
learn: number;
|
||||
relearn: number;
|
||||
early: number;
|
||||
}
|
||||
|
||||
export interface SummedDatum {
|
||||
label: string;
|
||||
// count of this particular item
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* eslint
|
||||
@typescript-eslint/no-non-null-assertion: "off",
|
||||
@typescript-eslint/no-explicit-any: "off",
|
||||
@typescript-eslint/ban-ts-ignore: "off" */
|
||||
@typescript-eslint/ban-ts-comment: "off" */
|
||||
|
||||
import type pb from "anki/backend_proto";
|
||||
import type { Selection } from "d3";
|
||||
|
@ -41,7 +41,7 @@ const filterStyling = (predicate: (property: string, value: string) => boolean)
|
||||
element: HTMLElement
|
||||
): void => {
|
||||
for (const property of [...element.style]) {
|
||||
const value = element.style.getPropertyValue(name);
|
||||
const value = element.style.getPropertyValue(property);
|
||||
|
||||
if (!predicate(property, value)) {
|
||||
element.style.removeProperty(property);
|
||||
|
@ -22,13 +22,13 @@
|
||||
"@types/node": "^14.14.20",
|
||||
"@types/react": "^16.9.53",
|
||||
"@types/react-dom": "^16.9.8",
|
||||
"@typescript-eslint/eslint-plugin": "^2.11.0",
|
||||
"@typescript-eslint/parser": "^2.11.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.22.0",
|
||||
"@typescript-eslint/parser": "^4.22.0",
|
||||
"chalk": "^4.1.0",
|
||||
"cross-env": "^7.0.2",
|
||||
"diff": "^5.0.0",
|
||||
"escodegen": "^2.0.0",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint": "^7.24.0",
|
||||
"espree": "^7.3.1",
|
||||
"estraverse": "^5.2.0",
|
||||
"glob": "^7.1.6",
|
||||
@ -46,7 +46,7 @@
|
||||
"svelte2tsx": "^0.1.133",
|
||||
"tmp": "^0.2.1",
|
||||
"tslib": "^2.0.3",
|
||||
"typescript": "^3.9.7",
|
||||
"typescript": "^4.2.4",
|
||||
"uglify-js": "^3.13.1"
|
||||
},
|
||||
"scripts": {
|
||||
|
@ -2,7 +2,7 @@
|
||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
|
||||
import sqlFormatter from "@sqltools/formatter";
|
||||
import * as Diff from "diff";
|
||||
import { createPatch } from "diff";
|
||||
import process from "process";
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
@ -38,7 +38,7 @@ for (const path of process.argv.slice(2)) {
|
||||
errorFound = true;
|
||||
console.log("SQL formatting issues found:");
|
||||
}
|
||||
console.log(Diff.createPatch(path, orig, formatted));
|
||||
console.log(createPatch(path, orig, formatted));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ function compile(tsPath: string, tsLibs: string[]) {
|
||||
return createdFiles[parsedCommandLine.fileNames[0].replace(".ts", ".d.ts")];
|
||||
}
|
||||
|
||||
function writeFile(file, data) {
|
||||
function writeFile(file, data): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.writeFile(file, data, (err) => {
|
||||
if (err) {
|
||||
@ -129,7 +129,7 @@ async function writeDts(tsPath, dtsPath, tsLibs) {
|
||||
await writeFile(dtsPath, dtsSource);
|
||||
}
|
||||
|
||||
function writeTs(svelteSource, sveltePath, tsPath) {
|
||||
function writeTs(svelteSource, sveltePath, tsPath): void {
|
||||
let tsSource = svelte2tsx(svelteSource, {
|
||||
filename: sveltePath,
|
||||
strictMode: true,
|
||||
@ -187,7 +187,7 @@ async function compileSvelte(args) {
|
||||
const svelteSource = (await readFile(sveltePath)) as string;
|
||||
|
||||
const mockTsPath = sveltePath + ".ts";
|
||||
await writeTs(svelteSource, sveltePath, mockTsPath);
|
||||
writeTs(svelteSource, sveltePath, mockTsPath);
|
||||
await writeDts(mockTsPath, dtsPath, tsLibs);
|
||||
await writeJs(svelteSource, sveltePath, mjsPath, cssPath, binDir, genDir);
|
||||
|
||||
|
724
ts/yarn.lock
724
ts/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user