Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLEANUP Beta] Linter changes for addon/-private (not -private/system) #4729

Merged
merged 1 commit into from
Jan 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions addon/-private/adapters/build-url-mixin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';

var get = Ember.get;
const get = Ember.get;

/**

Expand Down Expand Up @@ -86,10 +86,10 @@ export default Ember.Mixin.create({
@return {String} url
*/
_buildURL(modelName, id) {
var url = [];
var host = get(this, 'host');
var prefix = this.urlPrefix();
var path;
let path;
let url = [];
let host = get(this, 'host');
let prefix = this.urlPrefix();

if (modelName) {
path = this.pathForType(modelName);
Expand Down Expand Up @@ -378,8 +378,8 @@ export default Ember.Mixin.create({
@return {String} urlPrefix
*/
urlPrefix(path, parentURL) {
var host = get(this, 'host');
var namespace = get(this, 'namespace');
let host = get(this, 'host');
let namespace = get(this, 'namespace');

if (!host || host === '/') {
host = '';
Expand All @@ -401,7 +401,7 @@ export default Ember.Mixin.create({
}

// No path provided
var url = [];
let url = [];
if (host) { url.push(host); }
if (namespace) { url.push(namespace); }
return url.join('/');
Expand Down Expand Up @@ -434,7 +434,7 @@ export default Ember.Mixin.create({
@return {String} path
**/
pathForType(modelName) {
var camelized = Ember.String.camelize(modelName);
let camelized = Ember.String.camelize(modelName);
return Ember.String.pluralize(camelized);
}
});
10 changes: 5 additions & 5 deletions addon/-private/ext/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ import { deprecate } from 'ember-data/-private/debug';
*/
Ember.Date = Ember.Date || {};

var origParse = Date.parse;
var numericKeys = [1, 4, 5, 6, 7, 10, 11];
const origParse = Date.parse;
const numericKeys = [1, 4, 5, 6, 7, 10, 11];

export const parseDate = function (date) {
var timestamp, struct;
var minutesOffset = 0;
let timestamp, struct;
let minutesOffset = 0;

// ES5 §15.9.4.2 states that the string should attempt to be parsed as a Date Time String Format string
// before falling back to any implementation-specific date parsing, so that’s what we do, even if native
// implementations could be faster
// 1 YYYY 2 MM 3 DD 4 HH 5 mm 6 ss 7 msec 8 Z 9 ± 10 tzHH 11 tzmm
if ((struct = /^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?:(\d{2}))?)?)?$/.exec(date))) {
// avoid NaN timestamps caused by “undefined” values being passed to Date.UTC
for (var i = 0, k; (k = numericKeys[i]); ++i) {
for (let i = 0, k; (k = numericKeys[i]); ++i) {
struct[k] = +struct[k] || 0;
}

Expand Down
2 changes: 1 addition & 1 deletion addon/-private/initializers/store-injections.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
export default function initializeStoreInjections(registry) {
// registry.injection for Ember < 2.1.0
// application.inject for Ember 2.1.0+
var inject = registry.inject || registry.injection;
let inject = registry.inject || registry.injection;
inject.call(registry, 'controller', 'store', 'service:store');
inject.call(registry, 'route', 'store', 'service:store');
inject.call(registry, 'data-adapter', 'store', 'service:store');
Expand Down
2 changes: 1 addition & 1 deletion addon/-private/initializers/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function has(applicationOrRegistry, fullName) {
export default function initializeStore(registry) {
// registry.optionsForType for Ember < 2.1.0
// application.registerOptionsForType for Ember 2.1.0+
var registerOptionsForType = registry.registerOptionsForType || registry.optionsForType;
let registerOptionsForType = registry.registerOptionsForType || registry.optionsForType;
registerOptionsForType.call(registry, 'serializer', { singleton: false });
registerOptionsForType.call(registry, 'adapter', { singleton: false });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@param {Ember.ApplicationInstance} applicationOrRegistry
*/
export default function initializeStoreService(application) {
var container = application.lookup ? application : application.container;
let container = application.lookup ? application : application.container;
// Eagerly generate the store so defaultStore is populated.
container.lookup('service:store');
}
2 changes: 1 addition & 1 deletion addon/-private/transforms/boolean.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const { isNone } = Ember;
*/
export default Transform.extend({
deserialize(serialized, options) {
var type = typeof serialized;
let type = typeof serialized;

if (isNone(serialized) && options.allowNull === true) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion addon/-private/transforms/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import Transform from "ember-data/transform";

export default Transform.extend({
deserialize(serialized) {
var type = typeof serialized;
let type = typeof serialized;

if (type === "string") {
return new Date(parseDate(serialized));
Expand Down
6 changes: 3 additions & 3 deletions addon/-private/transforms/number.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Ember from 'ember';
import Transform from "ember-data/transform";

var empty = Ember.isEmpty;
const empty = Ember.isEmpty;

function isNumber(value) {
return value === value && value !== Infinity && value !== -Infinity;
Expand Down Expand Up @@ -31,7 +31,7 @@ function isNumber(value) {
*/
export default Transform.extend({
deserialize(serialized) {
var transformed;
let transformed;

if (empty(serialized)) {
return null;
Expand All @@ -43,7 +43,7 @@ export default Transform.extend({
},

serialize(deserialized) {
var transformed;
let transformed;

if (empty(deserialized)) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion addon/-private/transforms/string.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Ember from 'ember';
import Transform from "ember-data/transform";

var none = Ember.isNone;
const none = Ember.isNone;

/**
The `DS.StringTransform` class is used to serialize and deserialize
Expand Down
4 changes: 2 additions & 2 deletions addon/-private/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function modelHasAttributeOrRelationshipNamedType(modelClass) {
triggering deprecations.
*/
function getOwner(context) {
var owner;
let owner;

if (Ember.getOwner) {
owner = Ember.getOwner(context);
Expand All @@ -32,7 +32,7 @@ function getOwner(context) {
// `owner` is a container, we are just making this work
owner._lookupFactory = owner.lookupFactory;
owner.register = function() {
var registry = owner.registry || owner._registry || owner;
let registry = owner.registry || owner._registry || owner;

return registry.register(...arguments);
};
Expand Down