mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 20:02:05 +08:00
Re-enable full linting, and code fixes accordingly.
This commit is contained in:
28
types/rgrove__parse-xml/index.d.ts
vendored
28
types/rgrove__parse-xml/index.d.ts
vendored
@@ -1,48 +1,48 @@
|
||||
// Type definitions for @rgrove/parse-xml 1.1.1
|
||||
// Type definitions for @rgrove/parse-xml 1.1
|
||||
// Project: https://github.com/rgrove/parse-xml
|
||||
// Definitions by: Pete Johanson <https://github.com/petejohanson>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
declare function parseXml(name: string, options?: parseXml.ParseOptions): parseXml.IDocument;
|
||||
declare function parseXml(name: string, options?: parseXml.ParseOptions): parseXml.Document;
|
||||
|
||||
declare namespace parseXml {
|
||||
export interface INode {
|
||||
parent?: INode;
|
||||
interface NodeBase {
|
||||
parent?: NodeBase;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface IDocument extends INode {
|
||||
interface Document extends NodeBase {
|
||||
type: "document";
|
||||
children: Node[];
|
||||
children: NodeBase[];
|
||||
}
|
||||
|
||||
export interface ICData extends INode {
|
||||
interface CData extends NodeBase {
|
||||
type: "cdata";
|
||||
text: string;
|
||||
}
|
||||
|
||||
export interface IComment extends INode {
|
||||
interface Comment extends NodeBase {
|
||||
type: "comment";
|
||||
content: string;
|
||||
}
|
||||
|
||||
export interface IText extends INode {
|
||||
interface Text extends NodeBase {
|
||||
type: "text";
|
||||
text: string;
|
||||
}
|
||||
|
||||
export interface IElement extends INode {
|
||||
interface Element extends NodeBase {
|
||||
type: "element";
|
||||
attributes: { [key: string]: string };
|
||||
children: INode[];
|
||||
children: NodeBase[];
|
||||
name: string;
|
||||
preserveWhitespace?: string;
|
||||
}
|
||||
|
||||
export type Node = ICData | IComment | IElement | IText;
|
||||
type Node = CData | Comment | Element | Text;
|
||||
|
||||
export interface ParseOptions {
|
||||
interface ParseOptions {
|
||||
ignoreUndefinedEntities?: boolean;
|
||||
preserveCdata?: boolean;
|
||||
preserveComments?: boolean;
|
||||
@@ -50,4 +50,4 @@ declare namespace parseXml {
|
||||
}
|
||||
}
|
||||
|
||||
export = parseXml
|
||||
export = parseXml;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import assert = require('assert');
|
||||
import parseXml = require('@rgrove/parse-xml');
|
||||
|
||||
let doc = parseXml('<party></party>');
|
||||
const doc = parseXml('<party></party>');
|
||||
doc.type === "document";
|
||||
assert.equal(doc.children[0].type, "element");
|
||||
assert.equal((doc.children[0] as parseXml.IElement).name, "party");
|
||||
assert.equal((doc.children[0] as parseXml.Element).name, "party");
|
||||
|
||||
@@ -1,79 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user