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 eslint from '@eslint/js'
import tseslint from 'typescript-eslint' import tseslint from 'typescript-eslint'
import prettierEslint from 'eslint-plugin-prettier/recommended' import prettierEslint from 'eslint-plugin-prettier/recommended'
import simpleImportSort from 'eslint-plugin-simple-import-sort'
export default tseslint.config( export default tseslint.config(
eslint.configs.recommended, eslint.configs.recommended,
tseslint.configs.recommendedTypeChecked, tseslint.configs.recommendedTypeChecked,
prettierEslint, prettierEslint,
...common,
{ {
languageOptions: { languageOptions: {
parserOptions: { parserOptions: {
@ -17,24 +17,4 @@ export default tseslint.config(
{ {
ignores: ['node_modules/', 'dist/', 'build/'], 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 { createConfigForNuxt } from '@nuxt/eslint-config/flat'
import { fixupPluginRules } from '@eslint/compat' import { fixupPluginRules } from '@eslint/compat'
import turboPlugin from 'eslint-plugin-turbo' import turboPlugin from 'eslint-plugin-turbo'
import simpleImportSort from 'eslint-plugin-simple-import-sort' import common from './common.mjs'
export const configurationNuxtToAppend = [ export const configurationNuxtToAppend = [
...common,
{ {
name: 'turbo', name: 'turbo',
plugins: { 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) export default createConfigForNuxt().append(configurationNuxtToAppend)

View File

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

View File

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

View File

@ -1,20 +1,21 @@
import hljs from 'highlight.js/lib/core' 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 // Configs
import gradle from 'highlight.js/lib/languages/gradle' 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 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 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 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 xml from 'highlight.js/lib/languages/xml'
import yaml from 'highlight.js/lib/languages/yaml' import yaml from 'highlight.js/lib/languages/yaml'
import { configuredXss, md } from './parse' import { configuredXss, md } from './parse'
/* REGISTRATION */ /* REGISTRATION */

View File

@ -4,8 +4,8 @@ export * from './highlight'
export * from './licenses' export * from './licenses'
export * from './parse' export * from './parse'
export * from './projects' export * from './projects'
export * from './servers'
export * from './three/skin-rendering'
export * from './types' export * from './types'
export * from './users' export * from './users'
export * from './utils' 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-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 { FetchError } from 'ofetch'
import { V1ErrorInfo } from '../types'
import type { V1ErrorInfo } from '../types'
export class ModrinthServerError extends Error { export class ModrinthServerError extends Error {
constructor( constructor(

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,8 +1,8 @@
export * from './api' export * from './api'
export * from './content'
export * from './server'
export * from './backup' export * from './backup'
export * from './filesystem'
export * from './websocket'
export * from './stats'
export * from './common' 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 { ServerState } from './server'
import type { Stats } from './stats'
export interface WSAuth { export interface WSAuth {
url: string url: string

View File

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