Fix #2624: add types for Ramda

This commit is contained in:
Oliver Blanthorn 2020-07-15 21:18:05 +01:00
parent b40c0ea242
commit a119551ce8
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
6 changed files with 20 additions and 4 deletions

View file

@ -20,6 +20,7 @@
"@types/firefox-webext-browser": "^78.0.0",
"@types/jest": "^26.0.4",
"@types/node": "^14.0.23",
"@types/ramda": "^0.27.11",
"@types/selenium-webdriver": "^4.0.9",
"@typescript-eslint/eslint-plugin": "^3.6.1",
"@typescript-eslint/eslint-plugin-tslint": "^3.6.1",

View file

@ -166,7 +166,7 @@ config.addChangeListener("autocmds", (previous, current) =>
const path = R.path([requestEvent, pattern])
// If this is a new autocmd, register it
!R.equals(...R.map(path, [current, previous])) &&
path(current) !== path(previous) &&
webrequests.registerWebRequestAutocmd(
requestEvent,
pattern,

View file

@ -1017,7 +1017,9 @@ export function hintables(selectors = DOM.HINTTAGS_selectors, withjs = false) {
hintables.push({
elements: R.pipe(
Array.from,
R.filter(DOM.isVisible),
// Ramda gives an error here without the "any"
// Problem for a rainy day :)
R.filter(DOM.isVisible) as any,
R.without(elems),
changeHintablesToLargestChild,
)(DOM.hintworthy_js_elems),

View file

@ -25,7 +25,8 @@ import * as binding from "@src/lib/binding"
const removeNull = R.when(
R.is(Object),
R.pipe(
R.reject(val => val === null),
// Ramda gives an error here without the any
R.reject(val => val === null) as any,
R.map(a => removeNull(a)),
),
)

View file

@ -13,7 +13,7 @@
"noImplicitThis": true,
"strictFunctionTypes": true,
"baseUrl": "src/",
"types": ["@types/firefox-webext-browser", "web-ext-types"],
"types": ["@types/ramda", "@types/firefox-webext-browser", "web-ext-types"],
"paths": {
"@src/*": ["*"]
}

View file

@ -752,6 +752,13 @@
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-1.19.1.tgz#33509849f8e679e4add158959fdb086440e9553f"
integrity sha512-5qOlnZscTn4xxM5MeGXAMOsIOIKIbh9e85zJWfBRVPlRMEVawzoPhINYbRGkBZCI8LxvBe7tJCdWiarA99OZfQ==
"@types/ramda@^0.27.11":
version "0.27.11"
resolved "https://registry.yarnpkg.com/@types/ramda/-/ramda-0.27.11.tgz#a2efedc1fecc0faa2d3530eb53cf468e219f7c51"
integrity sha512-pojA0+wBhjMWfwZ1tAea/OdUqZxaRQOi/vHldthrOIEPdRQdJb/hvU4yM1uHKGTT89ZZpxe43KM1sq5YGxS5lw==
dependencies:
ts-toolbelt "^6.3.3"
"@types/selenium-webdriver@^4.0.9":
version "4.0.9"
resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-4.0.9.tgz#12621e55b2ef8f6c98bd17fe23fa720c6cba16bd"
@ -8349,6 +8356,11 @@ ts-node@^8.10.2:
source-map-support "^0.5.17"
yn "3.1.1"
ts-toolbelt@^6.3.3:
version "6.13.4"
resolved "https://registry.yarnpkg.com/ts-toolbelt/-/ts-toolbelt-6.13.4.tgz#313a1a380341c99db3f669cb8cdbfd33354aa98f"
integrity sha512-6DJVcjPYdgF0NR2G80vNrRAChgks16DQ/a49UzQOF9opMixAv61vCQcSUSKX64sXAf2OKqke0gapxtTZGE/qrg==
tsconfig-paths-webpack-plugin@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/tsconfig-paths-webpack-plugin/-/tsconfig-paths-webpack-plugin-3.2.0.tgz#6e70bd42915ad0efb64d3385163f0c1270f3e04d"