Update deps 2019 09 (#439)

* update minor deps

* update minor deps

* update major deps

* fix eslint warnings
This commit is contained in:
Misha Vyrtsev
2019-09-29 14:09:00 -05:00
committed by Umputun
parent ea2a15ea8e
commit 9fbdff106d
14 changed files with 3427 additions and 1926 deletions
+6 -3
View File
@@ -22,7 +22,7 @@ module.exports = {
// disabling because typescipt uses it's own lint (see next rule)
'no-unused-vars': 0,
// allow Rust-like var starting with _underscore
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: /^_/ }],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
// disabling because it's bad practice to mark accessibility in react classes
'@typescript-eslint/explicit-member-accessibility': 0,
// doesn't work in real world
@@ -33,8 +33,10 @@ module.exports = {
'@typescript-eslint/camelcase': 0,
// disabling because it's standard behaviour that function is hoisted to top
'@typescript-eslint/no-use-before-define': 0,
// maybe good but I have just tired to type return types everywhere, especially with complex generic return types
'@typescript-eslint/explicit-function-return-type': 0,
// well
'@typescript-eslint/ban-ts-ignore': 0,
// better to be explicit here maybe?
'@typescript-eslint/no-inferrable-types': 0,
},
},
{
@@ -117,5 +119,6 @@ module.exports = {
'prefer-arrow-callback': 2,
'prettier/prettier': 2,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/explicit-function-return-type': 0,
},
};
-1
View File
@@ -207,7 +207,6 @@ export const removeComment = (id: Comment['id']) =>
export const removeMyComment = (id: Comment['id']): Promise<void> =>
fetcher.put({
url: `/comment/${id}?url=${url}`,
// eslint-disable-next-line @typescript-eslint/no-object-literal-type-assertion
body: {
delete: true,
} as object,
+1 -1
View File
@@ -5,7 +5,7 @@ if (!Element.prototype.matches) {
if (!Element.prototype.closest) {
Element.prototype.closest = function(s: string) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-this-alias
let el: any = this;
do {
@@ -147,7 +147,6 @@ export class AuthPanel extends Component<Props, State> {
async handleOAuthLogin(e: MouseEvent | KeyboardEvent) {
const p = (e.target as HTMLButtonElement).dataset.provider! as AuthProvider['name'];
// eslint-disable-next-line @typescript-eslint/no-object-literal-type-assertion
this.onSignIn({ name: p } as AuthProvider);
}
@@ -180,7 +179,7 @@ export class AuthPanel extends Component<Props, State> {
);
};
renderProvider = (provider: AuthProvider['name'], dropdown: boolean = false) => {
renderProvider = (provider: AuthProvider['name'], dropdown = false) => {
if (provider === 'anonymous') {
return (
<Dropdown
@@ -222,7 +221,6 @@ export class AuthPanel extends Component<Props, State> {
<span
className={`${dropdown ? 'auth-panel__dropdown-provider' : ''} auth-panel__pseudo-link`}
data-provider={provider}
// eslint-disable-next-line @typescript-eslint/no-object-literal-type-assertion
{...getHandleClickProps(this.handleOAuthLogin)}
role="link"
>
+1 -1
View File
@@ -255,7 +255,7 @@ async function init(): Promise<void> {
window.scrollTo(window.pageXOffset, data.scrollTo + iframe.getBoundingClientRect().top + window.pageYOffset);
}
if (data.hasOwnProperty('isUserInfoShown')) {
if (Object.prototype.hasOwnProperty.call(data, 'isUserInfoShown')) {
if (data.isUserInfoShown) {
userInfo.init(data.user || {});
} else {
+2 -2
View File
@@ -104,7 +104,7 @@ export const comments = (
let changed = false;
const editObject = { summary: '', time: new Date().toISOString() };
for (const id of action.ids) {
if (!state.hasOwnProperty(id)) continue;
if (!Object.prototype.hasOwnProperty.call(state, id)) continue;
if (!changed) {
changed = true;
newState = { ...newState };
@@ -153,7 +153,7 @@ export const pinnedComments = (
return [...state, action.comment.id];
}
case COMMENTS_PATCH: {
if (!action.patch.hasOwnProperty('pin')) return state;
if (!Object.prototype.hasOwnProperty.call(action.patch, 'pin')) return state;
if (!action.patch.pin) {
return state.filter(x => action.ids.indexOf(x) === -1);
}
+1 -1
View File
@@ -117,7 +117,7 @@ export const hideUser = (user: User): StoreAction<void> => (dispatch, getState)
export const unhideUser = (userId: string): StoreAction<void> => (dispatch, _getState) => {
if (IS_STORAGE_AVAILABLE) {
const hiddenUsers = JSON.parse(getItem(LS_HIDDEN_USERS_KEY) || '{}');
if (hiddenUsers.hasOwnProperty(userId)) {
if (Object.prototype.hasOwnProperty.call(hiddenUsers, userId)) {
delete hiddenUsers[userId];
}
localStorage.setItem(LS_HIDDEN_USERS_KEY, JSON.stringify(hiddenUsers));
+1 -1
View File
@@ -55,7 +55,7 @@ export const hiddenUsers = (state: { [id: string]: User } = {}, action: USER_ACT
return { ...state, [action.user.id]: action.user };
}
case USER_UNHIDE: {
if (!state.hasOwnProperty(action.id)) return state;
if (!Object.prototype.hasOwnProperty.call(state, action.id)) return state;
const newState = { ...state };
delete newState[action.id];
return newState;
+1
View File
@@ -5,6 +5,7 @@ export const mockHeaders = {
mock: () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(window as any).Headers = class {
// eslint-disable-next-line @typescript-eslint/no-empty-function
append() {}
has() {
return false;
+7 -6
View File
@@ -1,12 +1,13 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
// type signature is wrong, but there is no way
// in typescript to augment function return type currently
export default function debounce<F extends (...args: any[]) => void>(func: F, wait: number): F {
export default function debounce<T extends any[]>(
fn: (...args: T) => unknown,
wait: number = 1000
): (...args: Parameters<typeof fn>) => void {
let timeout: number | undefined;
return function(this: any): void {
const laterCall = (): void => func.apply(this, arguments as any);
return function(this: any, ...args): void {
const laterCall = (): unknown => fn.apply(this, args);
window.clearTimeout(timeout);
timeout = window.setTimeout(laterCall, wait);
} as any;
};
}
+1
View File
@@ -1 +1,2 @@
// eslint-disable-next-line @typescript-eslint/no-empty-function
export default function noop(): void {}
+3366 -1868
View File
File diff suppressed because it is too large Load Diff
+38 -38
View File
@@ -28,47 +28,47 @@
]
},
"devDependencies": {
"@babel/core": "^7.5.4",
"@babel/core": "^7.6.2",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-transform-react-jsx": "^7.3.0",
"@babel/preset-env": "^7.5.4",
"@babel/preset-env": "^7.6.2",
"@babel/preset-react": "^7.0.0",
"@types/cheerio": "^0.22.12",
"@types/cheerio": "^0.22.13",
"@types/core-js": "^2.5.2",
"@types/fetch-mock": "^7.3.1",
"@types/jest": "^24.0.15",
"@types/lodash": "^4.14.135",
"@types/node": "^12.6.3",
"@types/jest": "^24.0.18",
"@types/lodash": "^4.14.141",
"@types/node": "^12.7.8",
"@types/redux-mock-store": "^1.0.1",
"@typescript-eslint/eslint-plugin": "^1.12.0",
"@typescript-eslint/parser": "^1.12.0",
"@typescript-eslint/eslint-plugin": "^2.3.1",
"@typescript-eslint/parser": "^2.3.1",
"autoprefixer": "^9.6.1",
"babel-eslint": "^10.0.2",
"babel-jest": "^24.8.0",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"babel-loader": "^8.0.6",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^5.0.3",
"css-loader": "^3.0.0",
"document-register-element": "^1.13.2",
"copy-webpack-plugin": "^5.0.4",
"css-loader": "^3.2.0",
"document-register-element": "^1.14.3",
"enzyme": "^3.10.0",
"enzyme-adapter-preact-pure": "^2.0.0",
"enzyme-adapter-preact-pure": "^2.0.2",
"es-check": "^5.0.0",
"eslint": "^5.16.0",
"eslint-config-prettier": "^4.3.0",
"eslint": "^6.5.0",
"eslint-config-prettier": "^6.3.0",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.14.2",
"fetch-mock": "^7.3.6",
"file-loader": "^4.0.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "^7.14.3",
"fetch-mock": "^7.4.0",
"file-loader": "^4.2.0",
"html-webpack-plugin": "^3.2.0",
"husky": "^3.0.0",
"jest": "^24.8.0",
"jest-enzyme": "^7.0.2",
"husky": "^3.0.7",
"jest": "^24.9.0",
"jest-enzyme": "^7.1.1",
"jest-extended": "^0.11.2",
"jest-localstorage-mock": "^2.4.0",
"lint-staged": "^9.2.0",
"lodash": "^4.17.11",
"mini-css-extract-plugin": "^0.7.0",
"lint-staged": "^9.4.0",
"lodash": "^4.17.15",
"mini-css-extract-plugin": "^0.8.0",
"node-fetch": "^2.6.0",
"npm-run-all": "^4.1.5",
"postcss-calc": "^7.0.1",
@@ -82,24 +82,24 @@
"preact-context": "^1.1.3",
"prettier": "^1.18.2",
"redux-mock-store": "^1.5.3",
"style-loader": "^0.23.1",
"ts-jest": "^24.0.2",
"ts-loader": "^6.0.4",
"typescript": "^3.5.3",
"webpack": "^4.35.3",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-cli": "^3.3.6",
"webpack-dev-server": "^3.7.2",
"style-loader": "^1.0.0",
"ts-jest": "^24.1.0",
"ts-loader": "^6.2.0",
"typescript": "^3.6.3",
"webpack": "^4.41.0",
"webpack-bundle-analyzer": "^3.5.2",
"webpack-cli": "^3.3.9",
"webpack-dev-server": "^3.8.1",
"whatwg-fetch": "^3.0.0"
},
"dependencies": {
"@github/markdown-toolbar-element": "^1.0.4",
"@webcomponents/custom-elements": "^1.2.4",
"@github/markdown-toolbar-element": "^1.1.0",
"@webcomponents/custom-elements": "^1.3.0",
"bem-react-helper": "^1.1.2",
"core-js": "^3.1.4",
"core-js": "^3.2.1",
"focus-visible": "^5.0.2",
"intersection-observer": "^0.7.0",
"preact": "^8.4.2",
"preact": "^8.5.2",
"preact-redux": "^2.0.3",
"redux": "^4.0.4",
"redux-thunk": "^2.3.0"
+1 -1
View File
@@ -23,5 +23,5 @@
}
},
"include": ["app/**/*"],
"exclude": ["node_modules"],
"exclude": ["node_modules"]
}