Skip to content

Commit 8503f14

Browse files
committed
fix lint issues
1 parent 15b9fc1 commit 8503f14

File tree

3 files changed

+37
-42
lines changed

3 files changed

+37
-42
lines changed

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
2+
"name": "angular2-query-builder",
23
"version": "0.4.2",
34
"description": "A modernized Angular 2+ query builder based on jquery QueryBuilder",
4-
"main": "./dist/index.umd.js",
5-
"module": "./dist/index.js",
6-
"typings": "./dist/index.d.ts",
5+
"main": "./dist/angular2-query-builder/bundles/angular2-query-builder.umd.js",
6+
"module": "./dist/angular2-query-builder/esm5/angular2-query-builder.js",
7+
"typings": "./dist/angular2-query-builder.d.ts",
78
"license": "MIT",
89
"private": false,
910
"keywords": [
1011
"angular",
11-
"angular2",
12+
"angular8",
1213
"query",
1314
"builder",
1415
"jquery",
1516
"querybuilder",
16-
"ng"
17+
"visual"
1718
],
1819
"author": {
1920
"name": "Zeb Zhao",
@@ -32,7 +33,7 @@
3233
"start": "ng serve",
3334
"build": "ng build angular2-query-builder",
3435
"build:watch": "ng build angular2-query-builder --watch=true",
35-
"test": "ng test",
36+
"test": "ng test --watch=false",
3637
"lint": "ng lint",
3738
"e2e": "ng e2e",
3839
"ngcompile": "npm run build",

projects/angular2-query-builder/src/lib/query-builder/query-builder.component.ts

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -552,36 +552,6 @@ export class QueryBuilderComponent implements OnInit, OnChanges, ControlValueAcc
552552
this.handleDataChange();
553553
}
554554

555-
private calculateFieldChangeValue(
556-
currentField: Field,
557-
nextField: Field,
558-
currentValue: any
559-
): any {
560-
561-
if (this.config.calculateFieldChangeValue != null) {
562-
return this.config.calculateFieldChangeValue(
563-
currentField, nextField, currentValue);
564-
}
565-
566-
const canKeepValue = () => {
567-
if (currentField == null || nextField == null) {
568-
return false;
569-
}
570-
return currentField.type === nextField.type
571-
&& this.defaultPersistValueTypes.indexOf(currentField.type) !== -1;
572-
};
573-
574-
if (this.persistValueOnFieldChange && canKeepValue()) {
575-
return currentValue;
576-
}
577-
578-
if (nextField && nextField.defaultValue !== undefined) {
579-
return this.getDefaultValue(nextField.defaultValue);
580-
}
581-
582-
return undefined;
583-
}
584-
585555
changeEntity(entityValue: string, rule: Rule, index: number, data: RuleSet): void {
586556
if (this.disabled) {
587557
return;
@@ -759,6 +729,36 @@ export class QueryBuilderComponent implements OnInit, OnChanges, ControlValueAcc
759729
return this.inputContextCache.get(rule);
760730
}
761731

732+
private calculateFieldChangeValue(
733+
currentField: Field,
734+
nextField: Field,
735+
currentValue: any
736+
): any {
737+
738+
if (this.config.calculateFieldChangeValue != null) {
739+
return this.config.calculateFieldChangeValue(
740+
currentField, nextField, currentValue);
741+
}
742+
743+
const canKeepValue = () => {
744+
if (currentField == null || nextField == null) {
745+
return false;
746+
}
747+
return currentField.type === nextField.type
748+
&& this.defaultPersistValueTypes.indexOf(currentField.type) !== -1;
749+
};
750+
751+
if (this.persistValueOnFieldChange && canKeepValue()) {
752+
return currentValue;
753+
}
754+
755+
if (nextField && nextField.defaultValue !== undefined) {
756+
return this.getDefaultValue(nextField.defaultValue);
757+
}
758+
759+
return undefined;
760+
}
761+
762762
private checkEmptyRuleInRuleset(ruleset: RuleSet): boolean {
763763
if (!ruleset || !ruleset.rules || ruleset.rules.length === 0) {
764764
return true;

tslint.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
"component-class-suffix": true,
66
"directive-class-suffix": true,
77
"interface-name": false,
8-
"invoke-injectable": true,
98
"max-line-length": [true, 160],
109
"no-access-missing-member": false,
1110
"member-access": false,
12-
"no-attribute-parameter-decorator": true,
1311
"no-console": [true, "time", "timeEnd", "trace"],
1412
"no-forward-ref": false,
1513
"no-input-rename": true,
@@ -19,12 +17,8 @@
1917
"object-literal-shorthand": false,
2018
"object-literal-sort-keys": false,
2119
"ordered-imports": false,
22-
"pipe-naming": [true, "camelCase", "my"],
2320
"quotemark": [true, "single", "avoid-escape"],
2421
"trailing-comma": [false, {"multiline": "always", "singleline": "never"}],
25-
"use-host-property-decorator": true,
26-
"use-input-property-decorator": true,
27-
"use-output-property-decorator": true,
2822
"use-pipe-transform-interface": true,
2923
"variable-name": [true, "allow-leading-underscore", "ban-keywords", "check-format"]
3024
}

0 commit comments

Comments
 (0)