<commit_before># Emberjs Style Guide

![alt text](static/ember_logo.png "Ember.js")

## Index

* [The Ember Way](#the-ember-way)
* [Templates](#templates)
* [Order of Declaration](#order-of-declaration)


## The Ember Way

Use [computed properties](https://guides.emberjs.com/v2.4.0/object-model/computed-properties/) whenever applicable.

---

Use [setProperties](http://emberjs.com/api/#method_setProperties) when you want to set multiple properties on an object with a single method call.

**Do this:**

```javascript
this.setProperties({
  'model.foo1': 'bar1',
  'model.foo2': 'bar2',
  'model.foo3': 'bar3'
});

Ember.setProperties(model, {
  foo1: 'bar1',
  foo2: 'bar2',
  foo3: 'bar3'
});
```

**Don't do this:**

```javascript
this.set('model.foo1', 'bar1');
this.set('model.foo2', 'bar2');
this.set('model.foo3', 'bar3');

model.set('foo1', 'bar1');
model.set('foo2', 'bar2');
model.set('foo3', 'bar3');
```

---

Always use `Ember.computed.readOnly` when you don't need to set the property.

---

Use `Ember.computed.oneWay` instead of `Ember.computed.alias` unless there is a
specific reason for propagating changes back to the source. If you change this
property, it will diverge from the original one.

---

Use ES6 object destructuring for commonly used helpers, i.e.

```javascript
const { computed, get, set, inject } = Ember;
```

---

## Templates

Use double quotes for HTML content, for Handlebars/HTMLBars syntax use simple quotes.

**Do this:**

```html
<div class="foo">
  {{my-component data-id='foo' (action 'saveFoo')}}
</div>
```

**Don't do this:**

```html
<div class='foo'>
  {{my-component data-id="foo" (action "saveFoo")}}
</div>
```

---

The order of declaration for a component is always properties, and then actions.<commit_msg>Section: The Ember Way > Separator for Ember resolver<commit_after># Emberjs Style Guide

![alt text](static/ember_logo.png "Ember.js")

## Index

* [The Ember Way](#the-ember-way)
* [Templates](#templates)
* [Order of Declaration](#order-of-declaration)


## The Ember Way

Use [computed properties](https://guides.emberjs.com/v2.4.0/object-model/computed-properties/) whenever applicable.

---

Use [setProperties](http://emberjs.com/api/#method_setProperties) when you want to set multiple properties on an object with a single method call.

**Do this:**

```javascript
this.setProperties({
  'model.foo1': 'bar1',
  'model.foo2': 'bar2',
  'model.foo3': 'bar3'
});

Ember.setProperties(model, {
  foo1: 'bar1',
  foo2: 'bar2',
  foo3: 'bar3'
});
```

**Don't do this:**

```javascript
this.set('model.foo1', 'bar1');
this.set('model.foo2', 'bar2');
this.set('model.foo3', 'bar3');

model.set('foo1', 'bar1');
model.set('foo2', 'bar2');
model.set('foo3', 'bar3');
```

---

Always use `Ember.computed.readOnly` when you don't need to set the property.

---

Use `Ember.computed.oneWay` instead of `Ember.computed.alias` unless there is a
specific reason for propagating changes back to the source. If you change this
property, it will diverge from the original one.

---

Use ES6 object destructuring for commonly used helpers, i.e.

```javascript
const { computed, get, set, inject } = Ember;
```

---

Use `.` as a separator for the Ember resolver. Use `/` only for templates.

**Do this for templates:**

```javascript
export default Ember.Component.extend({
  layoutName: 'components/my-widget/widget',
});
```

**Do this for the Ember resolver:**

```javascript
export default Ember.Controller.extend({
  indexCtrl: Ember.inject.controller('main-widgets.index'),
});
```

---

## Templates

Use double quotes for HTML content, for Handlebars/HTMLBars syntax use simple quotes.

**Do this:**

```html
<div class="foo">
  {{my-component data-id='foo' (action 'saveFoo')}}
</div>
```

**Don't do this:**

```html
<div class='foo'>
  {{my-component data-id="foo" (action "saveFoo")}}
</div>
```

---

The order of declaration for a component is always properties, and then actions.
{'fraction_non_alphanumeric': 0.1771255060728745, 'fraction_numerical': 0.01417004048582996, 'mean_word_length': 4.459944751381215, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4409287', 'n_tokens_mistral': 1398, 'n_tokens_neox': 1346, 'n_words': 394}