mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
Implemented strict mode for the project (broken tests, hundreds of @ts-ignore and new errors are included) [skip ci]
This commit is contained in:
committed by
SleepWalker
parent
10e8b77acf
commit
96049ad4ad
@@ -2,21 +2,22 @@
|
||||
/* eslint-env node */
|
||||
/* eslint-disable no-console */
|
||||
|
||||
const fs = require('fs');
|
||||
const webpack = require('webpack');
|
||||
const chalk = require('chalk');
|
||||
import fs, { Stats } from 'fs';
|
||||
import webpack, { MultiCompiler } from 'webpack';
|
||||
import chalk from 'chalk';
|
||||
|
||||
const webpackConfig = require('../../webpack.dll.config');
|
||||
import webpackConfig from './../../webpack.dll.config';
|
||||
|
||||
const compiler = webpack(webpackConfig);
|
||||
// @ts-ignore
|
||||
const compiler: MultiCompiler = webpack(webpackConfig);
|
||||
|
||||
Promise.all([
|
||||
stat(`${__dirname}/../../yarn.lock`),
|
||||
stat(`${__dirname}/../../dll/vendor.json`),
|
||||
])
|
||||
.then(stats => {
|
||||
const lockFile = new Date(stats[0].mtime);
|
||||
const dll = new Date(stats[1].mtime);
|
||||
.then(([lockFileStats, dllFileStats]) => {
|
||||
const lockFile = new Date(lockFileStats.mtime);
|
||||
const dll = new Date(dllFileStats.mtime);
|
||||
|
||||
if (dll < lockFile) {
|
||||
return Promise.reject({
|
||||
@@ -41,7 +42,7 @@ Promise.all([
|
||||
|
||||
logResult(
|
||||
chalk.green('Dll was successfully build in %s ms'),
|
||||
stats.endTime - stats.startTime,
|
||||
stats.endTime! - stats.startTime!,
|
||||
);
|
||||
|
||||
resolve();
|
||||
@@ -53,13 +54,13 @@ Promise.all([
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
function logResult(...args) {
|
||||
function logResult(...args: any[]): void {
|
||||
console.log('\n');
|
||||
console.log(...args);
|
||||
console.log('\n');
|
||||
}
|
||||
|
||||
function stat(path) {
|
||||
function stat(path: string): Promise<Stats> {
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.stat(path, (err, stats) => {
|
||||
err ? reject(err) : resolve(stats);
|
@@ -21,5 +21,8 @@
|
||||
"multi-progress": "^2.0.0",
|
||||
"prompt": "^1.0.0",
|
||||
"utility-types": "^3.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/webpack": "^4.41.12"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user