chore: fix util lint issues

This commit is contained in:
Calum H. (IMB11) 2025-08-01 15:15:42 +01:00 committed by Calum H.
parent 75b00bec3d
commit e7f940daa1
18 changed files with 63 additions and 74 deletions

View File

@ -0,0 +1,4 @@
{
"endOfLine": "auto",
"plugins": ["prettier-plugin-tailwindcss"]
}

View File

@ -1,12 +1,12 @@
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import prettierEslint from 'eslint-plugin-prettier/recommended'
import simpleImportSort from 'eslint-plugin-simple-import-sort'
export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.recommendedTypeChecked,
prettierEslint,
...common,
{
languageOptions: {
parserOptions: {
@ -17,24 +17,4 @@ export default tseslint.config(
{
ignores: ['node_modules/', 'dist/', 'build/'],
},
{
plugins: {
'simple-import-sort': simpleImportSort,
},
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
},
{
rules: {
'@typescript-eslint/no-type-alias': [
'error',
{
allowGenerics: 'always',
},
],
'@typescript-eslint/ban-ts-comment': 'off',
},
},
)

View File

@ -0,0 +1,20 @@
import simpleImportSort from 'eslint-plugin-simple-import-sort'
export default [
{
plugins: {
'simple-import-sort': simpleImportSort,
},
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
},
{
rules: {
'@typescript-eslint/no-type-alias': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/prefer-literal-enum-member': 'off',
},
},
]

View File

@ -1,9 +1,10 @@
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'
import { fixupPluginRules } from '@eslint/compat'
import turboPlugin from 'eslint-plugin-turbo'
import simpleImportSort from 'eslint-plugin-simple-import-sort'
import common from './common.mjs'
export const configurationNuxtToAppend = [
...common,
{
name: 'turbo',
plugins: {
@ -25,20 +26,6 @@ export const configurationNuxtToAppend = [
},
},
},
{
plugins: {
'simple-import-sort': simpleImportSort,
},
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
},
{
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
},
},
]
export default createConfigForNuxt().append(configurationNuxtToAppend)

View File

@ -1,4 +1,3 @@
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
export const getCurrency = (userCountry) => {

View File

@ -1,11 +1,10 @@
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
import { insertNewlineAndIndent } from '@codemirror/commands'
import { deleteMarkupBackward } from '@codemirror/lang-markdown'
import { getIndentation, indentString, syntaxTree } from '@codemirror/language'
import { type EditorState, type Transaction } from '@codemirror/state'
import { type EditorView, type Command, type KeyBinding } from '@codemirror/view'
import type { EditorState, Transaction } from '@codemirror/state'
import type { Command, EditorView, KeyBinding } from '@codemirror/view'
const toggleBold: Command = ({ state, dispatch }) => {
return toggleAround(state, dispatch, '**', '**')

View File

@ -1,20 +1,21 @@
import hljs from 'highlight.js/lib/core'
// Scripting
import javascript from 'highlight.js/lib/languages/javascript'
import lua from 'highlight.js/lib/languages/lua'
import python from 'highlight.js/lib/languages/python'
// Coding
import groovy from 'highlight.js/lib/languages/groovy'
import java from 'highlight.js/lib/languages/java'
import kotlin from 'highlight.js/lib/languages/kotlin'
import scala from 'highlight.js/lib/languages/scala'
// Configs
import gradle from 'highlight.js/lib/languages/gradle'
// Coding
import groovy from 'highlight.js/lib/languages/groovy'
import ini from 'highlight.js/lib/languages/ini'
import java from 'highlight.js/lib/languages/java'
// Scripting
import javascript from 'highlight.js/lib/languages/javascript'
import json from 'highlight.js/lib/languages/json'
import kotlin from 'highlight.js/lib/languages/kotlin'
import lua from 'highlight.js/lib/languages/lua'
import properties from 'highlight.js/lib/languages/properties'
import python from 'highlight.js/lib/languages/python'
import scala from 'highlight.js/lib/languages/scala'
import xml from 'highlight.js/lib/languages/xml'
import yaml from 'highlight.js/lib/languages/yaml'
import { configuredXss, md } from './parse'
/* REGISTRATION */

View File

@ -4,8 +4,8 @@ export * from './highlight'
export * from './licenses'
export * from './parse'
export * from './projects'
export * from './servers'
export * from './three/skin-rendering'
export * from './types'
export * from './users'
export * from './utils'
export * from './servers'
export * from './three/skin-rendering'

View File

@ -1,3 +1,3 @@
export * from './modrinth-servers-multi-error'
export * from './modrinth-servers-fetch-error'
export * from './modrinth-server-error'
export * from './modrinth-servers-fetch-error'
export * from './modrinth-servers-multi-error'

View File

@ -1,5 +1,6 @@
import { FetchError } from 'ofetch'
import { V1ErrorInfo } from '../types'
import type { V1ErrorInfo } from '../types'
export class ModrinthServerError extends Error {
constructor(

View File

@ -17,11 +17,9 @@ export class ModrinthServersMultiError extends Error {
}
private buildErrorMessage(): string {
return (
Array.from(this.errors.entries())
// eslint-disable-next-line @typescript-eslint/no-unused-vars
.map(([_module, error]) => error.message)
.join('\n')
)
return Array.from(this.errors.entries())
.map(([_module, error]) => error.message)
.join('\n')
}
}

View File

@ -1,4 +1,4 @@
import { ModrinthServerError } from '../errors'
import type { ModrinthServerError } from '../errors'
export interface V1ErrorInfo {
context?: string

View File

@ -1,4 +1,4 @@
import type { WSBackupTask, WSBackupState } from './websocket'
import type { WSBackupState, WSBackupTask } from './websocket'
export interface Backup {
id: string

View File

@ -1,7 +1,7 @@
import type { Project } from '../../types'
import { Allocation } from './server'
import { ServerBackup } from './backup'
import { Mod } from './content'
import type { ServerBackup } from './backup'
import type { Mod } from './content'
import type { Allocation } from './server'
export type ServerNotice = {
id: number

View File

@ -1,5 +1,5 @@
import type { FSQueuedOp, FilesystemOp } from './websocket'
import { JWTAuth } from './api'
import type { JWTAuth } from './api'
import type { FilesystemOp, FSQueuedOp } from './websocket'
export interface DirectoryItem {
name: string

View File

@ -1,8 +1,8 @@
export * from './api'
export * from './content'
export * from './server'
export * from './backup'
export * from './filesystem'
export * from './websocket'
export * from './stats'
export * from './common'
export * from './content'
export * from './filesystem'
export * from './server'
export * from './stats'
export * from './websocket'

View File

@ -1,5 +1,5 @@
import type { Stats } from './stats'
import type { ServerState } from './server'
import type { Stats } from './stats'
export interface WSAuth {
url: string

View File

@ -1,5 +1,5 @@
// noinspection JSUnusedGlobalSymbols
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
import dayjs from 'dayjs'