Skip to content

Commit

Permalink
fix CI and update lint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
plantain-00 committed Jun 1, 2017
1 parent 5c1e378 commit 396cd39
Show file tree
Hide file tree
Showing 8 changed files with 1,267 additions and 845 deletions.
3 changes: 1 addition & 2 deletions demo/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,8 @@ export function setSelectionOfTree(tree: TreeData, selected: boolean) {
}
}

/* tslint:disable:ban-types */
// tslint:disable-next-line:ban-types
export function setContextMenu(tree: TreeData, component: string | Function) {
/* tslint:enable:ban-types */
tree.contextmenu = component;
if (tree.children) {
for (const child of tree.children) {
Expand Down
3 changes: 1 addition & 2 deletions demo/vue/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,5 @@ class App extends Vue {
}
}

/* tslint:disable:no-unused-expression */
// tslint:disable-next-line:no-unused-expression
new App({ el: "#container" });
/* tslint:enable:no-unused-expression */
2,072 changes: 1,256 additions & 816 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class TreeComponent {
}

canDrop(event: DragEvent) {
return this.draggable && (event.target as HTMLElement).dataset["path"];
return this.draggable && (event.target as HTMLElement).dataset.path;
}
ontoggle(eventData: common.EventData) {
this.toggle.emit(eventData);
Expand Down
13 changes: 6 additions & 7 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ export type TreeData = {
icon?: string | false;
state: TreeNodeState;
children: TreeData[];
/* tslint:disable:ban-types */
// tslint:disable-next-line:ban-types
contextmenu?: string | Function;
/* tslint:enable:ban-types */
};

export type TreeNodeState = {
Expand Down Expand Up @@ -192,8 +191,8 @@ export function clearDropPositionOfTree(tree: TreeData) {

export function ondrag(pageY: number, dragTarget: HTMLElement | null, dropTarget: HTMLElement | null, data: TreeData[], dropAllowed?: (dropData: DropData) => boolean, next?: () => void) {
if (dropTarget) {
const sourcePath = dragTarget!.dataset["path"]!.split(",").map(s => +s);
const dropTargetPathString = dropTarget.dataset["path"];
const sourcePath = dragTarget!.dataset.path!.split(",").map(s => +s);
const dropTargetPathString = dropTarget.dataset.path;
if (dropTargetPathString) {
const targetPath = dropTargetPathString.split(",").map(s => +s);
const targetData = getNodeFromPath(data, targetPath)!;
Expand All @@ -217,7 +216,7 @@ export function ondrag(pageY: number, dragTarget: HTMLElement | null, dropTarget
}

export function ondragleave(target: HTMLElement, data: TreeData[]) {
const pathString = target.dataset["path"];
const pathString = target.dataset.path;
if (pathString) {
const path = pathString.split(",").map(s => +s);
const node = getNodeFromPath(data, path);
Expand All @@ -228,8 +227,8 @@ export function ondragleave(target: HTMLElement, data: TreeData[]) {
}

export function ondrop(target: HTMLElement, dragTarget: HTMLElement | null, data: TreeData[], next: (dropData: DropData) => void) {
const sourcePath = dragTarget!.dataset["path"]!.split(",").map(s => +s);
const targetPathString = target.dataset["path"];
const sourcePath = dragTarget!.dataset.path!.split(",").map(s => +s);
const targetPathString = target.dataset.path;
if (targetPathString) {
const targetPath = targetPathString.split(",").map(s => +s);
const targetData = getNodeFromPath(data, targetPath)!;
Expand Down
2 changes: 1 addition & 1 deletion src/react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export class Tree extends React.PureComponent<{
}

canDrop(event: React.DragEvent<HTMLElement>) {
return this.props.draggable && (event.target as HTMLElement).dataset["path"];
return this.props.draggable && (event.target as HTMLElement).dataset.path;
}
ontoggle(eventData: common.EventData) {
if (this.props.toggle) {
Expand Down
2 changes: 1 addition & 1 deletion src/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class Tree extends Vue {
}

canDrop(event: DragEvent) {
return this.draggable && (event.target as HTMLElement).dataset["path"];
return this.draggable && (event.target as HTMLElement).dataset.path;
}
ontoggle(eventData: common.EventData) {
this.$emit("toggle", eventData);
Expand Down
15 changes: 0 additions & 15 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
{
"extends": "tslint:latest",
"rules": {
"forin": false,
"interface-name": [
false
],
"max-line-length": [
false
],
"no-var-requires": false,
"no-console": [
false
],
"no-string-literal": false,
"no-reference": false,
"ordered-imports": [
false
],
"object-literal-sort-keys": false,
"variable-name": [
true,
"ban-keywords"
],
"no-bitwise": false,
"member-access": false,
"arrow-parens": false,
"array-type": [
Expand Down

0 comments on commit 396cd39

Please sign in to comment.