mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-08 13:52:02 +00:00
Merge pull request #19816 from overleaf/jpa-type-tweaks
[web] minor typescript tweaks GitOrigin-RevId: df459d2c00652a3d183cae123f39a01dd17c7ec6
This commit is contained in:
parent
a278e70b27
commit
d2464abc7c
6 changed files with 11 additions and 8 deletions
services/web
.eslintrc.jsMakefilepackage.json
frontend/js/features
ide-react/connection
source-editor/context/review-panel/types
types
|
@ -33,6 +33,12 @@ module.exports = {
|
|||
'@typescript-eslint/no-this-alias': 'off',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
|
||||
'no-use-before-define': 'off',
|
||||
'@typescript-eslint/no-use-before-define': [
|
||||
'error',
|
||||
{ functions: false, classes: false, variables: false },
|
||||
],
|
||||
},
|
||||
overrides: [
|
||||
// NOTE: changing paths may require updating them in the Makefile too.
|
||||
|
|
|
@ -429,11 +429,11 @@ lint_overleafModuleImports:
|
|||
|
||||
lint: typecheck_frontend
|
||||
typecheck_frontend:
|
||||
npx -p typescript tsc --noEmit
|
||||
npm run --silent type-check
|
||||
|
||||
lint: typecheck_backend
|
||||
typecheck_backend:
|
||||
npx -p typescript tsc -p tsconfig.backend.json --noEmit
|
||||
npm run --silent type-check:backend
|
||||
|
||||
lint_in_docker:
|
||||
$(RUN_LINT_FORMAT) make lint -j2 --output-sync
|
||||
|
|
|
@ -148,7 +148,6 @@ class Reporter {
|
|||
export default class EditorWatchdogManager {
|
||||
lastAck: number | null = null
|
||||
reporter: Reporter
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
parent?: EditorWatchdogManager
|
||||
scope: Scope
|
||||
timeout: number
|
||||
|
|
|
@ -12,7 +12,6 @@ import { DocId } from '../../../../../../../types/project-settings'
|
|||
import { dispatchReviewPanelLayout } from '../../../extensions/changes/change-manager'
|
||||
import { UserId } from '../../../../../../../types/user'
|
||||
|
||||
/* eslint-disable no-use-before-define */
|
||||
export interface ReviewPanelState {
|
||||
values: {
|
||||
collapsed: Record<DocId, boolean>
|
||||
|
@ -97,8 +96,6 @@ export interface ReviewPanelState {
|
|||
}
|
||||
}
|
||||
|
||||
/* eslint-enable no-use-before-define */
|
||||
|
||||
// Getter for values
|
||||
export type Value<T extends keyof ReviewPanelState['values']> =
|
||||
ReviewPanelState['values'][T]
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
"lint:styles": "stylelint '**/*.scss'",
|
||||
"lint:styles:fix": "stylelint '**/*.scss' --fix",
|
||||
"type-check": "tsc --noEmit",
|
||||
"type-check:backend": "tsc -p tsconfig.backend.json --noEmit",
|
||||
"extract-translations": "i18next-scanner",
|
||||
"migrations": "MONGO_SOCKET_TIMEOUT=0 east",
|
||||
"convert-themes": "node frontend/js/features/source-editor/themes/scripts/convert.js",
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
export type Nullable<T> = T | null
|
||||
|
||||
// eslint-disable-next-line no-use-before-define, @typescript-eslint/no-empty-interface
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
interface DeepReadonlyArray<T> extends ReadonlyArray<DeepReadonly<T>> {}
|
||||
|
||||
type DeepReadonlyObject<T> = {
|
||||
readonly [P in keyof T]: DeepReadonly<T[P]> // eslint-disable-line no-use-before-define
|
||||
readonly [P in keyof T]: DeepReadonly<T[P]>
|
||||
}
|
||||
|
||||
export type DeepReadonly<T> = T extends (infer R)[]
|
||||
|
|
Loading…
Add table
Reference in a new issue