chore: Setup missing oxlint configs (#9862)

* shared

* server

* app

* remove vestigial eslintrc files

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