Skip to content

Commit bfa39b3

Browse files
Linting.
1 parent 0eeb1df commit bfa39b3

33 files changed

+479
-343
lines changed

.eslintrc.js

Lines changed: 229 additions & 268 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"build_xslt_script": "rollup test_src/xslt_script.js -c -f iife -o test_dist/xslt_script.js",
1717
"prepare": "yarn build",
1818
"prepublishOnly": "yarn lint",
19-
"lint": "eslint src/"
19+
"lint": "eslint src/**/*"
2020
},
2121
"repository": {
2222
"type": "git",
@@ -47,6 +47,8 @@
4747
"@rollup/plugin-typescript": "^11.1.1",
4848
"@types/he": "^1.2.0",
4949
"@types/jest": "^29.5.2",
50+
"@typescript-eslint/eslint-plugin": "^5.60.0",
51+
"@typescript-eslint/parser": "^5.60.0",
5052
"babel-jest": "^29.5.0",
5153
"eslint": "^5.12.1",
5254
"isomorphic-jsx": "^0.3.0",

src/dom/functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,4 @@ export function xmlParse(xml: any) {
189189
return root;
190190
}
191191

192-
//XDocument.prototype = new XNode(DOM_DOCUMENT_NODE, '#document');
192+
//XDocument.prototype = new XNode(DOM_DOCUMENT_NODE, '#document');

src/dom/util.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@
88
// Dummy implmentation for the logging functions. Replace by something
99
// useful when you want to debug.
1010

11-
import { DOM_ATTRIBUTE_NODE, DOM_CDATA_SECTION_NODE, DOM_COMMENT_NODE, DOM_DOCUMENT_FRAGMENT_NODE, DOM_DOCUMENT_NODE, DOM_ELEMENT_NODE, DOM_TEXT_NODE } from "../constants";
12-
import { NumberExpr } from "../xpath";
13-
import { UnaryMinusExpr } from "../xpath";
14-
import { BinaryExpr } from "../xpath";
15-
import { FunctionCallExpr } from "../xpath";
16-
11+
import {
12+
DOM_ATTRIBUTE_NODE,
13+
DOM_CDATA_SECTION_NODE,
14+
DOM_COMMENT_NODE,
15+
DOM_DOCUMENT_FRAGMENT_NODE,
16+
DOM_DOCUMENT_NODE,
17+
DOM_ELEMENT_NODE,
18+
DOM_TEXT_NODE
19+
} from '../constants';
20+
import { BinaryExpr, FunctionCallExpr, NumberExpr, UnaryMinusExpr } from '../xpath';
1721

1822
// Throws an exception if false.
1923
export function assert(b) {

src/dom/xdocument.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ export class XDocument extends XNode {
5252
createCDATASection(data) {
5353
return XNode.create(DOM_CDATA_SECTION_NODE, '#cdata-section', data, this);
5454
}
55-
}
55+
}

src/dom/xnode.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,31 @@ import { XDocument } from "./xdocument";
1010
// operate on native DOM nodes.
1111
export class XNode {
1212
attributes: any[];
13+
1314
childNodes: any[];
15+
1416
nodeType: any;
17+
1518
nodeName: string;
19+
1620
nodeValue: string;
21+
1722
ownerDocument: any;
23+
1824
namespaceURI: any;
25+
1926
prefix: any;
27+
2028
localName: any;
29+
2130
firstChild: any;
31+
2232
lastChild: any;
33+
2334
nextSibling: any;
35+
2436
previousSibling: any;
37+
2538
parentNode: any;
2639

2740
static _unusedXNodes: any[] = [];
@@ -392,4 +405,4 @@ export class XNode {
392405
);
393406
return ret;
394407
}
395-
}
408+
}

src/xpath/binary-expr.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { NumberValue } from "./number-value";
44

55
export class BinaryExpr {
66
expr1: any;
7+
78
expr2: any;
9+
810
op: any;
911

1012
constructor(expr1: any, op: any, expr2: any) {

src/xpath/boolean-value.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export class BooleanValue {
22
value: any;
3+
34
type: string;
45

56
constructor(value) {

src/xpath/expr-context.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,23 @@ import { TOK_NUMBER } from "./tokens";
5858

5959
export class ExprContext {
6060
node: any;
61+
6162
position: any;
63+
6264
nodelist: any;
65+
6366
variables: any;
67+
6468
parent: any;
69+
6570
caseInsensitive: any;
71+
6672
ignoreAttributesWithoutValue: any;
73+
6774
returnOnFirstMatch: any;
75+
6876
ignoreNonElementNodesForNTA: any;
77+
6978
root: any;
7079

7180
constructor(
@@ -185,4 +194,4 @@ export class ExprContext {
185194
setIgnoreNonElementNodesForNTA(ignoreNonElementNodesForNTA) {
186195
return (this.ignoreNonElementNodesForNTA = ignoreNonElementNodesForNTA);
187196
}
188-
}
197+
}

src/xpath/factory-functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,4 +252,4 @@ export function makeSimpleExpr2(expr) {
252252
c.appendStep(b);
253253
}
254254
return c;
255-
}
255+
}

0 commit comments

Comments
 (0)