(lint) activate import/consistent-type-specifier-style for consistency of import type

This commit is contained in:
Valentyne Stigloher 2025-05-18 18:23:09 +02:00
parent 859522f98e
commit 2bafc81c3a
14 changed files with 32 additions and 22 deletions

View File

@ -1,12 +1,8 @@
<script setup lang="ts">
import { loadGrammarTableVariantsConverter } from '~/src/data.ts';
import type { Example, ExampleValues } from '~/src/language/examples.ts';
import {
type GrammarTableDefinition,
type Variant,
type SectionDefinition,
expandVariantsForSection,
} from '~/src/language/grammarTables.ts';
import { expandVariantsForSection } from '~/src/language/grammarTables.ts';
import type { GrammarTableDefinition, Variant, SectionDefinition } from '~/src/language/grammarTables.ts';
const props = defineProps<{
grammarTable: GrammarTableDefinition;

View File

@ -1,5 +1,6 @@
<script setup lang="ts">
import opinions, { type Opinion } from '~/src/opinions.ts';
import opinions from '~/src/opinions.ts';
import type { Opinion } from '~/src/opinions.ts';
const props = withDefaults(defineProps<{
word: string;

View File

@ -1,5 +1,6 @@
<script setup lang="ts">
import { type Gender, iconNamesByGender, longIdentifierByGender } from '~/src/nouns.ts';
import { iconNamesByGender, longIdentifierByGender } from '~/src/nouns.ts';
import type { Gender } from '~/src/nouns.ts';
const props = defineProps<{
gender: Gender;

View File

@ -141,9 +141,10 @@ export default withNuxt(
})
.override('nuxt/import/rules', {
rules: {
'import/consistent-type-specifier-style': ['warn', 'prefer-top-level'],
'import/extensions': ['error', 'ignorePackages'],
'import/no-useless-path-segments': 'error',
'import/order': ['error', {
'import/no-useless-path-segments': 'warn',
'import/order': ['warn', {
'newlines-between': 'always',
'alphabetize': { order: 'asc', orderImportKind: 'desc' },
}],

View File

@ -4,7 +4,8 @@ import { useNuxtApp } from 'nuxt/app';
import NounsNav from './NounsNav.vue';
import useConfig from '~/composables/useConfig.ts';
import { Noun, type Source, SourceLibrary } from '~/src/classes.ts';
import { Noun, SourceLibrary } from '~/src/classes.ts';
import type { Source } from '~/src/classes.ts';
const { $translator: translator } = useNuxtApp();
useSimpleHead({

View File

@ -2,8 +2,10 @@
import { useDebounce, useLocalStorage } from '@vueuse/core';
import marked from 'marked';
import { extractMetadata, type Post } from '~/src/blog/metadata.ts';
import parseMarkdown, { type MarkdownInfo } from '~/src/parseMarkdown.ts';
import { extractMetadata } from '~/src/blog/metadata.ts';
import type { Post } from '~/src/blog/metadata.ts';
import parseMarkdown from '~/src/parseMarkdown.ts';
import type { MarkdownInfo } from '~/src/parseMarkdown.ts';
const content = useLocalStorage(
'admin/blog/editor',

View File

@ -12,8 +12,8 @@ import {
MONTHS as months,
AREAS as areas,
TRANSFER_METHODS as transferMethods,
type TimesheetData, type Timesheet,
} from '~/src/timesheets.ts';
import type { TimesheetData, Timesheet } from '~/src/timesheets.ts';
const { $translator: translator } = useNuxtApp();
const dialogue = useDialogue();

View File

@ -1,9 +1,11 @@
<script setup lang="ts">
import { DateTime, type DurationInput } from 'luxon';
import { DateTime } from 'luxon';
import type { DurationInput } from 'luxon';
import { useNuxtApp } from 'nuxt/app';
import useSimpleHead from '~/composables/useSimpleHead.ts';
import { min, max, MONTHS, PERIODS, type TimesheetData } from '~/src/timesheets.ts';
import { min, max, MONTHS, PERIODS } from '~/src/timesheets.ts';
import type { TimesheetData } from '~/src/timesheets.ts';
function* range(start: number, end: number) {
for (let i = start; i <= end; i++) {

View File

@ -12,7 +12,8 @@ import { getUrlForLocale } from '~/src/domain.ts';
import { buildFlags } from '~/src/flags.ts';
import { sleep } from '~/src/helpers.ts';
import opinions from '~/src/opinions.ts';
import { applyProfileVisibilityRules, type UserWithProfiles, type Profile } from '~/src/profile.ts';
import { applyProfileVisibilityRules } from '~/src/profile.ts';
import type { UserWithProfiles, Profile } from '~/src/profile.ts';
definePageMeta({
translatedPaths: (config) => {

View File

@ -22,7 +22,8 @@ import forbidden from '~/src/forbidden.ts';
import { clearLinkedText, buildImageUrl } from '~/src/helpers.ts';
import { genders, gendersWithNumerus } from '~/src/nouns.ts';
import parseMarkdown from '~/src/parseMarkdown.ts';
import { normaliseQuery, type SearchDocument, validateQuery } from '~/src/search.ts';
import { normaliseQuery, validateQuery } from '~/src/search.ts';
import type { SearchDocument } from '~/src/search.ts';
interface SearchKind {
kind: SearchDocument['kind'];

View File

@ -1,4 +1,5 @@
import { type Config, type ConfigWithEnabled, isEnabled } from '../locale/config.ts';
import { isEnabled } from '../locale/config.ts';
import type { Config, ConfigWithEnabled } from '../locale/config.ts';
import type { PronounData, PronounGroupData } from '../locale/data.ts';
import { Pronoun, PronounGroup } from './classes.ts';

View File

@ -1,5 +1,6 @@
import type { ExampleValues } from '~/src/language/examples.ts';
import { type MorphemeValue, toMorphemeValue } from '~/src/language/morphemes.ts';
import { toMorphemeValue } from '~/src/language/morphemes.ts';
import type { MorphemeValue } from '~/src/language/morphemes.ts';
export type GrammarTablesDefinition = (GrammarTableDefinition | string)[]
| { simple: (GrammarTableDefinition | string)[]; comprehensive: (GrammarTableDefinition | string)[] };

View File

@ -8,7 +8,8 @@ import { loadSuml, loadTsv } from '~/server/loader.ts';
import { normaliseKey } from '~/src/buildPronoun.ts';
import { Example } from '~/src/language/examples.ts';
import type { VariantsFromBaseConverter } from '~/src/language/grammarTables.ts';
import { availableGenders, gendersWithNumerus, type NounConventions } from '~/src/nouns.ts';
import { availableGenders, gendersWithNumerus } from '~/src/nouns.ts';
import type { NounConventions } from '~/src/nouns.ts';
function toHaveValidMorphemes(actual: string, morphemes: string[]): SyncExpectationResult {
const containedMorphemes = Example.parse(actual).parts

View File

@ -5,7 +5,8 @@ import { promisify } from 'util';
import { chromium } from '@playwright/test';
import type { Browser, Page } from '@playwright/test';
import { execa, type ResultPromise } from 'execa';
import { execa } from 'execa';
import type { ResultPromise } from 'execa';
import tkKill from 'tree-kill';
import { describe, it, beforeAll, afterAll, expect } from 'vitest';
import { createRouter, createMemoryHistory } from 'vue-router';