mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	Update eslint to v9 (#35485)
Update eslint and all plugins. Many plugins still do not ship type definitions so I had to add stubs. Also, I had to put a few typescript error expectations because if some unknown error in the types. `eslint-plugin-no-jquery` is disabled because it's not compatible with eslint 9 flat config (https://github.com/wikimedia/eslint-plugin-no-jquery/issues/311).
This commit is contained in:
		@@ -15,7 +15,7 @@ export type DiffTreeEntry = {
 | 
			
		||||
  Children: DiffTreeEntry[],
 | 
			
		||||
  FileIcon: string,
 | 
			
		||||
  ParentEntry?: DiffTreeEntry,
 | 
			
		||||
}
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
type DiffFileTreeData = {
 | 
			
		||||
  TreeRoot: DiffTreeEntry,
 | 
			
		||||
@@ -28,7 +28,7 @@ type DiffFileTree = {
 | 
			
		||||
  fullNameMap?: Record<string, DiffTreeEntry>
 | 
			
		||||
  fileTreeIsVisible: boolean;
 | 
			
		||||
  selectedItem: string;
 | 
			
		||||
}
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
let diffTreeStoreReactive: Reactive<DiffFileTree>;
 | 
			
		||||
export function diffTreeStore() {
 | 
			
		||||
 
 | 
			
		||||
@@ -14,5 +14,4 @@ export function linkLabelAndInput(label: Element, input: Element) {
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// eslint-disable-next-line no-jquery/variable-pattern
 | 
			
		||||
export const fomanticQuery = $;
 | 
			
		||||
 
 | 
			
		||||
@@ -348,7 +348,7 @@ export function hideScopedEmptyDividers(container: Element) {
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function onResponseKeepSelectedItem(dropdown: typeof $|HTMLElement, selectedValue: string) {
 | 
			
		||||
function onResponseKeepSelectedItem(dropdown: typeof $ | HTMLElement, selectedValue: string) {
 | 
			
		||||
  // There is a bug in fomantic dropdown when using "apiSettings" to fetch data
 | 
			
		||||
  // * when there is a selected item, the dropdown insists on hiding the selected one from the list:
 | 
			
		||||
  // * in the "filter" function: ('[data-value="'+value+'"]').addClass(className.filtered)
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ type ToastLevels = {
 | 
			
		||||
    background: string,
 | 
			
		||||
    duration: number,
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const levels: ToastLevels = {
 | 
			
		||||
  info: {
 | 
			
		||||
@@ -40,7 +40,7 @@ type ToastOpts = {
 | 
			
		||||
  preventDuplicates?: boolean | string,
 | 
			
		||||
} & Options;
 | 
			
		||||
 | 
			
		||||
type ToastifyElement = HTMLElement & {_giteaToastifyInstance?: Toast };
 | 
			
		||||
type ToastifyElement = HTMLElement & {_giteaToastifyInstance?: Toast};
 | 
			
		||||
 | 
			
		||||
/** See https://github.com/apvarun/toastify-js#api for options */
 | 
			
		||||
function showToast(message: string, level: Intent, {gravity, position, duration, useHtmlBody, preventDuplicates = true, ...other}: ToastOpts = {}): Toast {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user