Skip to content

Commit f87e73e

Browse files
committed
Do not split type and value imports in Angular
1 parent c854fe6 commit f87e73e

File tree

80 files changed

+179
-187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+179
-187
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
rules: {
3+
'@typescript-eslint/consistent-type-imports': [
4+
'error',
5+
{ prefer: 'no-type-imports', disallowTypeAnnotations: false },
6+
],
7+
},
8+
};

code/frameworks/angular/src/builders/build-storybook/index.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1-
import type { BuilderContext, BuilderOutput, Target } from '@angular-devkit/architect';
2-
import { createBuilder, targetFromTargetString } from '@angular-devkit/architect';
3-
import type { JsonObject } from '@angular-devkit/core';
4-
import type { Observable } from 'rxjs';
5-
import { from, of, throwError } from 'rxjs';
6-
import type { CLIOptions } from '@storybook/types';
1+
import {
2+
BuilderContext,
3+
BuilderOutput,
4+
Target,
5+
createBuilder,
6+
targetFromTargetString,
7+
} from '@angular-devkit/architect';
8+
import { JsonObject } from '@angular-devkit/core';
9+
import { Observable, from, of, throwError } from 'rxjs';
10+
import { CLIOptions } from '@storybook/types';
711
import { catchError, map, mapTo, switchMap } from 'rxjs/operators';
812
import { sync as findUpSync } from 'find-up';
913
import { sync as readUpSync } from 'read-pkg-up';
10-
import type {
14+
import {
1115
BrowserBuilderOptions,
1216
ExtraEntryPoint,
1317
StylePreprocessorOptions,
1418
} from '@angular-devkit/build-angular';
1519

1620
import { buildStaticStandalone } from '@storybook/core-server';
17-
import type { StandaloneOptions } from '../utils/standalone-options';
21+
import { StandaloneOptions } from '../utils/standalone-options';
1822
import { runCompodoc } from '../utils/run-compodoc';
1923
import { buildStandaloneErrorHandler } from '../utils/build-standalone-errors-handler';
2024

code/frameworks/angular/src/builders/start-storybook/index.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
1-
import type { BuilderContext, BuilderOutput, Target } from '@angular-devkit/architect';
2-
import { createBuilder, targetFromTargetString } from '@angular-devkit/architect';
3-
import type { JsonObject } from '@angular-devkit/core';
4-
import type {
1+
import {
2+
BuilderContext,
3+
BuilderOutput,
4+
Target,
5+
createBuilder,
6+
targetFromTargetString,
7+
} from '@angular-devkit/architect';
8+
import { JsonObject } from '@angular-devkit/core';
9+
import {
510
BrowserBuilderOptions,
611
ExtraEntryPoint,
712
StylePreprocessorOptions,
813
} from '@angular-devkit/build-angular';
914
import { from, Observable, of } from 'rxjs';
10-
import type { CLIOptions } from '@storybook/types';
15+
import { CLIOptions } from '@storybook/types';
1116
import { map, switchMap, mapTo } from 'rxjs/operators';
1217
import { sync as findUpSync } from 'find-up';
1318
import { sync as readUpSync } from 'read-pkg-up';
1419

1520
import { buildDevStandalone } from '@storybook/core-server';
16-
import type { StandaloneOptions } from '../utils/standalone-options';
21+
import { StandaloneOptions } from '../utils/standalone-options';
1722
import { runCompodoc } from '../utils/run-compodoc';
1823
import { buildStandaloneErrorHandler } from '../utils/build-standalone-errors-handler';
1924

code/frameworks/angular/src/builders/utils/run-compodoc.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { BuilderContext } from '@angular-devkit/architect';
2-
import type { LoggerApi } from '@angular-devkit/core/src/logger';
1+
import { BuilderContext } from '@angular-devkit/architect';
2+
import { LoggerApi } from '@angular-devkit/core/src/logger';
33
import { take } from 'rxjs/operators';
44

55
const cpSpawnMock = {

code/frameworks/angular/src/builders/utils/run-compodoc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { BuilderContext } from '@angular-devkit/architect';
1+
import { BuilderContext } from '@angular-devkit/architect';
22
import { spawn } from 'child_process';
33
import { Observable } from 'rxjs';
44
import * as path from 'path';

code/frameworks/angular/src/builders/utils/standalone-options.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { BuilderContext } from '@angular-devkit/architect';
2-
import type { LoadOptions, CLIOptions, BuilderOptions } from '@storybook/types';
1+
import { BuilderContext } from '@angular-devkit/architect';
2+
import { LoadOptions, CLIOptions, BuilderOptions } from '@storybook/types';
33

44
export type StandaloneOptions = Partial<
55
CLIOptions &

code/frameworks/angular/src/client/angular-beta/AbstractRenderer.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import type { NgModule, PlatformRef } from '@angular/core';
2-
import { enableProdMode } from '@angular/core';
1+
import { NgModule, PlatformRef, enableProdMode } from '@angular/core';
32
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
43

5-
import type { Subject } from 'rxjs';
6-
import { BehaviorSubject } from 'rxjs';
4+
import { Subject, BehaviorSubject } from 'rxjs';
75
import { stringify } from 'telejson';
8-
import type { ICollection, StoryFnAngularReturnType, Parameters } from '../types';
6+
import { ICollection, StoryFnAngularReturnType, Parameters } from '../types';
97
import { createStorybookModule, getStorybookModuleMetadata } from './StorybookModule';
108

119
type StoryRenderInfo = {

code/frameworks/angular/src/client/angular-beta/CanvasRenderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AbstractRenderer } from './AbstractRenderer';
2-
import type { StoryFnAngularReturnType, Parameters } from '../types';
2+
import { StoryFnAngularReturnType, Parameters } from '../types';
33

44
export class CanvasRenderer extends AbstractRenderer {
55
public async render(options: {

code/frameworks/angular/src/client/angular-beta/ComputesTemplateFromComponent.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { Component } from '@angular/core';
2-
import type { API_ArgTypes } from '@storybook/types';
2+
import { API_ArgTypes } from '@storybook/types';
33
import { computesTemplateSourceFromComponent } from './ComputesTemplateFromComponent';
4-
import type { ISomeInterface } from './__testfixtures__/input.component';
5-
import { ButtonAccent, InputComponent } from './__testfixtures__/input.component';
4+
import { ISomeInterface, ButtonAccent, InputComponent } from './__testfixtures__/input.component';
65

76
describe('angular source decorator', () => {
87
it('With no props should generate simple tag', () => {

code/frameworks/angular/src/client/angular-beta/ComputesTemplateFromComponent.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import type { Type } from '@angular/core';
2-
import type { API_ArgType, API_ArgTypes } from '@storybook/types';
3-
import type { ICollection } from '../types';
4-
import type { ComponentInputsOutputs } from './utils/NgComponentAnalyzer';
1+
import { Type } from '@angular/core';
2+
import { API_ArgType, API_ArgTypes } from '@storybook/types';
3+
import { ICollection } from '../types';
54
import {
5+
ComponentInputsOutputs,
66
getComponentDecoratorMetadata,
77
getComponentInputsOutputs,
88
} from './utils/NgComponentAnalyzer';

0 commit comments

Comments
 (0)