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

View File

@ -49,7 +49,7 @@ storiesOf('Components/Profile/MultiFactorAuth', module)
))
.add('Enabled', () => (
<MultiFactorAuth
isMfaEnabled={true}
isMfaEnabled
step={0}
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
*/

View File

@ -23,8 +23,8 @@ import siteName from './siteName.intl';
import PageNotFound from 'app/pages/404/PageNotFound';
const ProfileController = React.lazy(() =>
import(/* webpackChunkName: "page-profile-all" */ 'app/pages/profile/ProfileController'),
const ProfileController = React.lazy(
() => import(/* webpackChunkName: "page-profile-all" */ 'app/pages/profile/ProfileController'),
);
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'));

View File

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

View File

@ -28,7 +28,12 @@ export default function storeFactory(preloadedState = {}): Store {
// Hot reload reducers
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;

View File

@ -38,7 +38,11 @@ Promise.all([stat(`${__dirname}/../../yarn.lock`), stat(`${__dirname}/../../dll/
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();
});