mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
add eslint-visitor-keys
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import * as evk from "eslint-visitor-keys";
|
||||
|
||||
const keys = evk.KEYS.ArrayExpression;
|
||||
if (keys) {
|
||||
const stringArray: ReadonlyArray<string> = keys;
|
||||
}
|
||||
const stringArray: ReadonlyArray<string> = evk.getKeys({type: "Literal", value: 777, raw: "777"});
|
||||
const keys2: evk.VisitorKeys = evk.unionWith({
|
||||
Decorator: ["expression"],
|
||||
CustomType: [],
|
||||
CustomType2: ["aaaa", "bbbb"]
|
||||
});
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// Type definitions for eslint-visitor-keys 1.0
|
||||
// Project: https://github.com/eslint/eslint-visitor-keys#readme
|
||||
// Definitions by: Toru Nagashima <https://github.com/mysticatea>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/*~ If this module is a UMD module that exposes a global variable 'myLib' when
|
||||
*~ loaded outside a module loader environment, declare that global here.
|
||||
*~ Otherwise, delete this declaration.
|
||||
*/
|
||||
export type VisitorKeys = Readonly<{
|
||||
[type: string]: ReadonlyArray<string> | undefined
|
||||
}>;
|
||||
|
||||
export const KEYS: VisitorKeys;
|
||||
export function getKeys(node: {}): ReadonlyArray<string>;
|
||||
export function unionWith(keys: VisitorKeys): VisitorKeys;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"eslint-visitor-keys-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user