chore: fix linting errors

This commit is contained in:
SleepWalker 2020-10-11 21:19:12 +03:00 committed by ErickSkrauch
parent 831ab42155
commit cd8a5a8a8b
8 changed files with 81 additions and 70 deletions

126
@types/chalk.d.ts vendored
View File

@ -7,30 +7,30 @@ declare module 'chalk' {
const enum LevelEnum { const enum LevelEnum {
/** /**
All colors disabled. All colors disabled.
*/ */
None = 0, None = 0,
/** /**
Basic 16 colors support. Basic 16 colors support.
*/ */
Basic = 1, Basic = 1,
/** /**
ANSI 256 colors support. ANSI 256 colors support.
*/ */
Ansi256 = 2, Ansi256 = 2,
/** /**
Truecolor 16 million colors support. Truecolor 16 million colors support.
*/ */
TrueColor = 3, TrueColor = 3,
} }
/** /**
Basic foreground colors. Basic foreground colors.
[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) [More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support)
*/ */
type ForegroundColor = type ForegroundColor =
| 'black' | 'black'
| 'red' | 'red'
@ -53,9 +53,9 @@ declare module 'chalk' {
/** /**
Basic background colors. Basic background colors.
[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) [More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support)
*/ */
type BackgroundColor = type BackgroundColor =
| 'bgBlack' | 'bgBlack'
| 'bgRed' | 'bgRed'
@ -78,9 +78,9 @@ declare module 'chalk' {
/** /**
Basic colors. Basic colors.
[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) [More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support)
*/ */
type Color = ForegroundColor | BackgroundColor; type Color = ForegroundColor | BackgroundColor;
type Modifiers = type Modifiers =
@ -101,59 +101,59 @@ declare module 'chalk' {
/** /**
Specify the color support for Chalk. Specify the color support for Chalk.
By default, color support is automatically detected based on the environment. By default, color support is automatically detected based on the environment.
*/ */
level?: Level; level?: Level;
} }
interface Instance { interface Instance {
/** /**
Return a new Chalk instance. Return a new Chalk instance.
*/ */
new (options?: Options): Chalk; new (options?: Options): Chalk;
} }
/** /**
Detect whether the terminal supports color. Detect whether the terminal supports color.
*/ */
interface ColorSupport { interface ColorSupport {
/** /**
The color level used by Chalk. The color level used by Chalk.
*/ */
level: Level; level: Level;
/** /**
Return whether Chalk supports basic 16 colors. Return whether Chalk supports basic 16 colors.
*/ */
hasBasic: boolean; hasBasic: boolean;
/** /**
Return whether Chalk supports ANSI 256 colors. Return whether Chalk supports ANSI 256 colors.
*/ */
has256: boolean; has256: boolean;
/** /**
Return whether Chalk supports Truecolor 16 million colors. Return whether Chalk supports Truecolor 16 million colors.
*/ */
has16m: boolean; has16m: boolean;
} }
interface ChalkFunction { interface ChalkFunction {
/** /**
Use a template string. Use a template string.
@remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341)) @remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341))
@example @example
``` ```
import chalk = require('chalk'); import chalk = require('chalk');
log(chalk` log(chalk`
CPU: {red ${cpu.totalPercent}%} CPU: {red ${cpu.totalPercent}%}
RAM: {green ${ram.used / ram.total * 100}%} RAM: {green ${ram.used / ram.total * 100}%}
DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
`); `);
``` ```
*/ */
(text: TemplateStringsArray, ...placeholders: unknown[]): string; (text: TemplateStringsArray, ...placeholders: unknown[]): string;
(...text: unknown[]): string; (...text: unknown[]): string;
@ -162,182 +162,182 @@ declare module 'chalk' {
interface Chalk extends ChalkFunction { interface Chalk extends ChalkFunction {
/** /**
Return a new Chalk instance. Return a new Chalk instance.
*/ */
Instance: Instance; Instance: Instance;
/** /**
The color support for Chalk. The color support for Chalk.
By default, color support is automatically detected based on the environment. By default, color support is automatically detected based on the environment.
*/ */
level: Level; level: Level;
/** /**
Use HEX value to set text color. Use HEX value to set text color.
@param color - Hexadecimal value representing the desired color. @param color - Hexadecimal value representing the desired color.
@example @example
``` ```
import chalk = require('chalk'); import chalk = require('chalk');
chalk.hex('#DEADED'); chalk.hex('#DEADED');
``` ```
*/ */
hex(color: string): Chalk; hex(color: string): Chalk;
/** /**
Use keyword color value to set text color. Use keyword color value to set text color.
@param color - Keyword value representing the desired color. @param color - Keyword value representing the desired color.
@example @example
``` ```
import chalk = require('chalk'); import chalk = require('chalk');
chalk.keyword('orange'); chalk.keyword('orange');
``` ```
*/ */
keyword(color: string): Chalk; keyword(color: string): Chalk;
/** /**
Use RGB values to set text color. Use RGB values to set text color.
*/ */
rgb(red: number, green: number, blue: number): Chalk; rgb(red: number, green: number, blue: number): Chalk;
/** /**
Use HSL values to set text color. Use HSL values to set text color.
*/ */
hsl(hue: number, saturation: number, lightness: number): Chalk; hsl(hue: number, saturation: number, lightness: number): Chalk;
/** /**
Use HSV values to set text color. Use HSV values to set text color.
*/ */
hsv(hue: number, saturation: number, value: number): Chalk; hsv(hue: number, saturation: number, value: number): Chalk;
/** /**
Use HWB values to set text color. Use HWB values to set text color.
*/ */
hwb(hue: number, whiteness: number, blackness: number): Chalk; hwb(hue: number, whiteness: number, blackness: number): Chalk;
/** /**
Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color. Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color.
30 <= code && code < 38 || 90 <= code && code < 98 30 <= code && code < 38 || 90 <= code && code < 98
For example, 31 for red, 91 for redBright. For example, 31 for red, 91 for redBright.
*/ */
ansi(code: number): Chalk; ansi(code: number): Chalk;
/** /**
Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.
*/ */
ansi256(index: number): Chalk; ansi256(index: number): Chalk;
/** /**
Use HEX value to set background color. Use HEX value to set background color.
@param color - Hexadecimal value representing the desired color. @param color - Hexadecimal value representing the desired color.
@example @example
``` ```
import chalk = require('chalk'); import chalk = require('chalk');
chalk.bgHex('#DEADED'); chalk.bgHex('#DEADED');
``` ```
*/ */
bgHex(color: string): Chalk; bgHex(color: string): Chalk;
/** /**
Use keyword color value to set background color. Use keyword color value to set background color.
@param color - Keyword value representing the desired color. @param color - Keyword value representing the desired color.
@example @example
``` ```
import chalk = require('chalk'); import chalk = require('chalk');
chalk.bgKeyword('orange'); chalk.bgKeyword('orange');
``` ```
*/ */
bgKeyword(color: string): Chalk; bgKeyword(color: string): Chalk;
/** /**
Use RGB values to set background color. Use RGB values to set background color.
*/ */
bgRgb(red: number, green: number, blue: number): Chalk; bgRgb(red: number, green: number, blue: number): Chalk;
/** /**
Use HSL values to set background color. Use HSL values to set background color.
*/ */
bgHsl(hue: number, saturation: number, lightness: number): Chalk; bgHsl(hue: number, saturation: number, lightness: number): Chalk;
/** /**
Use HSV values to set background color. Use HSV values to set background color.
*/ */
bgHsv(hue: number, saturation: number, value: number): Chalk; bgHsv(hue: number, saturation: number, value: number): Chalk;
/** /**
Use HWB values to set background color. Use HWB values to set background color.
*/ */
bgHwb(hue: number, whiteness: number, blackness: number): Chalk; bgHwb(hue: number, whiteness: number, blackness: number): Chalk;
/** /**
Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color. Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color.
30 <= code && code < 38 || 90 <= code && code < 98 30 <= code && code < 38 || 90 <= code && code < 98
For example, 31 for red, 91 for redBright. For example, 31 for red, 91 for redBright.
Use the foreground code, not the background code (for example, not 41, nor 101). Use the foreground code, not the background code (for example, not 41, nor 101).
*/ */
bgAnsi(code: number): Chalk; bgAnsi(code: number): Chalk;
/** /**
Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color. Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color.
*/ */
bgAnsi256(index: number): Chalk; bgAnsi256(index: number): Chalk;
/** /**
Modifier: Resets the current color chain. Modifier: Resets the current color chain.
*/ */
readonly reset: Chalk; readonly reset: Chalk;
/** /**
Modifier: Make text bold. Modifier: Make text bold.
*/ */
readonly bold: Chalk; readonly bold: Chalk;
/** /**
Modifier: Emitting only a small amount of light. Modifier: Emitting only a small amount of light.
*/ */
readonly dim: Chalk; readonly dim: Chalk;
/** /**
Modifier: Make text italic. (Not widely supported) Modifier: Make text italic. (Not widely supported)
*/ */
readonly italic: Chalk; readonly italic: Chalk;
/** /**
Modifier: Make text underline. (Not widely supported) Modifier: Make text underline. (Not widely supported)
*/ */
readonly underline: Chalk; readonly underline: Chalk;
/** /**
Modifier: Inverse background and foreground colors. Modifier: Inverse background and foreground colors.
*/ */
readonly inverse: Chalk; readonly inverse: Chalk;
/** /**
Modifier: Prints the text, but makes it invisible. Modifier: Prints the text, but makes it invisible.
*/ */
readonly hidden: Chalk; readonly hidden: Chalk;
/** /**
Modifier: Puts a horizontal line through the center of the text. (Not widely supported) Modifier: Puts a horizontal line through the center of the text. (Not widely supported)
*/ */
readonly strikethrough: Chalk; readonly strikethrough: Chalk;
/** /**
Modifier: Prints the text only when Chalk has a color support level > 0. Modifier: Prints the text only when Chalk has a color support level > 0.
Can be useful for things that are purely cosmetic. Can be useful for things that are purely cosmetic.
*/ */
readonly visible: Chalk; readonly visible: Chalk;
readonly black: Chalk; readonly black: Chalk;
@ -403,7 +403,7 @@ declare module 'chalk' {
Call the last one as a method with a string argument. Call the last one as a method with a string argument.
Order doesn't matter, and later styles take precedent in case of a conflict. Order doesn't matter, and later styles take precedent in case of a conflict.
This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`. This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
*/ */
const chalk: chalk.Chalk & const chalk: chalk.Chalk &
chalk.ChalkFunction & { chalk.ChalkFunction & {
supportsColor: chalk.ColorSupport | false; supportsColor: chalk.ColorSupport | false;

View File

@ -41,5 +41,6 @@ export function getLocaleIconUrl(locale: string): string {
} }
} }
// eslint-disable-next-line @typescript-eslint/no-var-requires
return require('./flags/unknown.svg').default; return require('./flags/unknown.svg').default;
} }

View File

@ -49,7 +49,7 @@ storiesOf('Components/Profile/MultiFactorAuth', module)
)) ))
.add('Enabled', () => ( .add('Enabled', () => (
<MultiFactorAuth <MultiFactorAuth
isMfaEnabled={true} isMfaEnabled
step={0} step={0}
onSubmit={(form, sendData) => { onSubmit={(form, sendData) => {
action('onSubmit')(form, sendData); action('onSubmit')(form, sendData);

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/** /**
* Returns the content to be displayed on first render * Returns the content to be displayed on first render
*/ */

View File

@ -23,8 +23,8 @@ import siteName from './siteName.intl';
import PageNotFound from 'app/pages/404/PageNotFound'; import PageNotFound from 'app/pages/404/PageNotFound';
const ProfileController = React.lazy(() => const ProfileController = React.lazy(
import(/* webpackChunkName: "page-profile-all" */ 'app/pages/profile/ProfileController'), () => import(/* webpackChunkName: "page-profile-all" */ 'app/pages/profile/ProfileController'),
); );
const RulesPage = React.lazy(() => import(/* webpackChunkName: "page-rules" */ 'app/pages/rules/RulesPage')); const RulesPage = React.lazy(() => import(/* webpackChunkName: "page-rules" */ 'app/pages/rules/RulesPage'));
const DevPage = React.lazy(() => import(/* webpackChunkName: "page-dev-applications" */ 'app/pages/dev/DevPage')); const DevPage = React.lazy(() => import(/* webpackChunkName: "page-dev-applications" */ 'app/pages/dev/DevPage'));

View File

@ -11,8 +11,8 @@ import ContextProvider from './ContextProvider';
import type { History } from 'history'; import type { History } from 'history';
const SuccessOauthPage = React.lazy(() => const SuccessOauthPage = React.lazy(
import(/* webpackChunkName: "page-oauth-success" */ 'app/pages/auth/SuccessOauthPage'), () => import(/* webpackChunkName: "page-oauth-success" */ 'app/pages/auth/SuccessOauthPage'),
); );
interface Props { interface Props {

View File

@ -28,7 +28,12 @@ export default function storeFactory(preloadedState = {}): Store {
// Hot reload reducers // Hot reload reducers
if (module.hot && typeof module.hot.accept === 'function') { if (module.hot && typeof module.hot.accept === 'function') {
module.hot.accept('app/reducers', () => store.replaceReducer(require('app/reducers').default)); module.hot.accept('app/reducers', () =>
store.replaceReducer(
// eslint-disable-next-line @typescript-eslint/no-var-requires
require('app/reducers').default,
),
);
} }
return store; return store;

View File

@ -38,7 +38,11 @@ Promise.all([stat(`${__dirname}/../../yarn.lock`), stat(`${__dirname}/../../dll/
return reject(err); return reject(err);
} }
logResult(chalk.green('Dll was successfully build in %s ms'), stats.endTime! - stats.startTime!); logResult(
chalk.green('Dll was successfully build in %s ms'),
// @ts-expect-error - something wrong with webpack types
stats.endTime - stats.startTime,
);
resolve(); resolve();
}); });