Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue/ESLint: add @typescript-eslint/consistent-type-imports rule #11296

Merged
merged 1 commit into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ private Consumer<JHipsterModuleBuilder> patchEslintConfig(JHipsterModuleProperti
.add(eslintTypescriptVueRule("'vue/html-self-closing': 'off',", properties.indentation()))
.add(eslintTypescriptVueRule("'@typescript-eslint/no-explicit-any': 'off',", properties.indentation()))
.add(eslintTypescriptVueRule("'@typescript-eslint/no-empty-object-type': 'off',", properties.indentation()))
.add(eslintTypescriptVueRule("'@typescript-eslint/consistent-type-imports': 'error',", properties.indentation()))
.and()
.and();
//@formatter:on
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HttpResponseInterceptor, RouteMatcher, StaticResponse } from 'cypress/types/net-stubbing';
import type { HttpResponseInterceptor, RouteMatcher, StaticResponse } from 'cypress/types/net-stubbing';

type ResponseSender = {
send: () => void;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Page } from '@playwright/test';
import { type Page } from '@playwright/test';

export class HomePage {
readonly page: Page;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ Location: `src/test/webapp/unit/auth/infrastructure/secondary/KeycloakStub.ts`
This file provides a stub for Keycloak to be used in tests.

```typescript
import Keycloak from 'keycloak-js';
import type Keycloak from 'keycloak-js';
import sinon from 'sinon';
import type { SinonStub } from 'sinon';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import HomepageVue from '@/home/infrastructure/primary/HomepageVue.vue';
import { shallowMount, VueWrapper } from '@vue/test-utils';
import { shallowMount, type VueWrapper } from '@vue/test-utils';
import { describe, expect, it } from 'vitest';

let wrapper: VueWrapper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AuthRepository } from '@/auth/domain/AuthRepository';
import { KeycloakAuthRepository } from '@/auth/infrastructure/secondary/KeycloakAuthRepository';
import { KeycloakHttp } from '@/auth/infrastructure/secondary/KeycloakHttp';
import { type KeycloakHttp } from '@/auth/infrastructure/secondary/KeycloakHttp';
import { provide } from '@/injections';
import { key } from 'piqure';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AuthRepository } from '@/auth/domain/AuthRepository';
import type { AuthenticatedUser } from '@/auth/domain/AuthenticatedUser';
import { KeycloakHttp } from './KeycloakHttp';
import { type KeycloakHttp } from './KeycloakHttp';

export class KeycloakAuthRepository implements AuthRepository {
constructor(private readonly keycloakHttp: KeycloakHttp) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AuthenticatedUser } from '@/auth/domain/AuthenticatedUser';
import Keycloak from 'keycloak-js';
import type Keycloak from 'keycloak-js';

export class KeycloakHttp {
private initialized: boolean = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Keycloak from 'keycloak-js';
import type Keycloak from 'keycloak-js';
import type { SinonStub } from 'sinon';
import sinon from 'sinon';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="vite/client" />

declare module '*.vue' {
import { DefineComponent } from 'vue';
import type DefineComponent from 'vue';
const component: DefineComponent<{}, {}, any>;
export default component;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import HomepageVue from '@/home/infrastructure/primary/HomepageVue.vue';
import { routes } from '@/router';
import { mount, VueWrapper } from '@vue/test-utils';
import { mount, type VueWrapper } from '@vue/test-utils';
import { beforeEach, describe, expect, it } from 'vitest';
import { createRouter, createWebHistory, type Router } from 'vue-router';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import HomepageVue from '@/home/infrastructure/primary/HomepageVue.vue';
import { shallowMount, VueWrapper } from '@vue/test-utils';
import { shallowMount, type VueWrapper } from '@vue/test-utils';
import { describe, expect, it } from 'vitest';

let wrapper: VueWrapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default typescript.config(
},
rules: {
quotes: ['error', 'single', { avoidEscape: true }],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'vue/html-self-closing': 'off',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AppVue } from '@/root/infrastructure/primary';
import { shallowMount, VueWrapper } from '@vue/test-utils';
import { shallowMount, type VueWrapper } from '@vue/test-utils';
import { describe, expect, it } from 'vitest';

let wrapper: VueWrapper;
Expand Down
Loading