mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 16:11:33 +08:00
Fix lint errors
This commit is contained in:
parent
0e9f7264f5
commit
ce20b51476
@ -41,7 +41,6 @@
|
||||
"devDependencies": {
|
||||
"@types/autoprefixer": "^9.4.0",
|
||||
"@types/webpack-env": "^1.13.9",
|
||||
"typescript": "^3.4.4",
|
||||
"zone.js": "^0.8.29"
|
||||
},
|
||||
"peerDependencies": {
|
||||
@ -52,9 +51,11 @@
|
||||
"@angular/forms": ">=6.0.0",
|
||||
"@angular/platform-browser": ">=6.0.0",
|
||||
"@angular/platform-browser-dynamic": ">=6.0.0",
|
||||
"@angular-devkit/build-angular": ">=6.0.0",
|
||||
"autoprefixer": "^8.1.0",
|
||||
"babel-loader": "^7.0.0 || ^8.0.0",
|
||||
"rxjs": "^6.0.0",
|
||||
"typescript": "^3.4.4",
|
||||
"zone.js": "^0.8.29"
|
||||
},
|
||||
"engines": {
|
||||
|
@ -3,7 +3,7 @@ import getTsLoaderOptions from '../ts_config';
|
||||
import createForkTsCheckerInstance from '../create-fork-ts-checker-plugin';
|
||||
|
||||
// eslint-disable-next-line global-require
|
||||
jest.mock('fs', () => require('./fs'));
|
||||
jest.mock('fs', () => require('../../../../../__mocks__/fs'));
|
||||
jest.mock('path', () => ({
|
||||
resolve: () => 'tsconfig.json',
|
||||
}));
|
||||
|
@ -1,7 +1,7 @@
|
||||
import getTsLoaderOptions from '../ts_config';
|
||||
|
||||
// eslint-disable-next-line global-require
|
||||
jest.mock('fs', () => require('../../../../__mocks__/fs'));
|
||||
jest.mock('fs', () => require('../../../../../__mocks__/fs'));
|
||||
jest.mock('path', () => ({
|
||||
resolve: () => 'tsconfig.json',
|
||||
}));
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { CompilerOptions } from 'typescript';
|
||||
import { Path } from '@angular-devkit/core';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import { logger } from '@storybook/node-logger';
|
||||
@ -8,9 +10,6 @@ import {
|
||||
filterOutStylingRules,
|
||||
getAngularCliParts,
|
||||
} from './angular-cli_utils';
|
||||
import { Path } from '@angular-devkit/core';
|
||||
|
||||
import { CompilerOptions } from 'typescript';
|
||||
|
||||
// todo add more accurate typings
|
||||
interface BasicOptions {
|
||||
|
@ -1,5 +1,9 @@
|
||||
import fs from 'fs';
|
||||
import { basename, dirname, normalize, relative, resolve, Path } from '@angular-devkit/core';
|
||||
import {
|
||||
getCommonConfig,
|
||||
getStylesConfig,
|
||||
} from '@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs';
|
||||
|
||||
import { RuleSetRule, Configuration } from 'webpack';
|
||||
|
||||
@ -54,14 +58,10 @@ export function isBuildAngularInstalled() {
|
||||
|
||||
// todo add type
|
||||
export function getAngularCliParts(cliWebpackConfigOptions: any) {
|
||||
// eslint-disable-next-line global-require, import/no-extraneous-dependencies
|
||||
// tslint:disable-next-line: no-implicit-dependencies
|
||||
const ngCliConfigFactory = require('@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs');
|
||||
|
||||
try {
|
||||
return {
|
||||
cliCommonConfig: ngCliConfigFactory.getCommonConfig(cliWebpackConfigOptions),
|
||||
cliStyleConfig: ngCliConfigFactory.getStylesConfig(cliWebpackConfigOptions),
|
||||
cliCommonConfig: getCommonConfig(cliWebpackConfigOptions),
|
||||
cliStyleConfig: getStylesConfig(cliWebpackConfigOptions),
|
||||
};
|
||||
} catch (e) {
|
||||
return null;
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Configuration } from 'webpack';
|
||||
import { Path } from '@angular-devkit/core';
|
||||
import { logger } from '@storybook/node-logger';
|
||||
|
||||
import {
|
||||
getAngularCliWebpackConfigOptions,
|
||||
applyAngularCliWebpackConfig,
|
||||
} from './angular-cli_config';
|
||||
import { Path } from '@angular-devkit/core';
|
||||
import { Configuration } from 'webpack';
|
||||
|
||||
export function webpackFinal(config: Configuration) {
|
||||
const cwd = process.cwd() as Path;
|
||||
|
Loading…
x
Reference in New Issue
Block a user