mirror of
https://github.com/outline/outline.git
synced 2026-05-08 02:50:30 -05:00
chore: Setup missing oxlint configs (#9862)
* shared * server * app * remove vestigial eslintrc files * update comment directives
This commit is contained in:
@@ -6,6 +6,7 @@ __mocks__
|
||||
.DS_Store
|
||||
.env*
|
||||
.eslint*
|
||||
.oxlintrc*
|
||||
.log
|
||||
Makefile
|
||||
Procfile
|
||||
|
||||
+4
-33
@@ -1,9 +1,5 @@
|
||||
{
|
||||
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||
"plugins": ["eslint", "typescript"],
|
||||
"env": {
|
||||
"builtin": true
|
||||
},
|
||||
"ignorePatterns": [
|
||||
"build/**",
|
||||
"node_modules/**",
|
||||
@@ -35,6 +31,7 @@
|
||||
"no-empty-pattern": "error",
|
||||
"no-empty-static-block": "error",
|
||||
"no-ex-assign": "error",
|
||||
"no-explicit-any": "warn",
|
||||
"no-extra-boolean-cast": "error",
|
||||
"no-fallthrough": "error",
|
||||
"no-func-assign": "error",
|
||||
@@ -71,31 +68,12 @@
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"**/*.{js,jsx,ts,tsx}"
|
||||
],
|
||||
"files": ["**/*.{js,jsx,ts,tsx}"],
|
||||
"rules": {
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
{
|
||||
"name": "reakit/Menu",
|
||||
"importNames": [
|
||||
"useMenuState"
|
||||
],
|
||||
"message": "Do not use useMenuState from reakit/Menu. Use useMenuState instead."
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"eqeqeq": "error",
|
||||
"curly": "error",
|
||||
"no-console": "error",
|
||||
"arrow-body-style": [
|
||||
"error",
|
||||
"as-needed"
|
||||
],
|
||||
"arrow-body-style": ["error", "as-needed"],
|
||||
"no-useless-escape": "off",
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"react/self-closing-comp": [
|
||||
@@ -106,7 +84,6 @@
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-require-imports": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"import/no-named-as-default": "off",
|
||||
"import/no-named-as-default-member": "off",
|
||||
"no-unused-vars": [
|
||||
@@ -119,13 +96,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"plugins": [
|
||||
"eslint",
|
||||
"oxc",
|
||||
"react",
|
||||
"typescript",
|
||||
"import"
|
||||
]
|
||||
"plugins": ["eslint", "oxc", "react", "typescript", "import"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"extends": [
|
||||
"../.eslintrc",
|
||||
"plugin:react/recommended",
|
||||
"plugin:react-hooks/recommended"
|
||||
],
|
||||
"plugins": [
|
||||
"eslint-plugin-react-hooks"
|
||||
],
|
||||
"rules": {
|
||||
"react/react-in-jsx-scope": "off"
|
||||
},
|
||||
"env": {
|
||||
"jest": true,
|
||||
"browser": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"extends": ["../.oxlintrc.json"],
|
||||
"plugins": ["oxc", "eslint", "typescript", "react"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["**/*.{jsx,tsx}"],
|
||||
"rules": {
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
{
|
||||
"name": "reakit/Menu",
|
||||
"importNames": ["useMenuState"],
|
||||
"message": "Do not use useMenuState from reakit/Menu. Use useMenuState instead."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"plugins": ["import"]
|
||||
}
|
||||
],
|
||||
"env": {
|
||||
"jest": true,
|
||||
"browser": true
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable react/prop-types */
|
||||
/* oxlint-disable react/prop-types */
|
||||
import * as React from "react";
|
||||
import Tooltip, { Props as TooltipProps } from "~/components/Tooltip";
|
||||
import { performAction } from "~/actions";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable prefer-rest-params */
|
||||
/* oxlint-disable prefer-rest-params */
|
||||
/* global ga */
|
||||
import escape from "lodash/escape";
|
||||
import * as React from "react";
|
||||
|
||||
@@ -119,7 +119,7 @@ const ContextMenu: React.FC<Props> = ({
|
||||
>
|
||||
{(props) => (
|
||||
<InnerContextMenu
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
menuProps={props as any}
|
||||
{...rest}
|
||||
isSubMenu={isSubMenu}
|
||||
|
||||
@@ -333,7 +333,7 @@ export default function FindAndReplace({
|
||||
setShowReplace(false);
|
||||
editor.commands.clearSearch();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [localOpen]);
|
||||
|
||||
const disabled = totalResults === 0;
|
||||
|
||||
@@ -356,7 +356,7 @@ export default class PasteHandler extends Extension {
|
||||
simplifyDiff: true,
|
||||
}).mapping;
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
// oxlint-disable-next-line no-console
|
||||
console.warn("Failed to recreate transform: ", err);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,7 +448,7 @@ export class Editor extends React.PureComponent<
|
||||
step.mark.type.name === this.schema.marks.comment.name
|
||||
);
|
||||
|
||||
const self = this; // eslint-disable-line
|
||||
const self = this; // oxlint-disable-line
|
||||
const view = new EditorView(this.elementRef.current, {
|
||||
handleDOMEvents: {
|
||||
blur: this.handleEditorBlur,
|
||||
|
||||
@@ -79,7 +79,7 @@ export default function useCollectionTrees(): NavigationNode[] {
|
||||
const key = collections.orderedData.map((o) => o.documents?.length).join("-");
|
||||
const collectionTrees = useMemo(
|
||||
() => collections.orderedData.map(getCollectionTree),
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
||||
[collections.orderedData, key]
|
||||
);
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ export const useLocaleTime = ({
|
||||
"MMMM do, yyyy h:mm a";
|
||||
// @ts-expect-error fallback to formatLocaleLong
|
||||
const formatLocale = format?.[userLocale] ?? formatLocaleLong;
|
||||
const [_, setMinutesMounted] = useState(0); // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
const [_, setMinutesMounted] = useState(0);
|
||||
const callback = useRef<() => void>();
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from "react";
|
||||
import {
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
// oxlint-disable-next-line no-restricted-imports
|
||||
useMenuState as reakitUseMenuState,
|
||||
MenuStateReturn,
|
||||
} from "reakit/Menu";
|
||||
|
||||
@@ -28,7 +28,7 @@ export default function useThrottledCallback<T extends (...args: any[]) => any>(
|
||||
) {
|
||||
const handler = React.useMemo(
|
||||
() => throttle<T>(fn, wait, options),
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
||||
dependencies
|
||||
);
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
// oxlint-disable-next-line import/no-unresolved
|
||||
import "vite/modulepreload-polyfill";
|
||||
import { LazyMotion } from "framer-motion";
|
||||
import { KBarProvider } from "kbar";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable */
|
||||
/* oxlint-disable */
|
||||
import stores from "~/stores";
|
||||
|
||||
describe("Collection model", () => {
|
||||
|
||||
@@ -208,7 +208,7 @@ export default abstract class Model {
|
||||
|
||||
for (const property in this) {
|
||||
if (
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
// oxlint-disable-next-line no-prototype-builtins
|
||||
this.hasOwnProperty(property) &&
|
||||
!["persistedAttributes", "store", "isSaving", "isNew"].includes(
|
||||
property
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable react/no-unescaped-entities */
|
||||
/* oxlint-disable react/no-unescaped-entities */
|
||||
import { WarningIcon } from "outline-icons";
|
||||
import { Trans } from "react-i18next";
|
||||
import Notice from "~/components/Notice";
|
||||
|
||||
@@ -7,7 +7,7 @@ import Logger from "~/utils/Logger";
|
||||
import RootStore from "./RootStore";
|
||||
import Store from "./base/Store";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
class UnfurlsStore extends Store<Unfurl<any>> {
|
||||
actions = []; // no default actions allowed for unfurls.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import commandScore from "command-score";
|
||||
import invariant from "invariant";
|
||||
// eslint-disable-next-line lodash/import-scope
|
||||
// oxlint-disable-next-line lodash/import-scope
|
||||
import type { ObjectIterateeCustom } from "lodash";
|
||||
import deburr from "lodash/deburr";
|
||||
import filter from "lodash/filter";
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable */
|
||||
/* oxlint-disable */
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module '../.... Remove this comment to see the full error message
|
||||
import localStorage from "../../__mocks__/localStorage";
|
||||
import { initI18n } from "../utils/i18n";
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable no-console */
|
||||
/* oxlint-disable no-console */
|
||||
import * as Sentry from "@sentry/react";
|
||||
import env from "~/env";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable */
|
||||
/* oxlint-disable */
|
||||
export const client = {
|
||||
post: jest.fn(() =>
|
||||
Promise.resolve({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
||||
/* oxlint-disable @typescript-eslint/no-unused-expressions */
|
||||
// download.js v3.0, by dandavis; 2008-2014. [CCBY2] see http://danml.com/download.html for tests/usage
|
||||
// v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime
|
||||
// v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for larger+faster saves than dataURLs
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable no-console */
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
/* eslint-disable no-undef */
|
||||
/* oxlint-disable no-console */
|
||||
/* oxlint-disable @typescript-oxlint/no-var-requires */
|
||||
/* oxlint-disable no-undef */
|
||||
const { exec } = require("child_process");
|
||||
const { readdirSync, existsSync } = require("fs");
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ export class NotionClient {
|
||||
private async fetchWithRetry<T>(apiCall: () => Promise<T>): Promise<T> {
|
||||
let retries = 0;
|
||||
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
// oxlint-disable-next-line no-constant-condition
|
||||
while (true) {
|
||||
try {
|
||||
await this.limiter();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// eslint-disable-next-line no-undef
|
||||
// oxlint-disable-next-line no-undef
|
||||
module.exports = {
|
||||
includeCommitMessage: true,
|
||||
webpack: {
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
{
|
||||
"extends": [
|
||||
"../.eslintrc"
|
||||
],
|
||||
"parserOptions": {
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"rules": {
|
||||
"@typescript-eslint/no-misused-promises": [
|
||||
"error",
|
||||
{
|
||||
"checksVoidReturn": true
|
||||
}
|
||||
],
|
||||
"no-restricted-imports": ["error", {
|
||||
"name": "fetch-with-proxy",
|
||||
"message": "Use `@server/utils/fetch` instead"
|
||||
}, {
|
||||
"name": "node-fetch",
|
||||
"message": "Use `@server/utils/fetch` instead"
|
||||
}, {
|
||||
"name": "passport",
|
||||
"message": "Use the `@outlinewiki/koa-passport` package"
|
||||
}]
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["scripts/*"],
|
||||
"rules": {
|
||||
"no-console": "off"
|
||||
}
|
||||
}
|
||||
],
|
||||
"env": {
|
||||
"jest": true,
|
||||
"node": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"extends": ["../.oxlintrc.json"],
|
||||
"plugins": ["oxc", "eslint", "typescript", "node"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["**/*.{js,ts}"],
|
||||
"rules": {
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{
|
||||
"name": "fetch-with-proxy",
|
||||
"message": "Use `@server/utils/fetch` instead"
|
||||
},
|
||||
{
|
||||
"name": "node-fetch",
|
||||
"message": "Use `@server/utils/fetch` instead"
|
||||
},
|
||||
{
|
||||
"name": "passport",
|
||||
"message": "Use the `@outlinewiki/koa-passport` package"
|
||||
}
|
||||
]
|
||||
},
|
||||
"plugins": ["import"]
|
||||
}
|
||||
],
|
||||
"env": {
|
||||
"jest": true,
|
||||
"node": true
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
/* oxlint-disable @typescript-eslint/explicit-function-return-type */
|
||||
import { Tracer } from "dd-trace";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
// oxlint-disable-next-line @typescript-eslint/no-empty-function
|
||||
const emptyFn = function () {};
|
||||
|
||||
const callableHandlers = {
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable no-console */
|
||||
// eslint-disable-next-line import/order
|
||||
/* oxlint-disable no-console */
|
||||
// oxlint-disable-next-line import/order
|
||||
import environment from "./utils/environment";
|
||||
import os from "os";
|
||||
import {
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/no-misused-promises */
|
||||
/* eslint-disable import/order */
|
||||
/* oxlint-disable @typescript-eslint/no-misused-promises */
|
||||
/* oxlint-disable import/order */
|
||||
import env from "./env";
|
||||
|
||||
import "./logging/tracer"; // must come before importing any instrumented module
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable no-console */
|
||||
/* oxlint-disable no-console */
|
||||
import { IncomingMessage } from "http";
|
||||
import chalk from "chalk";
|
||||
import isArray from "lodash/isArray";
|
||||
@@ -27,6 +27,7 @@ type LogCategory =
|
||||
| "utils"
|
||||
| "plugins";
|
||||
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
type Extra = Record<string, any>;
|
||||
|
||||
class Logger {
|
||||
@@ -223,14 +224,17 @@ class Logger {
|
||||
];
|
||||
|
||||
if (level > 3) {
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return "[…]" as any as T;
|
||||
}
|
||||
|
||||
if (isArray(input)) {
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return input.map((item) => this.sanitize(item, level + 1)) as any as T;
|
||||
}
|
||||
|
||||
if (isObject(input)) {
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const output: Record<string, any> = { ...input };
|
||||
|
||||
for (const key of Object.keys(output)) {
|
||||
|
||||
@@ -44,6 +44,7 @@ if (env.SENTRY_DSN) {
|
||||
});
|
||||
}
|
||||
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function requestErrorHandler(error: any, ctx: AppContext) {
|
||||
// we don't need to report every time a request stops to the bug tracker
|
||||
if (error.code === "EPIPE" || error.code === "ECONNRESET") {
|
||||
@@ -81,7 +82,7 @@ export function requestErrorHandler(error: any, ctx: AppContext) {
|
||||
Sentry.captureException(error);
|
||||
});
|
||||
} else if (env.ENVIRONMENT !== "test") {
|
||||
// eslint-disable-next-line no-console
|
||||
// oxlint-disable-next-line no-console
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ export function addTags(tags: Record<string, any>, span?: Span | null): void {
|
||||
export function getRootSpanFromRequestContext(
|
||||
context: PrivateDatadogContext
|
||||
): Span | null {
|
||||
// eslint-disable-next-line no-undef
|
||||
// oxlint-disable-next-line no-undef
|
||||
return context?.req?._datadog?.span ?? null;
|
||||
}
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ const traceClass = (config?: TraceConfig) =>
|
||||
key
|
||||
);
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
// oxlint-disable-next-line no-undef
|
||||
if (typeof key === "string" && typeof descriptor?.value === "function") {
|
||||
Object.defineProperty(
|
||||
constructor.prototype,
|
||||
@@ -170,7 +170,7 @@ const traceClass = (config?: TraceConfig) =>
|
||||
staticKeys.forEach((key) => {
|
||||
const descriptor = Object.getOwnPropertyDescriptor(constructor, key);
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
// oxlint-disable-next-line no-undef
|
||||
if (typeof key === "string" && typeof descriptor?.value === "function") {
|
||||
Object.defineProperty(
|
||||
constructor,
|
||||
@@ -187,7 +187,7 @@ const traceClass = (config?: TraceConfig) =>
|
||||
* @param config Optional configuration for the span that will be created for this trace.
|
||||
*/
|
||||
// Going to rely on inferrence do its thing for this function
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
// oxlint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
export function trace(config?: TraceConfig) {
|
||||
function traceDecorator(target: Constructor): void;
|
||||
function traceDecorator<T>(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable lines-between-class-members */
|
||||
/* oxlint-disable lines-between-class-members */
|
||||
import fractionalIndex from "fractional-index";
|
||||
import find from "lodash/find";
|
||||
import findIndex from "lodash/findIndex";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable lines-between-class-members */
|
||||
/* oxlint-disable lines-between-class-members */
|
||||
import compact from "lodash/compact";
|
||||
import isNil from "lodash/isNil";
|
||||
import uniq from "lodash/uniq";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const Deprecated =
|
||||
(message?: string) => (_target: object, propertyKey: string) => {
|
||||
if (process.env[propertyKey]) {
|
||||
// eslint-disable-next-line no-console
|
||||
// oxlint-disable-next-line no-console
|
||||
console.warn(
|
||||
`The environment variable ${propertyKey} is deprecated and will be removed in a future release. ${message}`
|
||||
);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
/* oxlint-disable @typescript-eslint/no-var-requires */
|
||||
import find from "lodash/find";
|
||||
import { Scope } from "@shared/types";
|
||||
import env from "@server/env";
|
||||
|
||||
+4
-4
@@ -13,7 +13,7 @@ import { requestErrorHandler } from "@server/logging/sentry";
|
||||
let errorHtmlCache: Buffer | undefined;
|
||||
|
||||
export default function onerror(app: Koa) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
app.context.onerror = function (err: any) {
|
||||
// Don't do anything if there is no error, this allows you to pass `this.onerror` to node-style callbacks.
|
||||
if (isNil(err)) {
|
||||
@@ -39,7 +39,7 @@ export default function onerror(app: Koa) {
|
||||
|
||||
if (!(err instanceof InternalError)) {
|
||||
if (env.ENVIRONMENT === "test") {
|
||||
// eslint-disable-next-line no-console
|
||||
// oxlint-disable-next-line no-console
|
||||
console.error(err);
|
||||
}
|
||||
err = InternalError();
|
||||
@@ -82,7 +82,7 @@ export default function onerror(app: Koa) {
|
||||
return app;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function wrapInNativeError(err: any): Error {
|
||||
// When dealing with cross-globals a normal `instanceof` check doesn't work properly.
|
||||
// See https://github.com/koajs/koa/issues/1466
|
||||
@@ -99,7 +99,7 @@ function wrapInNativeError(err: any): Error {
|
||||
if (typeof err === "object") {
|
||||
try {
|
||||
errMsg = JSON.stringify(err);
|
||||
// eslint-disable-next-line no-empty
|
||||
// oxlint-disable-next-line no-empty
|
||||
} catch (_err) {
|
||||
// Ignore
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Import } from "@server/models";
|
||||
import presentUser from "./user";
|
||||
|
||||
export default function presentImport(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
importModel: Import<any>
|
||||
) {
|
||||
return {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Queue } from "bull";
|
||||
import { Second } from "@shared/utils/time";
|
||||
import Logger from "@server/logging/Logger";
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-misused-promises */
|
||||
/* oxlint-disable @typescript-eslint/no-misused-promises */
|
||||
export default class HealthMonitor {
|
||||
/**
|
||||
* Starts a health monitor for the given queue. If the queue stops processing jobs then the
|
||||
|
||||
@@ -11,7 +11,7 @@ export default abstract class BaseProcessor {
|
||||
* @param event processor event
|
||||
* @returns A promise that resolves once the processor handles the failure.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
// oxlint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
public onFailed(event: Event): Promise<void> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
@@ -465,7 +465,7 @@ export default abstract class ImportsProcessor<
|
||||
content: ProsemirrorDoc;
|
||||
attachments: Attachment[];
|
||||
idMap: Record<string, string>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
importInput: Record<string, ImportInput<any>[number]>;
|
||||
actorId: string;
|
||||
}): ProsemirrorDoc {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-misused-promises */
|
||||
/* oxlint-disable @typescript-eslint/no-misused-promises */
|
||||
import Queue from "bull";
|
||||
import snakeCase from "lodash/snakeCase";
|
||||
import { Second } from "@shared/utils/time";
|
||||
|
||||
@@ -51,7 +51,7 @@ export default abstract class BaseTask<T extends Record<string, any>> {
|
||||
* @param props Properties to be used by the task
|
||||
* @returns A promise that resolves once the task handles the failure.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
// oxlint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
public onFailed(props: T): Promise<void> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export default class CleanupOldImportsTask extends BaseTask<Props> {
|
||||
let totalTasksDeleted = 0;
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
await Import.findAllInBatches<Import<any>>(
|
||||
{
|
||||
attributes: ["id"],
|
||||
@@ -44,7 +44,7 @@ export default class CleanupOldImportsTask extends BaseTask<Props> {
|
||||
paranoid: false,
|
||||
},
|
||||
async (imports) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
await ImportTask.findAllInBatches<ImportTask<any>>(
|
||||
{
|
||||
attributes: ["id"],
|
||||
|
||||
@@ -23,7 +23,7 @@ export default class ErrorTimedOutImportsTask extends BaseTask<Props> {
|
||||
const importsErrored: Record<string, boolean> = {};
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
await ImportTask.findAllInBatches<ImportTask<any>>(
|
||||
{
|
||||
where: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-empty-function */
|
||||
/* oxlint-disable @typescript-eslint/no-empty-function */
|
||||
import path from "path";
|
||||
import { FileOperation } from "@server/models";
|
||||
import { buildFileOperation } from "@server/test/factories";
|
||||
|
||||
@@ -126,7 +126,7 @@ describe("#imports.list", () => {
|
||||
expect(body.data.length).toEqual(2);
|
||||
|
||||
const importIds = body.data.map(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(importModel: Import<any>) => importModel.id
|
||||
);
|
||||
expect(importIds).toContain(importOne.id);
|
||||
|
||||
@@ -81,7 +81,7 @@ router.post(
|
||||
|
||||
authorize(user, "listImports", user.team);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const where: WhereOptions<Import<any>> = { teamId: user.teamId };
|
||||
|
||||
if (service) {
|
||||
@@ -89,14 +89,14 @@ router.post(
|
||||
}
|
||||
|
||||
const [imports, total] = await Promise.all([
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
Import.findAll<Import<any>>({
|
||||
where,
|
||||
order: [[sort, direction]],
|
||||
offset: ctx.state.pagination.offset,
|
||||
limit: ctx.state.pagination.limit,
|
||||
}),
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
Import.count<Import<any>>({
|
||||
where,
|
||||
}),
|
||||
|
||||
@@ -18,7 +18,7 @@ const deleteKeys = async (keys: string[]): Promise<void> => {
|
||||
Keys.Total += keys.length;
|
||||
|
||||
const pipeline = redis.pipeline();
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
keys.forEach((key: any) => pipeline.del(key));
|
||||
|
||||
const res = await pipeline.exec();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
if (process.env.NODE_ENV !== "test") {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
// oxlint-disable-next-line @typescript-eslint/no-var-requires
|
||||
require("dotenv").config({
|
||||
silent: true,
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
/* oxlint-disable @typescript-eslint/no-var-requires */
|
||||
|
||||
const exec = require("child_process").execSync;
|
||||
const fs = require("fs");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
/* oxlint-disable @typescript-eslint/no-var-requires */
|
||||
|
||||
const { execSync } = require("child_process");
|
||||
const fs = require("fs");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
/* oxlint-disable @typescript-eslint/no-var-requires */
|
||||
import { Server } from "https";
|
||||
import Koa from "koa";
|
||||
import compress from "koa-compress";
|
||||
|
||||
@@ -143,7 +143,7 @@ export function createMigrationRunner(
|
||||
migrations: {
|
||||
glob,
|
||||
resolve: ({ name, path, context }) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
// oxlint-disable-next-line @typescript-eslint/no-require-imports
|
||||
const migration = require(path as string);
|
||||
return {
|
||||
name,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import http from "http";
|
||||
import { AddressInfo } from "net";
|
||||
import Koa from "koa";
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
// oxlint-disable-next-line no-restricted-imports
|
||||
import nodeFetch from "node-fetch";
|
||||
|
||||
class TestServer {
|
||||
|
||||
@@ -496,7 +496,7 @@ export async function buildFileOperation(
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export async function buildImport(overrides: Partial<Import<any>> = {}) {
|
||||
if (!overrides.teamId) {
|
||||
const team = await buildTeam();
|
||||
@@ -519,7 +519,7 @@ export async function buildImport(overrides: Partial<Import<any>> = {}) {
|
||||
overrides.integrationId = integration.id;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return Import.create<Import<any>>({
|
||||
name: "testImport",
|
||||
service: IntegrationService.Notion,
|
||||
|
||||
+1
-1
@@ -450,7 +450,7 @@ export type OAuthClientEvent = BaseEvent<OAuthClient> & {
|
||||
modelId: string;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type ImportEvent = BaseEvent<Import<any>> & {
|
||||
name:
|
||||
| "imports.create"
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
declare module "fetch-with-proxy" {
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
// oxlint-disable-next-line no-restricted-imports
|
||||
import nodeFetch from "node-fetch";
|
||||
|
||||
export = nodeFetch;
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ declare module "@outlinewiki/koa-passport" {
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { IncomingMessage } from "http";
|
||||
// eslint-disable-next-line
|
||||
// oxlint-disable-next-line
|
||||
import Express from "express";
|
||||
import { Request } from "koa";
|
||||
import { IMiddleware } from "koa-router";
|
||||
|
||||
@@ -425,7 +425,7 @@ MatchBinarySearchTree.prototype = {
|
||||
|
||||
let current = this._root;
|
||||
if (current) {
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
// oxlint-disable-next-line no-constant-condition
|
||||
while (true) {
|
||||
// Determine if the match value should go to the left or right of the current
|
||||
// node.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable no-restricted-imports */
|
||||
/* oxlint-disable no-restricted-imports */
|
||||
import fetchWithProxy from "fetch-with-proxy";
|
||||
import nodeFetch, { RequestInit, Response } from "node-fetch";
|
||||
import { useAgent } from "request-filtering-agent";
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"extends": [
|
||||
"../.eslintrc",
|
||||
"plugin:react/recommended",
|
||||
"plugin:react-hooks/recommended"
|
||||
],
|
||||
"plugins": [
|
||||
"eslint-plugin-react-hooks"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-restricted-imports": ["error", {
|
||||
"patterns": [{
|
||||
"group": ["@shared/*"],
|
||||
"message": "Use relative imports."
|
||||
}, {
|
||||
"allowTypeImports": true,
|
||||
"group": ["~/*"],
|
||||
"message": "Do not reference app code from shared code."
|
||||
}, {
|
||||
"allowTypeImports": true,
|
||||
"group": ["@server/*"],
|
||||
"message": "Do not reference server code from shared code."
|
||||
}]
|
||||
}]
|
||||
},
|
||||
"env": {
|
||||
"jest": true,
|
||||
"browser": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"extends": ["../.oxlintrc.json"],
|
||||
"plugins": ["oxc", "eslint", "typescript", "react"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["**/*.{js,jsx,ts,tsx}"],
|
||||
"rules": {
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{
|
||||
"patterns": [
|
||||
{
|
||||
"group": ["@shared/*"],
|
||||
"message": "Use relative imports."
|
||||
},
|
||||
{
|
||||
"allowTypeImports": true,
|
||||
"group": ["~/*"],
|
||||
"message": "Do not reference app code from shared code."
|
||||
},
|
||||
{
|
||||
"allowTypeImports": true,
|
||||
"group": ["@server/*"],
|
||||
"message": "Do not reference server code from shared code."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"plugins": ["import"]
|
||||
}
|
||||
],
|
||||
"env": {
|
||||
"jest": true,
|
||||
"browser": true,
|
||||
"node": true
|
||||
}
|
||||
}
|
||||
@@ -187,7 +187,7 @@ const insertFiles = async function (
|
||||
.catch((error) => {
|
||||
Sentry.captureException(error);
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
// oxlint-disable-next-line no-console
|
||||
console.error(error);
|
||||
|
||||
if (view.isDestroyed) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable no-irregular-whitespace */
|
||||
/* oxlint-disable no-irregular-whitespace */
|
||||
import { lighten, transparentize } from "polished";
|
||||
import styled, { DefaultTheme, css, keyframes } from "styled-components";
|
||||
import { hover } from "../../styles";
|
||||
|
||||
@@ -41,7 +41,7 @@ async function loadLanguage(language: string) {
|
||||
})
|
||||
.catch((err) => {
|
||||
// It will retry loading the language on the next render
|
||||
// eslint-disable-next-line no-console
|
||||
// oxlint-disable-next-line no-console
|
||||
console.error(
|
||||
`Failed to load language ${language} for code highlighting`,
|
||||
err
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
/* oxlint-disable @typescript-eslint/ban-ts-comment */
|
||||
// @ts-nocheck
|
||||
// https://raw.githubusercontent.com/ProseMirror/prosemirror-markdown/master/src/to_markdown.js
|
||||
// forked for table support
|
||||
@@ -224,7 +224,7 @@ export class MarkdownSerializerState {
|
||||
return info && info.expelEnclosingWhitespace;
|
||||
})
|
||||
) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
||||
// oxlint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
||||
const [, lead, inner, trail] = /^(\s*)(.*?)(\s*)$/m.exec(node.text);
|
||||
leading += lead;
|
||||
trailing = trail;
|
||||
|
||||
@@ -30,7 +30,7 @@ const uploadPlaceholder = new Plugin({
|
||||
simplifyDiff: true,
|
||||
}).mapping;
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
// oxlint-disable-next-line no-console
|
||||
console.warn("Failed to recreate transform: ", err);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ function parseMentions(state: StateCore) {
|
||||
precToken.content = precToken.content.slice(0, -1);
|
||||
|
||||
// href must be present, otherwise the hrefRE test in canChunkComposeMentionToken would've failed
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
// oxlint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
const href = openToken.attrs![0][1];
|
||||
const matches = href.match(hrefRE);
|
||||
const [id, mType, mId] = matches!.slice(1);
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable no-control-regex */
|
||||
/* oxlint-disable no-control-regex */
|
||||
|
||||
/**
|
||||
* Helper class for CSV operations.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable import/no-duplicates */
|
||||
/* oxlint-disable import/no-duplicates */
|
||||
import {
|
||||
Locale,
|
||||
addSeconds,
|
||||
|
||||
@@ -47,7 +47,7 @@ const isFlagEmojiSupported = (): boolean => {
|
||||
let i = 0;
|
||||
|
||||
// Search the first visible pixel
|
||||
// eslint-disable-next-line curly
|
||||
// oxlint-disable-next-line curly
|
||||
for (; i < count && !a[i + 3]; i += 4);
|
||||
|
||||
// No visible pixel
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
const ltrChars =
|
||||
"A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF";
|
||||
const rtlChars = "\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC";
|
||||
// eslint-disable-next-line no-misleading-character-class
|
||||
// oxlint-disable-next-line no-misleading-character-class
|
||||
const rtlDirCheck = new RegExp("^[^" + ltrChars + "]*[" + rtlChars + "]");
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ if (environment.NODE_ENV === "development") {
|
||||
cert: fs.readFileSync("./server/config/certs/public.cert"),
|
||||
};
|
||||
} catch (_err) {
|
||||
// eslint-disable-next-line no-console
|
||||
// oxlint-disable-next-line no-console
|
||||
console.warn("No local SSL certs found, HTTPS will not be available");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user