From eb34f08dff011c0d5203f675b5c2af77abbbc3bf Mon Sep 17 00:00:00 2001 From: Dominik Pieper Date: Tue, 10 Dec 2024 20:23:37 +0100 Subject: [PATCH] fix linting --- code/.eslintrc.js | 2 +- code/presets/angular-webpack/src/index.ts | 2 +- .../src/server/framework-preset-angular-docs.ts | 2 +- code/renderers/angular-renderer/package.json | 4 +++- .../renderers/angular-renderer/src/client/public-types.ts | 6 +++--- code/renderers/angular-renderer/src/client/types.ts | 4 ++-- code/renderers/angular-renderer/src/preset.ts | 4 ++-- scripts/prettier.config.js | 8 +++++++- 8 files changed, 20 insertions(+), 12 deletions(-) diff --git a/code/.eslintrc.js b/code/.eslintrc.js index 4268ec993dd6..fbf5eb5141c3 100644 --- a/code/.eslintrc.js +++ b/code/.eslintrc.js @@ -51,7 +51,7 @@ module.exports = { }, { // this package depends on a lot of peerDependencies we don't want to specify, because npm would install them - files: ['**/frameworks/angular/template/**/*'], + files: ['**/frameworks/angular/template/**/*', '**/renderers/angular-renderer/template/**/*'], rules: { '@typescript-eslint/no-useless-constructor': 'off', '@typescript-eslint/dot-notation': 'off', diff --git a/code/presets/angular-webpack/src/index.ts b/code/presets/angular-webpack/src/index.ts index 8b0869e00ae5..80335a347d9f 100644 --- a/code/presets/angular-webpack/src/index.ts +++ b/code/presets/angular-webpack/src/index.ts @@ -1,4 +1,4 @@ -import type { PresetProperty } from 'storybook/internal/types'; +import { PresetProperty } from 'storybook/internal/types'; export * from './types'; diff --git a/code/presets/angular-webpack/src/server/framework-preset-angular-docs.ts b/code/presets/angular-webpack/src/server/framework-preset-angular-docs.ts index 39b61e24f1aa..e21fb1606c39 100644 --- a/code/presets/angular-webpack/src/server/framework-preset-angular-docs.ts +++ b/code/presets/angular-webpack/src/server/framework-preset-angular-docs.ts @@ -1,5 +1,5 @@ import { hasDocsOrControls } from 'storybook/internal/docs-tools'; -import type { PresetProperty } from 'storybook/internal/types'; +import { PresetProperty } from 'storybook/internal/types'; export const previewAnnotations: PresetProperty<'previewAnnotations'> = (entry = [], options) => { if (!hasDocsOrControls(options)) { diff --git a/code/renderers/angular-renderer/package.json b/code/renderers/angular-renderer/package.json index 3344bc459b72..be873480b006 100644 --- a/code/renderers/angular-renderer/package.json +++ b/code/renderers/angular-renderer/package.json @@ -75,7 +75,8 @@ "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/react-dom-shim": "workspace:*", - "@storybook/theming": "workspace:*" + "@storybook/theming": "workspace:*", + "ts-dedent": "^2.0.0" }, "devDependencies": { "@angular-devkit/architect": "^0.1703.0", @@ -94,6 +95,7 @@ "@types/cross-spawn": "^6.0.2", "@types/tmp": "^0.2.3", "cross-spawn": "^7.0.3", + "telejson": "^7.2.0", "tmp": "^0.2.1", "typescript": "^5.3.2", "webpack": "5", diff --git a/code/renderers/angular-renderer/src/client/public-types.ts b/code/renderers/angular-renderer/src/client/public-types.ts index f7fd76747c94..667cb803e09e 100644 --- a/code/renderers/angular-renderer/src/client/public-types.ts +++ b/code/renderers/angular-renderer/src/client/public-types.ts @@ -1,6 +1,6 @@ /* eslint-disable prettier/prettier */ /* eslint-disable @typescript-eslint/ban-ts-comment */ -import type { +import { AnnotatedStoryFn, Args, ComponentAnnotations, @@ -11,8 +11,8 @@ import type { StrictArgs, ProjectAnnotations, } from 'storybook/internal/types'; -import type * as AngularCore from '@angular/core'; -import type { AngularRenderer } from './types'; +import * as AngularCore from '@angular/core'; +import { AngularRenderer } from './types'; export type { Args, ArgTypes, Parameters, StrictArgs } from 'storybook/internal/types'; export type { AngularRenderer }; diff --git a/code/renderers/angular-renderer/src/client/types.ts b/code/renderers/angular-renderer/src/client/types.ts index f1b43189eedb..21b96eb0ef7d 100644 --- a/code/renderers/angular-renderer/src/client/types.ts +++ b/code/renderers/angular-renderer/src/client/types.ts @@ -1,10 +1,10 @@ -import type { +import { Parameters as DefaultParameters, StoryContext as DefaultStoryContext, WebRenderer, } from 'storybook/internal/types'; -import type { ApplicationConfig, Provider } from '@angular/core'; +import { ApplicationConfig, Provider } from '@angular/core'; export interface NgModuleMetadata { /** List of components, directives, and pipes that belong to your component. */ diff --git a/code/renderers/angular-renderer/src/preset.ts b/code/renderers/angular-renderer/src/preset.ts index 99d36cbce2a9..f0fddb444aca 100644 --- a/code/renderers/angular-renderer/src/preset.ts +++ b/code/renderers/angular-renderer/src/preset.ts @@ -1,6 +1,6 @@ -import type { PresetProperty } from 'storybook/internal/types'; +import { PresetProperty } from 'storybook/internal/types'; -import type { StandaloneOptions } from './builders/utils/standalone-options'; +import { StandaloneOptions } from './builders/utils/standalone-options'; export const previewAnnotations: PresetProperty<'previewAnnotations'> = (entries = [], options) => { const annotations = [...entries, require.resolve('@storybook/angular-renderer/client/config')]; diff --git a/scripts/prettier.config.js b/scripts/prettier.config.js index 3dd5818ca130..af3dbbe24a8d 100644 --- a/scripts/prettier.config.js +++ b/scripts/prettier.config.js @@ -16,7 +16,13 @@ export default { options: { parser: 'angular' }, }, { - files: ['**/frameworks/angular/src/**/*.ts', '**/frameworks/angular/template/**/*.ts'], + files: [ + '**/frameworks/angular/src/**/*.ts', + '**/frameworks/angular/template/**/*.ts', + '**/presets/angular-webpack/src/**/*.ts', + '**/renderers/angular-renderer/src/**/*.ts', + '**/renderers/angular-renderer/template/**/*.ts', + ], options: { parser: 'babel-ts' }, }, {