mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 09:31:41 -05:00
TSLint: re-enable callable-types rule
This rule specifies that if an interface defines a simple function, it should be represented as a `type` rather than an `interface`.
This commit is contained in:
parent
efdee3c4e8
commit
f2630ea047
2 changed files with 2 additions and 8 deletions
|
@ -144,9 +144,7 @@ export function* elementsByXPath(xpath, parent?) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Type for functions that can filter element arrays */
|
/** Type for functions that can filter element arrays */
|
||||||
interface ElementFilter {
|
type ElementFilter = (element: Element) => boolean
|
||||||
(element: Element): boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Is the element of "substantial" size and shown on the page. The element
|
/** Is the element of "substantial" size and shown on the page. The element
|
||||||
* doesn't need to be in the viewport. This is useful when you want to
|
* doesn't need to be in the viewport. This is useful when you want to
|
||||||
|
@ -323,10 +321,7 @@ export function getSelector(e: HTMLElement) {
|
||||||
* @param filters filter to use (in thre given order) to further chose
|
* @param filters filter to use (in thre given order) to further chose
|
||||||
* items, or [] for all
|
* items, or [] for all
|
||||||
*/
|
*/
|
||||||
export function getElemsBySelector(
|
export function getElemsBySelector(selector: string, filters: ElementFilter[]) {
|
||||||
selector: string,
|
|
||||||
filters: ElementFilter[],
|
|
||||||
) {
|
|
||||||
let elems = Array.from(document.querySelectorAll(selector))
|
let elems = Array.from(document.querySelectorAll(selector))
|
||||||
let frameElems = getAllDocumentFrames().reduce((acc, frame) => {
|
let frameElems = getAllDocumentFrames().reduce((acc, frame) => {
|
||||||
let newElems = []
|
let newElems = []
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
"rules": {
|
"rules": {
|
||||||
"align": false,
|
"align": false,
|
||||||
"arrow-parens": false,
|
"arrow-parens": false,
|
||||||
"callable-types": false,
|
|
||||||
"class-name": false,
|
"class-name": false,
|
||||||
"cognitive-complexity": false,
|
"cognitive-complexity": false,
|
||||||
"comment-format": false,
|
"comment-format": false,
|
||||||
|
|
Loading…
Add table
Reference in a new issue