Skip to content

Commit

Permalink
Gets rid of eslint; enables stricter type checks; ensures prettier li…
Browse files Browse the repository at this point in the history
…nts ts/tsx files
  • Loading branch information
kylebebak committed Jul 4, 2019
1 parent e6a0418 commit ef79a02
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 76 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

52 changes: 0 additions & 52 deletions .eslintrc.js

This file was deleted.

12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,13 @@
"@types/react": "^16.8.10",
"@types/react-dom": "^16.8.3",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^7.2.3",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.4",
"babel-polyfill": "^6.26.0",
"css-loader": "^1.0.0",
"docusaurus-init": "^1.0.2",
"enzyme": "^3.7.0",
"enzyme-adapter-react-16": "^1.7.0",
"eslint": "^4.3.0",
"eslint-config-airbnb": "^15.1.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.7.0",
"html5-file-selector": "^2.1.0",
"husky": "^1.3.1",
"jest": "^23.6.0",
Expand Down Expand Up @@ -83,15 +77,15 @@
"build-styleguide-quickstart": "tsc && styleguidist build --config styleguide-quickstart.config.js",
"build-docs": "./build_docs.sh",
"test": "tsc && jest --coverage",
"lint": "prettier --check 'src/**/*.js' && eslint src",
"prettier": "prettier --write 'src/**/*.tsx'"
"prettier-check": "prettier --check src/**/*.ts src/**/*.tsx",
"prettier": "prettier --write src/**/*.ts src/**/*.tsx"
},
"dependencies": {
"@babel/runtime": "^7.1.2"
},
"husky": {
"hooks": {
"pre-push": "npm run lint && npm run test"
"pre-push": "npm run prettier-check"
}
}
}
1 change: 0 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,3 @@ export interface IDropzoneProps {
InputComponent?: ReactComponent<IInputProps>
SubmitButtonComponent?: ReactComponent<ISubmitButtonProps>
}

8 changes: 4 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import {IStyleCustomization } from './types.js';
import { IStyleCustomization } from './types.js'

export const formatBytes = (b: number) => {
const units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
Expand All @@ -26,7 +26,7 @@ export const formatDuration = (seconds: number) => {
// returns true if file.name is empty and accept string is something like ".csv",
// because file comes from dataTransferItem for drag events, and
// dataTransferItem.name is always empty
export const accepts = (file: File , accept: string) => {
export const accepts = (file: File, accept: string) => {
if (!accept || accept === '*') return true

const mimeType = file.type || ''
Expand All @@ -49,7 +49,7 @@ export const accepts = (file: File , accept: string) => {
type ResolveFn<T> = (...args: any[]) => T

export const resolveValue = <T = any>(value: ResolveFn<T> | T, ...args: any[]) => {
if (typeof value === 'function') return (value as ResolveFn<T>)( ...args)
if (typeof value === 'function') return (value as ResolveFn<T>)(...args)
return value
}

Expand Down Expand Up @@ -95,7 +95,7 @@ export const getFilesFromEvent = (
event: React.DragEvent<HTMLElement> | React.ChangeEvent<HTMLInputElement>,
): Promise<Array<File | DataTransferItem>> => {
let items: FileList | DataTransferItemList

if ('dataTransfer' in event) {
const dt = event.dataTransfer

Expand Down
9 changes: 0 additions & 9 deletions tests/.eslintrc.js

This file was deleted.

3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"esModuleInterop": true,
"jsx": "react",
"skipLibCheck": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strict": true
},
"include": ["examples/src/index.tsx", "src/*.tsx"],
"exclude": ["**/node_modules/*"]
Expand Down

0 comments on commit ef79a02

Please sign in to comment.