Skip to content

Commit 21d7e49

Browse files
Merge pull request #2368 from ember-cli/nvp/internal-enforce-prettier
We have prettier (and thus editors detect and run it), but what we check in CI is different
2 parents e2ab3d4 + 42b2376 commit 21d7e49

56 files changed

Lines changed: 371 additions & 385 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
node_modules/
2+
dist/
13
lib/recommended-rules.js
4+
CHANGELOG.md
5+
README.md
6+
pnpm-lock.yaml
7+
.github/*

docs/rules/_TEMPLATE_.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ TODO: suggest any fast/automated techniques for fixing violations in a large cod
4242
## Configuration
4343

4444
<!-- begin auto-generated rule options list -->
45+
4546
TODO: exclude this section if the rule has no extra configuration.
4647
TODO: ensure `meta.schema` contains descriptions, constraints, defaults, etc for all options.
48+
4749
<!-- end auto-generated rule options list -->
4850

4951
## Related Rules

docs/rules/alias-model-in-controller.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ We can do this in two ways:
1515
import { alias } from '@ember/object/computed';
1616

1717
export default Controller.extend({
18-
nail: alias('model')
18+
nail: alias('model'),
1919
});
2020
```
2121

@@ -27,7 +27,7 @@ We can do this in two ways:
2727
export default Route.extend({
2828
setupController(controller, model) {
2929
controller.set('nail', model);
30-
}
30+
},
3131
});
3232
```
3333

@@ -39,12 +39,12 @@ import { reads } from '@ember/object/computed';
3939

4040
export default Controller.extend({
4141
people: reads('model.people'),
42-
pets: reads('model.pets')
42+
pets: reads('model.pets'),
4343
});
4444
```
4545

4646
## Help Wanted
4747

48-
| Issue | Link |
49-
| :-- | :-- |
48+
| Issue | Link |
49+
| :----------------------------------------- | :------------------------------------------------------------------ |
5050
| ❌ Missing native JavaScript class support | [#560](https://github.com/ember-cli/eslint-plugin-ember/issues/560) |

docs/rules/avoid-leaking-state-in-ember-objects.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ export default Foo.extend({
1717
actions: {
1818
addItem(item) {
1919
this.items.pushObject(item);
20-
}
21-
}
20+
},
21+
},
2222
});
2323
```
2424

2525
```js
2626
import Mixin from '@ember/object/mixin';
2727

2828
export default Mixin.create({
29-
items: []
29+
items: [],
3030
});
3131
```
3232

@@ -43,8 +43,8 @@ export default Foo.extend({
4343
actions: {
4444
addItem(item) {
4545
this.items.pushObject(item);
46-
}
47-
}
46+
},
47+
},
4848
});
4949
```
5050

@@ -71,9 +71,9 @@ module.exports = {
7171
rules: {
7272
'ember/avoid-leaking-state-in-ember-objects': [
7373
'error',
74-
['array', 'of', 'ignored', 'properties']
75-
]
76-
}
74+
['array', 'of', 'ignored', 'properties'],
75+
],
76+
},
7777
};
7878
```
7979

docs/rules/avoid-using-needs-in-controllers.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Examples of **incorrect** code for this rule:
1313
```js
1414
export default Controller.extend({
1515
needs: ['comments'],
16-
newComments: alias('controllers.comments.newest')
16+
newComments: alias('controllers.comments.newest'),
1717
});
1818
```
1919

@@ -24,12 +24,12 @@ import Controller, { inject as controller } from '@ember/controller';
2424

2525
export default Component.extend({
2626
comments: controller(),
27-
newComments: alias('comments.newest')
27+
newComments: alias('comments.newest'),
2828
});
2929
```
3030

3131
## Help Wanted
3232

33-
| Issue | Link |
34-
| :-- | :-- |
33+
| Issue | Link |
34+
| :----------------------------------------- | :------------------------------------------------------------------ |
3535
| ❌ Missing native JavaScript class support | [#560](https://github.com/ember-cli/eslint-plugin-ember/issues/560) |

docs/rules/closure-actions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export default Controller.extend({
1313
actions: {
1414
detonate() {
1515
alert('Kabooom');
16-
}
17-
}
16+
},
17+
},
1818
});
1919
```
2020

@@ -30,8 +30,8 @@ export default Component.extend({
3030
actions: {
3131
pushLever() {
3232
this.sendAction('detonate');
33-
}
34-
}
33+
},
34+
},
3535
});
3636
```
3737

@@ -47,8 +47,8 @@ export default Component.extend({
4747
actions: {
4848
pushLever() {
4949
this.boom();
50-
}
51-
}
50+
},
51+
},
5252
});
5353
```
5454

docs/rules/computed-property-getters.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ This rule takes a single string option.
1313

1414
String option:
1515

16-
- `"always-with-setter"` (default) getters are *required* when computed property has a setter
17-
- `"always"` getters are *required* in computed properties
18-
- `"never"` getters are *never allowed* in computed properties
16+
- `"always-with-setter"` (default) getters are _required_ when computed property has a setter
17+
- `"always"` getters are _required_ in computed properties
18+
- `"never"` getters are _never allowed_ in computed properties
1919

2020
## Examples
2121

@@ -29,15 +29,15 @@ EmberObject.extend({
2929
fullName: computed('firstName', 'lastName', {
3030
get() {
3131
// ...
32-
}
33-
})
32+
},
33+
}),
3434
});
3535

3636
// GOOD
3737
EmberObject.extend({
3838
fullName: computed('firstName', 'lastName', function () {
3939
// ...
40-
})
40+
}),
4141
});
4242

4343
// GOOD
@@ -48,8 +48,8 @@ EmberObject.extend({
4848
},
4949
get() {
5050
// ...
51-
}
52-
})
51+
},
52+
}),
5353
});
5454
```
5555

@@ -63,15 +63,15 @@ EmberObject.extend({
6363
fullName: computed('firstName', 'lastName', {
6464
get() {
6565
// ...
66-
}
67-
})
66+
},
67+
}),
6868
});
6969

7070
// BAD
7171
EmberObject.extend({
7272
fullName: computed('firstName', 'lastName', function () {
7373
// ...
74-
})
74+
}),
7575
});
7676
```
7777

@@ -84,16 +84,16 @@ import EmberObject, { computed } from '@ember/object';
8484
EmberObject.extend({
8585
fullName: computed('firstName', 'lastName', function () {
8686
// ...
87-
})
87+
}),
8888
});
8989

9090
// BAD
9191
EmberObject.extend({
9292
fullName: computed('firstName', 'lastName', {
9393
get() {
9494
// ...
95-
}
96-
})
95+
},
96+
}),
9797
});
9898

9999
// BAD
@@ -104,13 +104,13 @@ EmberObject.extend({
104104
},
105105
set() {
106106
// ...
107-
}
108-
})
107+
},
108+
}),
109109
});
110110
```
111111

112112
## Help Wanted
113113

114-
| Issue | Link |
115-
| :-- | :-- |
114+
| Issue | Link |
115+
| :----------------------------------------- | :------------------------------------------------------------------ |
116116
| ❌ Missing native JavaScript class support | [#560](https://github.com/ember-cli/eslint-plugin-ember/issues/560) |

docs/rules/named-functions-in-promises.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default Component.extend({
4040
.then(() => this._reloadUser())
4141
.then(() => this._notifyAboutSuccess())
4242
.catch(() => this._notifyAboutFailure());
43-
}
43+
},
4444
},
4545
_reloadUser(user) {
4646
return user.reload();
@@ -50,7 +50,7 @@ export default Component.extend({
5050
},
5151
_notifyAboutFailure() {
5252
// ...
53-
}
53+
},
5454
});
5555
```
5656

docs/rules/no-actions-hash.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import Component from '@ember/component';
2222

2323
export default Component.extend({
2424
actions: {
25-
foo() {}
26-
}
25+
foo() {},
26+
},
2727
});
2828
```
2929

@@ -33,7 +33,7 @@ import Component from '@ember/component';
3333

3434
export class MyComponent extends Component {
3535
actions = {
36-
foo() {}
36+
foo() {},
3737
};
3838
}
3939
```
@@ -46,7 +46,7 @@ import Component from '@ember/component';
4646
import { action } from '@ember/object';
4747

4848
export default Component.extend({
49-
foo: action(function () {})
49+
foo: action(function () {}),
5050
});
5151
```
5252

docs/rules/no-arrow-function-computed-properties.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import EmberObject, { computed } from '@ember/object';
2020
const Person = EmberObject.extend({
2121
fullName: computed('firstName', 'lastName', () => {
2222
return `${this.firstName} ${this.lastName}`;
23-
})
23+
}),
2424
});
2525
```
2626

@@ -32,7 +32,7 @@ import EmberObject, { computed } from '@ember/object';
3232
const Person = EmberObject.extend({
3333
fullName: computed('firstName', 'lastName', function () {
3434
return `${this.firstName} ${this.lastName}`;
35-
})
35+
}),
3636
});
3737
```
3838

0 commit comments

Comments
 (0)