Skip to content

Commit

Permalink
chore(deps): upgrade all dev dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
giamir committed Jan 23, 2024
1 parent 9cb0d7c commit bfe589b
Show file tree
Hide file tree
Showing 19 changed files with 3,685 additions and 2,942 deletions.
41 changes: 40 additions & 1 deletion config/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,44 @@ module.exports = {
tsconfigRootDir: __dirname,
project: ["./tsconfig.eslint.json"],
},
extends: ["@stackoverflow"],
plugins: ["@typescript-eslint", "jest"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier",
"plugin:no-unsanitized/DOM",
],
rules: {
"no-console": "error",
"no-alert": "error",
"no-process-env": "error",
},
overrides: [
{
// enable
files: ["**/*.ts", "**/*.tsx"],
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
},
},
{
// only enable jest rules in non-e2e test files
files: ["**/!(*.e2e).test.ts"],
extends: ["plugin:jest/recommended", "plugin:jest/style"],
rules: {
"jest/no-disabled-tests": "off",
"jest/consistent-test-it": ["error", { fn: "it" }],
},
},
{
// enable a subset of jest rules in e2e test files, since the syntax is similar-ish
files: ["**/*.e2e.test.ts"],
extends: ["plugin:jest/recommended"],
rules: {
"jest/no-standalone-expect": "off",
},
},
],
};
6,477 changes: 3,587 additions & 2,890 deletions package-lock.json

Large diffs are not rendered by default.

55 changes: 27 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,44 +45,43 @@
},
"prettier": "@stackoverflow/prettier-config",
"devDependencies": {
"@commitlint/cli": "^17.4.4",
"@commitlint/config-conventional": "^17.4.4",
"@commitlint/cli": "^18.5.0",
"@commitlint/config-conventional": "^18.5.0",
"@playwright/test": "^1.41.1",
"@stackoverflow/commitlint-config": "^1.0.0",
"@stackoverflow/eslint-config": "^1.0.0",
"@stackoverflow/prettier-config": "^1.0.0",
"@stackoverflow/tsconfig": "^1.0.0",
"@types/jest": "^29.4.0",
"@typescript-eslint/eslint-plugin": "^5.53.0",
"@typescript-eslint/parser": "^5.53.0",
"@types/jest": "^29.5.11",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.7.3",
"cssnano": "^5.1.15",
"eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-jest": "^27.2.1",
"css-loader": "^6.9.1",
"cssnano": "^6.0.3",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^27.6.3",
"eslint-plugin-no-unsanitized": "^4.0.2",
"highlight.js": "^11.7.0",
"html-loader": "^4.2.0",
"html-webpack-plugin": "^5.5.0",
"highlight.js": "^11.9.0",
"html-loader": "^5.0.0",
"html-webpack-plugin": "^5.6.0",
"husky": "^8.0.3",
"jest": "^29.4.3",
"jest-environment-jsdom": "^29.4.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"liquidjs-loader": "^1.0.1",
"mini-css-extract-plugin": "^2.7.2",
"mini-css-extract-plugin": "^2.7.7",
"mini-svg-data-uri": "^1.4.4",
"postcss": "^8.4.21",
"postcss-loader": "^7.0.2",
"prettier": "^2.8.4",
"postcss": "^8.4.33",
"postcss-loader": "^8.0.0",
"prettier": "^3.2.4",
"standard-version": "^9.5.0",
"ts-jest": "^29.0.5",
"ts-loader": "^9.4.2",
"typescript": "^4.9.5",
"webpack": "^5.75.0",
"webpack-bundle-analyzer": "^4.8.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1",
"webpack-merge": "^5.8.0"
"ts-jest": "^29.1.2",
"ts-loader": "^9.5.1",
"typescript": "^5.3.3",
"webpack": "^5.89.0",
"webpack-bundle-analyzer": "^4.10.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.10.0"
},
"dependencies": {
"@lezer/highlight": "^1.1.3",
Expand Down
2 changes: 1 addition & 1 deletion site/layout.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 1 addition & 1 deletion site/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "../config/tsconfig.eslint.json"
"extends": "../config/tsconfig.eslint.json",
}
8 changes: 4 additions & 4 deletions src/rich-text/plugins/link-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ export class LinkEditor extends PluginInterfaceView<
this.viewContainer.innerHTML = escapeHTML`<div class="d-flex fd-column gsy gs8 p12">
<div class="flex--item">
<label for="link-editor-href-input-${randomId}" class="s-label mb4">${_t(
"link_editor.href_label"
)}</label>
"link_editor.href_label"
)}</label>
<input id="link-editor-href-input-${randomId}" class="s-input js-link-editor-href" type="text" name="href" aria-describedby="link-editor-href-error-${randomId}" />
<p id="link-editor-href-error-${randomId}" class="s-input-message mt4 d-none js-link-editor-href-error"></p>
</div>
<div class="flex--item">
<label for="link-editor-text-input-${randomId}" class="s-label mb4">${_t(
"link_editor.text_label"
)}</label>
"link_editor.text_label"
)}</label>
<input id="link-text-href-input-${randomId}" class="s-input js-link-editor-text" type="text" name="text" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/shared/editor-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export interface EditorPluginSpec {
* The language this processor applies to.
* A value of `*` applies to all languages when a more specific processor is not found
*/
lang: "*" | string;
lang: string;
callback: AddCodeBlockProcessorCallback;
}[];
}
Expand Down
4 changes: 2 additions & 2 deletions src/shared/markdown-it/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ function tagInfoToToken(tagInfo: TagInfo, existing?: Token): Token {
const postfix = tagInfo.isSelfClosing
? ""
: tagInfo.isClosing
? "_close"
: "_open";
? "_close"
: "_open";
let tokenType = "";

switch (tagInfo.type) {
Expand Down
4 changes: 2 additions & 2 deletions src/shared/markdown-it/reference-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ function setLinkReference(
const refLinkType = match[2]
? "full"
: match[0].endsWith("[]")
? "collapsed"
: "shortcut";
? "collapsed"
: "shortcut";

token.markup = "reference";
token.meta = (token.meta as Record<string, unknown>) || {};
Expand Down
4 changes: 2 additions & 2 deletions src/shared/prosemirror-plugins/interface-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ const MAIN_INTERFACE_MANAGER_KEY = new MainInterfaceManagerKey();
* handles the state changes across all interface-enabled plugins.
*/
export class ManagedInterfaceKey<
T extends ManagedInterfaceState
T extends ManagedInterfaceState,
> extends StatefulPluginKey<T> {
readonly name: string;

Expand Down Expand Up @@ -321,7 +321,7 @@ export function interfaceManagerPlugin(
*/
export abstract class PluginInterfaceView<
TData extends ManagedInterfaceState,
TKey extends ManagedInterfaceKey<TData>
TKey extends ManagedInterfaceKey<TData>,
> implements PluginView
{
protected key: TKey;
Expand Down
4 changes: 2 additions & 2 deletions src/shared/prosemirror-plugins/plugin-extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { log } from "../logger";
*/
interface StatefulPluginStateField<
T,
TThis extends StatefulPlugin<T> = StatefulPlugin<T>
TThis extends StatefulPlugin<T> = StatefulPlugin<T>,
> extends StateField<T> {
/** @inheritdoc */
init(this: TThis, config: EditorStateConfig, instance: EditorState): T;
Expand All @@ -41,7 +41,7 @@ interface StatefulPluginStateField<

export interface StatefulPluginSpec<
T,
TThis extends StatefulPlugin<T> = StatefulPlugin<T>
TThis extends StatefulPlugin<T> = StatefulPlugin<T>,
> extends PluginSpec<T> {
/** @inheritdoc */
key: StatefulPluginKey<T>;
Expand Down
1 change: 1 addition & 0 deletions src/shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export function escapeHTML(
): string {
let output = strings[0];
for (let i = 0, len = subs.length; i < len; i++) {
// eslint-disable-next-line @typescript-eslint/no-base-to-string
output += escapeHtml(subs[i]?.toString() || "") + strings[i + 1];
}

Expand Down
2 changes: 1 addition & 1 deletion src/shared/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export interface CommonmarkParserFeatures {
tables?: boolean;
tagLinks?: TagLinkOptions;
/** The method used to validate links; defaults to Stack Overflow's link validation */
validateLink?: (url: string) => boolean | false;
validateLink?: (url: string) => boolean;
}

export const defaultParserFeatures: Required<CommonmarkParserFeatures> = {
Expand Down
8 changes: 6 additions & 2 deletions src/styles/custom-components.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@
top: -112px;
transform: translateZ(-1px);
/* Transition out */
transition: top 1s ease, opacity 1.5s ease;
transition:
top 1s ease,
opacity 1.5s ease;
}

/* HACK: Remove the transition out for Safari, since the rubberband effect makes that shadow look really bad */
Expand All @@ -89,7 +91,9 @@
.s-editor-shadow.is-stuck:after {
opacity: 1;
top: 0;
transition: top 0.2s ease, opacity 0.1s ease;
transition:
top 0.2s ease,
opacity 0.1s ease;
}

.s-btn.s-editor-btn {
Expand Down
2 changes: 2 additions & 0 deletions test/matchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function expectNodeTree(doc: ProsemirrorNode, tree: CompareTree): void {
try {
expect(propValue).toEqual(tree[k]);
} catch (e: unknown) {
// eslint-disable-next-line @typescript-eslint/no-base-to-string
throw `Mismatch on property \`${k}\`\n${e?.toString()}`;
}
});
Expand All @@ -70,6 +71,7 @@ function expectNodeTree(doc: ProsemirrorNode, tree: CompareTree): void {
try {
expect(doc.content.childCount).toEqual(contentLength);
} catch (e: unknown) {
// eslint-disable-next-line @typescript-eslint/no-base-to-string
throw `Unexpected number of children \n${e?.toString()}\nReceived: ${JSON.stringify(
doc.content.toJSON()
)}`;
Expand Down
2 changes: 1 addition & 1 deletion test/shared/prosemirror-plugins/interface-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ describe("interface-manager plugin", () => {

class ChildInterfacePluginView<
TData extends { shouldShow: boolean },
TKey extends ManagedInterfaceKey<TData>
TKey extends ManagedInterfaceKey<TData>,
> extends PluginInterfaceView<TData, TKey> {
buildInterface(container: Element): void {
container.append(document.createTextNode(this.key.name + "build"));
Expand Down
1 change: 1 addition & 0 deletions test/shared/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ describe("utils", () => {
"should work with many substitution types (%#)",
(sub: unknown) => {
const result = escapeHTML`${sub}`;
// eslint-disable-next-line @typescript-eslint/no-base-to-string
expect(result).toBe(sub?.toString() || "");
}
);
Expand Down
4 changes: 2 additions & 2 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../config/tsconfig.eslint.json",
"compilerOptions": {
"target": "es6"
"target": "es6",
},
"types": ["jest", "./global.d.ts"]
"types": ["jest", "./global.d.ts"],
}
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "@stackoverflow/tsconfig/tsconfig.json",
"compilerOptions": {
"outDir": "./dist/",
"strictBindCallApply": true
"strictBindCallApply": true,
},
"include": ["src/**/*"]
"include": ["src/**/*"],
}

0 comments on commit bfe589b

Please sign in to comment.