Commit 13bf6596 authored by Laurent Wouters's avatar Laurent Wouters
Browse files

[fix] Fixed linting issues with views-logilab

parent 3a4b56dd28f6
......@@ -61,7 +61,6 @@ class BookRendering implements implementation.ViewImplementation {
}
priorityFor(store: $rdf.Formula, target: application.Resource): number {
if (target == null || target == undefined) return -1;
let repo = new rdfEntities.RdfEntityStore(
store,
ONTOLOGY.aliases,
......@@ -69,7 +68,7 @@ class BookRendering implements implementation.ViewImplementation {
);
let entity = repo.entityForUri(target.uri);
let focus = entity.getEntityForS("http://xmlns.com/foaf/0.1/focus");
if (focus != null) entity = focus;
if (focus !== null) entity = focus;
let entityTypes = entity.getEntitiesForS(
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
......@@ -79,9 +78,10 @@ class BookRendering implements implementation.ViewImplementation {
(entity: rdfEntities.RdfEntity) =>
entity.uris.indexOf("http://purl.org/ontology/bibo/Book") >= 0
);
if (x != null && x != undefined)
if (x) {
// The entity is a Book
return 10;
}
}
return implementation.VIEW_PRIORITY_INAPPROPRIATE;
}
......
......@@ -61,7 +61,6 @@ class ConferenceRendering implements implementation.ViewImplementation {
}
priorityFor(store: $rdf.Formula, target: application.Resource): number {
if (target == null || target == undefined) return -1;
let repo = new rdfEntities.RdfEntityStore(
store,
ONTOLOGY.aliases,
......@@ -69,7 +68,7 @@ class ConferenceRendering implements implementation.ViewImplementation {
);
let entity = repo.entityForUri(target.uri);
let focus = entity.getEntityForS("http://xmlns.com/foaf/0.1/focus");
if (focus != null) entity = focus;
if (focus !== null) entity = focus;
let entityTypes = entity.getEntitiesForS(
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
......@@ -81,9 +80,10 @@ class ConferenceRendering implements implementation.ViewImplementation {
"http://data.semanticweb.org/ns/swc/ontology#ConferenceEvent"
) >= 0
);
if (x != null && x != undefined)
if (x) {
// The entity is a Conference
return 10;
}
}
return implementation.VIEW_PRIORITY_INAPPROPRIATE;
}
......
......@@ -61,7 +61,6 @@ class PersonRendering implements implementation.ViewImplementation {
}
priorityFor(store: $rdf.Formula, target: application.Resource): number {
if (target == null || target == undefined) return -1;
let repo = new rdfEntities.RdfEntityStore(
store,
ONTOLOGY.aliases,
......@@ -69,7 +68,7 @@ class PersonRendering implements implementation.ViewImplementation {
);
let entity = repo.entityForUri(target.uri);
let focus = entity.getEntityForS("http://xmlns.com/foaf/0.1/focus");
if (focus != null) entity = focus;
if (focus !== null) entity = focus;
let entityTypes = entity.getEntitiesForS(
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
......@@ -79,9 +78,10 @@ class PersonRendering implements implementation.ViewImplementation {
(entity: rdfEntities.RdfEntity) =>
entity.uris.indexOf("http://xmlns.com/foaf/0.1/Person") >= 0
);
if (x != null && x != undefined)
if (x) {
// The entity is a Person
return 10;
}
}
return implementation.VIEW_PRIORITY_INAPPROPRIATE;
}
......
......@@ -61,7 +61,6 @@ class TalkRendering implements implementation.ViewImplementation {
}
priorityFor(store: $rdf.Formula, target: application.Resource): number {
if (target == null || target == undefined) return -1;
let repo = new rdfEntities.RdfEntityStore(
store,
ONTOLOGY.aliases,
......@@ -69,7 +68,7 @@ class TalkRendering implements implementation.ViewImplementation {
);
let entity = repo.entityForUri(target.uri);
let focus = entity.getEntityForS("http://xmlns.com/foaf/0.1/focus");
if (focus != null) entity = focus;
if (focus !== null) entity = focus;
let entityTypes = entity.getEntitiesForS(
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
......@@ -81,9 +80,10 @@ class TalkRendering implements implementation.ViewImplementation {
"http://data.semanticweb.org/ns/swc/ontology#TalkEvent"
) >= 0
);
if (x != null && x != undefined)
if (x) {
// The entity is a Talk
return 10;
}
}
return implementation.VIEW_PRIORITY_INAPPROPRIATE;
}
......
......@@ -61,7 +61,6 @@ class TrackRendering implements implementation.ViewImplementation {
}
priorityFor(store: $rdf.Formula, target: application.Resource): number {
if (target == null || target == undefined) return -1;
let repo = new rdfEntities.RdfEntityStore(
store,
ONTOLOGY.aliases,
......@@ -69,7 +68,7 @@ class TrackRendering implements implementation.ViewImplementation {
);
let entity = repo.entityForUri(target.uri);
let focus = entity.getEntityForS("http://xmlns.com/foaf/0.1/focus");
if (focus != null) entity = focus;
if (focus !== null) entity = focus;
let entityTypes = entity.getEntitiesForS(
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
......@@ -81,9 +80,10 @@ class TrackRendering implements implementation.ViewImplementation {
"http://data.semanticweb.org/ns/swc/ontology#TrackEvent"
) >= 0
);
if (x != null && x != undefined)
if (x) {
// The entity is a Track
return 10;
}
}
return implementation.VIEW_PRIORITY_INAPPROPRIATE;
}
......
......@@ -73,6 +73,7 @@
"quotemark": [true, "double", "avoid-escape", "jsx-double"],
"semicolon": [true, "always"],
"strict-type-predicates": true,
"strict-boolean-expressions": [true, "allow-undefined-union"],
"space-before-function-paren": [true, "never"],
"unified-signatures": true,
"variable-name": [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment