Skip to content

Commit

Permalink
🚷 fix new ESLint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
deepsweet committed Sep 1, 2020
1 parent 10077ef commit b8c8f87
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 25 deletions.
3 changes: 2 additions & 1 deletion packages/autoprops/src/apply-prop-value.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable max-params, no-use-before-define */
/* eslint-disable max-params */
/* eslint-disable @typescript-eslint/no-use-before-define */
import BigInt from 'big-integer'
import type { BigInteger } from 'big-integer'
import { isUndefined } from 'tsfn'
Expand Down
2 changes: 1 addition & 1 deletion packages/autoprops/src/apply-valid-perm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-use-before-define */
/* eslint-disable @typescript-eslint/no-use-before-define */
import BigInt from 'big-integer'
import type { BigInteger } from 'big-integer'
import { applyDisableDeps } from './apply-disable-deps'
Expand Down
2 changes: 1 addition & 1 deletion packages/autoprops/src/get-props.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-use-before-define */
/* eslint-disable @typescript-eslint/no-use-before-define */
import BigInt from 'big-integer'
import type { BigInteger } from 'big-integer'
import { isDefined } from 'tsfn'
Expand Down
2 changes: 1 addition & 1 deletion packages/autoprops/src/serialize-props.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-use-before-define */
/* eslint-disable @typescript-eslint/no-use-before-define */
import BigInt from 'big-integer'
import type { BigInteger } from 'big-integer'
import { isValidElement } from 'react'
Expand Down
2 changes: 1 addition & 1 deletion packages/dleet/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-use-before-define */
/* eslint-disable @typescript-eslint/no-use-before-define */
import { join } from 'path'
import { chmod, lstat, readdir, rmdir, unlink } from 'pifs'
import { delay } from './delay'
Expand Down
3 changes: 2 additions & 1 deletion packages/mock/request/test/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import http, { IncomingMessage, ServerResponse } from 'http'
import type { IncomingMessage, ServerResponse } from 'http'
import http from 'http'
import https from 'https'
import test from 'tape'
import { unchunkString } from 'unchunk'
Expand Down
4 changes: 2 additions & 2 deletions packages/nextools/start-preset/src/pkg.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ReadStream, Dirent, Stats } from 'fs'
import { Transform } from 'stream'
import type { ReadStream, Dirent, Stats } from 'fs'
import type { Transform } from 'stream'
import plugin from '@start/plugin'

const TEMPLATES_PATH = './tasks/pkg/'
Expand Down
4 changes: 2 additions & 2 deletions packages/rebox/web/src/build-web-app-release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import HtmlWebpackPlugin from 'html-webpack-plugin'
import InlineChunkHtmlPlugin from 'react-dev-utils/InlineChunkHtmlPlugin'
import TerserPlugin from 'terser-webpack-plugin'
import { isObject } from 'tsfn'
import webpack, { Stats } from 'webpack'
import type { Configuration as WebpackConfig } from 'webpack'
import webpack from 'webpack'
import type { Configuration as WebpackConfig, Stats } from 'webpack'
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
import { getBabelConfigBuildRelease } from './get-babel-config'

Expand Down
2 changes: 1 addition & 1 deletion packages/rebox/web/src/watch-plugin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable max-params */
import path from 'path'
import { Plugin, Compiler } from 'webpack'
import type { Plugin, Compiler } from 'webpack'

type IWatch = {
watch: (files: string[], dirs: string[], missing: {}, startTime: number, options: {}, callback: () => {}, callbackUndelayed: () => {}) => void,
Expand Down
2 changes: 1 addition & 1 deletion packages/revert/block/src/PrimitiveBlockRef.native.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { forwardRef } from 'react'
import type { ForwardRefExoticComponent } from 'react'
import { View } from 'react-native'
import type { View } from 'react-native'
import { PrimitiveBlock } from './PrimitiveBlock'
import type { TPrimitiveBlock } from './types'

Expand Down
3 changes: 2 additions & 1 deletion packages/revert/layout/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { LAYOUT_SIZE_1, LAYOUT_SIZE_2, LAYOUT_SIZE_3, LAYOUT_SIZE_4, LAYOUT_SIZE_FIT } from './symbols'
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type { LAYOUT_SIZE_1, LAYOUT_SIZE_2, LAYOUT_SIZE_3, LAYOUT_SIZE_4, LAYOUT_SIZE_FIT } from './symbols'

export type TLayoutSize = number | typeof LAYOUT_SIZE_1 | typeof LAYOUT_SIZE_2 | typeof LAYOUT_SIZE_3 | typeof LAYOUT_SIZE_4 | typeof LAYOUT_SIZE_FIT
export type TLayoutDirection = 'horizontal' | 'vertical'
3 changes: 2 additions & 1 deletion packages/revert/sandbox/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import type { FC } from 'react'
import type { TRequiredKeys, TOptionalKeys } from 'tsfn'
import type { TJsonMap } from 'typeon'
import type { TPopoverPlugin, TProviderPlugin } from './components/plugin-provider/types'
import { SYMBOL_CONTROL_COLOR, SYMBOL_CONTROL_SWITCH, SYMBOL_CONTROL_DROPDOWN } from './symbols'
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type { SYMBOL_CONTROL_COLOR, SYMBOL_CONTROL_SWITCH, SYMBOL_CONTROL_DROPDOWN } from './symbols'

export type TApp = {
components: TComponents,
Expand Down
15 changes: 7 additions & 8 deletions packages/spyfn/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
const GET_SPY_CALLS_SYMBOL = Symbol('get-spy-calls')

type TProps <T extends any[]> = {
type TProps = {
index: number,
args: T,
args: any[],
}
type TCalls <T extends any> = T[]
type TSpy <T extends any[], R> = (...args: T) => R
type TSpy<R> = (...args: any[]) => R

export const createSpy = <T extends any[], R>(getResult: (props: TProps<T>) => R): TSpy<T, R> => {
const calls: TCalls<T> = []
export const createSpy = <R>(getResult: (props: TProps) => R): TSpy<R> => {
const calls = [] as any[]

const spy: TSpy<T, R> = (...args) => {
const spy: TSpy<R> = (...args) => {
if (args[0] === GET_SPY_CALLS_SYMBOL) {
return calls as any
}
Expand All @@ -28,4 +27,4 @@ export const createSpy = <T extends any[], R>(getResult: (props: TProps<T>) => R
return spy
}

export const getSpyCalls = (spy: TSpy<any, any>): TCalls<any> => spy(GET_SPY_CALLS_SYMBOL)
export const getSpyCalls = (spy: TSpy<any>): any[] => spy(GET_SPY_CALLS_SYMBOL)
2 changes: 1 addition & 1 deletion packages/start/plugin-lib-eslint/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import plugin from '@start/plugin'
import type { StartDataFilesProps, StartDataFile } from '@start/plugin'
import { ESLint } from 'eslint'
import type { ESLint } from 'eslint'

export default (userOptions?: ESLint.Options, formatterName = '') =>
plugin('eslint', ({ logMessage, logPath }) => async ({ files }: StartDataFilesProps) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/unchunk/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EventEmitter } from 'events'
import type { EventEmitter } from 'events'

export const unchunkBuffer = (emitter: EventEmitter): Promise<Buffer> => {
let result = Buffer.alloc(0)
Expand Down
3 changes: 2 additions & 1 deletion packages/x-ray/serialize-react-tree/src/serialize-props.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable import/no-cycle, no-use-before-define */
/* eslint-disable @typescript-eslint/no-use-before-define */
/* eslint-disable import/no-cycle */
import { isValidElement } from 'react'
import { isObject, isArray, isFunction, isNull, isUndefined, isString, isNumber, isSymbol } from 'tsfn'
import { makeIndent, nextIndent, prevIndent } from './make-indent'
Expand Down

0 comments on commit b8c8f87

Please sign in to comment.