New eslint rules auto fix (#3058)

* no-implicit-coercion and no-unneeded-ternary

* End every line with a semicolon

* Spacing and formatting

* Enabled semi-spacing

* Applies npm run lint:fix to code after master merge

* Fix merge issues

* Switched operator-linebreak to 'before'

Co-authored-by: Joshi <simplyrender@gmail.com>
This commit is contained in:
Andrew Henry
2020-07-31 12:11:03 -07:00
committed by GitHub
parent 573a63d359
commit a09da30768
739 changed files with 4660 additions and 2339 deletions

View File

@@ -31,7 +31,7 @@ define([
) {
return {
name:"platform/policy",
name: "platform/policy",
definition: {
"name": "Policy Service",
"description": "Provides support for extension-driven decisions.",

View File

@@ -51,7 +51,6 @@ define(
* @returns {boolean} false if disallowed; otherwise, true
*/
/**
* The `policyService` handles decisions about what things
* are and are not allowed in certain contexts.
@@ -92,6 +91,7 @@ define(
function instantiate(Policy) {
var policy = Object.create(new Policy());
policy.message = Policy.message;
return policy;
}
@@ -128,6 +128,7 @@ define(
if (callback) {
callback(policyList[i].message);
}
// And return the failed result.
return false;
}

View File

@@ -34,18 +34,39 @@ define(
beforeEach(function () {
testPolicies = [
{ category: "a", message: "some message", result: true },
{ category: "a", result: true },
{ category: "a", result: true },
{ category: "b", message: "some message", result: true },
{ category: "b", result: true },
{ category: "b", result: true }
{
category: "a",
message: "some message",
result: true
},
{
category: "a",
result: true
},
{
category: "a",
result: true
},
{
category: "b",
message: "some message",
result: true
},
{
category: "b",
result: true
},
{
category: "b",
result: true
}
];
mockPolicies = testPolicies.map(function (p) {
var mockPolicy = jasmine.createSpyObj("policy", ['allow']);
mockPolicy.allow.and.callFake(function () {
return p.result;
});
return mockPolicy;
});
mockPolicyConstructors = testPolicies.map(function (p, i) {
@@ -53,6 +74,7 @@ define(
mockPolicyConstructor.and.returnValue(mockPolicies[i]);
mockPolicyConstructor.message = p.message;
mockPolicyConstructor.category = p.category;
return mockPolicyConstructor;
});