Skip to content

Commit df1aee8

Browse files
committed
add prettier
1 parent c1d6d22 commit df1aee8

33 files changed

+976
-940
lines changed

.eslintrc.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ module.exports = {
1111
},
1212
},
1313
plugins: ['ember'],
14-
extends: [
15-
'eslint:recommended',
16-
'plugin:ember/recommended',
17-
'plugin:prettier/recommended',
18-
],
14+
extends: ['eslint:recommended', 'plugin:ember/recommended', 'plugin:prettier/recommended'],
1915
env: {
2016
browser: true,
2117
},

.github/ISSUE_TEMPLATE/bug_report.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
labels:
5-
4+
labels:
65
---
76

87
**Describe the bug**
98
A clear and concise description of what the bug is.
109

1110
**To Reproduce**
1211
Steps to reproduce the behavior:
12+
1313
1. Go to '...'
1414
2. Click on '....'
1515
3. Scroll down to '....'

.github/workflows/github_ci.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ name: build
66
on:
77
workflow_dispatch:
88
push:
9-
branches: [ master ]
9+
branches: [master]
1010
pull_request:
11-
branches: [ master ]
11+
branches: [master]
1212

1313
jobs:
1414
main-test:
@@ -34,11 +34,7 @@ jobs:
3434
strategy:
3535
fail-fast: false
3636
matrix:
37-
scenario: [
38-
ember-lts-3.20,
39-
ember-lts-3.24,
40-
ember-lts-3.28,
41-
]
37+
scenario: [ember-lts-3.20, ember-lts-3.24, ember-lts-3.28]
4238
steps:
4339
- uses: actions/checkout@v2
4440
- name: Use Node.js 12

.prettierrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
module.exports = {
44
singleQuote: true,
5+
printWidth: 120,
56
};

CHANGELOG.md

+183-108
Large diffs are not rendered by default.

CONTRIBUTING.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22

33
## Installation
44

5-
* `git clone <repository-url>`
6-
* `cd ember-sortable`
7-
* `yarn install`
5+
- `git clone <repository-url>`
6+
- `cd ember-sortable`
7+
- `yarn install`
88

99
## Linting
1010

11-
* `yarn lint:hbs`
12-
* `yarn lint:js`
13-
* `yarn lint:js --fix`
11+
- `yarn lint:hbs`
12+
- `yarn lint:js`
13+
- `yarn lint:js --fix`
1414

1515
## Running tests
1616

17-
* `ember test` – Runs the test suite on the current Ember version
18-
* `ember test --server` – Runs the test suite in "watch mode"
19-
* `ember try:each` – Runs the test suite against multiple Ember versions
17+
- `ember test` – Runs the test suite on the current Ember version
18+
- `ember test --server` – Runs the test suite in "watch mode"
19+
- `ember try:each` – Runs the test suite against multiple Ember versions
2020

2121
## Running the dummy application
2222

23-
* `ember serve`
24-
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).
23+
- `ember serve`
24+
- Visit the dummy application at [http://localhost:4200](http://localhost:4200).
2525

26-
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
26+
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).

MIGRATION_GUIDE_MODIFIERS.md

+20-13
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,20 @@
55
To use modifiers, you must use angle-bracket syntax
66

77
### New Root component
8-
1. Instead of using `sortable-group` as a component, use `sortable-group` as a modifier
9-
any element. You no longer need to tell `sortable-group` about the models, so the `each`
10-
uses the models directly.
8+
9+
1. Instead of using `sortable-group` as a component, use `sortable-group` as a modifier
10+
any element. You no longer need to tell `sortable-group` about the models, so the `each`
11+
uses the models directly.
1112

1213
**Old Component**
14+
1315
```hbs
1416
{{#sortable-group model=model.items onChange=(action "reorderItems") as |group|}}
1517
{{#each group.model as |item|}}
1618
```
19+
1720
**New Component**
21+
1822
```hbs
1923
<ol {{sortable-group onChange=(action "reorderItems")}}>
2024
{{#each model.items as |item|}}
@@ -23,19 +27,21 @@ uses the models directly.
2327
2. Each `item` can be represented by any dom element or component using angle-bracket syntax
2428

2529
**Old Component**
30+
2631
```hbs
27-
{{#sortable-group model=model.items onChange=(action "reorderItems") as |group|}}
32+
{{#sortable-group model=model.items onChange=(action 'reorderItems') as |group|}}
2833
{{#each group.model as |item|}}
2934
{{#group.item model=item}}
30-
{{tem.name}}
35+
{{tem.name}}
3136
{{/group.item}}
3237
{{/each}}
3338
{{/sortable-group}}
3439
```
3540

3641
**New Component with modifier**
42+
3743
```hbs
38-
<ol {{sortable-group onChange=(action "reorderItems")}}>
44+
<ol {{sortable-group onChange=(action 'reorderItems')}}>
3945
{{#each model.items as |item|}}
4046
<li {{sortable-item model=item}}>
4147
{{tem.name}}
@@ -47,6 +53,7 @@ uses the models directly.
4753
3. The Handle is also any element with a `sortable-handle` applied to it.
4854

4955
**Old Component**
56+
5057
```hbs
5158
{{#sortable-group model=model.items onChange=(action "reorderItems") as |group|}}
5259
{{#each group.model as |modelItem|}}
@@ -61,28 +68,28 @@ uses the models directly.
6168
```
6269

6370
**New Component with modifier**
71+
6472
```hbs
65-
<ol {{sortable-group onChange=(action "reorderItems")}}>
73+
<ol {{sortable-group onChange=(action 'reorderItems')}}>
6674
{{#each model.items as |item|}}
6775
<li {{sortable-item model=item}}>
6876
{{tem.name}}
69-
<span class="handle" {{sortable-handle}}>&varr;</span>
77+
<span class='handle' {{sortable-handle}}>&varr;</span>
7078
</li>
7179
{{/each}}
7280
</ol>
7381
```
7482

75-
4. The modifier `groupModel` property is no longer supported. The equivalent can
76-
be accomplished by the `action` helper or the new `fn` helper.
83+
4. The modifier `groupModel` property is no longer supported. The equivalent can
84+
be accomplished by the `action` helper or the new `fn` helper.
7785

7886
```hbs
79-
<ol {{sortable-group onChange=(action "reorderItems" model)}}>
87+
<ol {{sortable-group onChange=(action 'reorderItems' model)}}>
8088
{{#each model.items as |item|}}
8189
<li {{sortable-item model=item}}>
8290
{{tem.name}}
83-
<span class="handle" {{sortable-handle}}>&varr;</span>
91+
<span class='handle' {{sortable-handle}}>&varr;</span>
8492
</li>
8593
{{/each}}
8694
</ol>
8795
```
88-

MIGRATION_GUIDE_V2.md

+20-8
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,20 @@
55
[High Order Components](#Higher Order Components) or [Modifiers](/MIGRATION_GUIDE_MODIFIERS.md)
66

77
### Higher Order Components
8+
89
`Ember-sortable` can now be built using [higher order components](https://v4.chriskrycho.com/2018/higher-order-components-in-emberjs.html)
910

1011
1. The array of models are now yielded out by `sortable-group`
1112

1213
**V1**
14+
1315
```hbs
1416
{{#sortable-group onChange=(action "reorderItems") as |group|}}
1517
{{#each model.items as |item|}}
1618
```
19+
1720
**V2**
21+
1822
```hbs
1923
{{#sortable-group model=model.items onChange=(action "reorderItems") as |group|}}
2024
{{#each group.model as |item|}}
@@ -23,23 +27,25 @@
2327
2. Each `item` can be represented by the yielded `sortable-item` instead of directly using `sortable-item` and passing the `group` manually.
2428

2529
**V1**
30+
2631
```hbs
27-
{{#sortable-group onChange=(action "reorderItems") as |group|}}
32+
{{#sortable-group onChange=(action 'reorderItems') as |group|}}
2833
{{#each model.items as |item|}}
29-
{{#sortable-item model=item group=group handle=".handle"}}
34+
{{#sortable-item model=item group=group handle='.handle'}}
3035
{{item.name}}
31-
<span class="handle">&varr;</span>
36+
<span class='handle'>&varr;</span>
3237
{{/sortable-item}}
3338
{{/each}}
3439
{{/sortable-group}}
3540
```
3641

3742
**V2**
43+
3844
```hbs
39-
{{#sortable-group model=model.items onChange=(action "reorderItems") as |group|}}
45+
{{#sortable-group model=model.items onChange=(action 'reorderItems') as |group|}}
4046
{{#each group.model as |item|}}
4147
{{#group.item model=item}}
42-
...
48+
...
4349
{{/group.item}}
4450
{{/each}}
4551
{{/sortable-group}}
@@ -48,18 +54,20 @@
4854
3. It is recommended to use the yielded `sortable-handle` instead of referencing `handle` by `class`, as it guarantees accessibility support.
4955

5056
**V1**
57+
5158
```hbs
52-
{{#sortable-group onChange=(action "reorderItems") as |group|}}
59+
{{#sortable-group onChange=(action 'reorderItems') as |group|}}
5360
{{#each model.items as |item|}}
54-
{{#sortable-item model=item group=group handle=".handle"}}
61+
{{#sortable-item model=item group=group handle='.handle'}}
5562
{{item.name}}
56-
<span class="handle">&varr;</span>
63+
<span class='handle'>&varr;</span>
5764
{{/sortable-item}}
5865
{{/each}}
5966
{{/sortable-group}}
6067
```
6168

6269
**V2**
70+
6371
```hbs
6472
{{#sortable-group model=model.items onChange=(action "reorderItems") as |group|}}
6573
{{#each group.model as |modelItem|}}
@@ -76,6 +84,7 @@
7684
4. `groupModel` is still supported via `groupModel` instead of `model`
7785

7886
**V1**
87+
7988
```hbs
8089
{{#sortable-group model=model onChange=(action "reorderItems") as |group|}}
8190
{{#each model.items as |item|}}
@@ -84,6 +93,7 @@
8493
```
8594

8695
**V2**
96+
8797
```hbs
8898
{{#sortable-group groupModel=model model=model.items onChange=(action "reorderItems") as |group|}}
8999
{{#each group.model as |item|}}
@@ -94,6 +104,7 @@
94104
### Modifiers
95105

96106
### Accessibility support
107+
97108
1. Keyboard navigation is built into `ember-sortable`.
98109
2. `a11yItemName`, `a11yAnnouncementConfig`, `itemVisualClass`, `handleVisualClass` can be supplied to enhance the accessibility experience.
99110
3. Refer to [Accessibility Section](/README.md#Accessibility) for more details.
@@ -103,6 +114,7 @@
103114
```
104115

105116
### Testing
117+
106118
1. The `drag` and `reorder` test helpers are no longer global `async` helpers. They are now importable.
107119

108120
Refer to [Testing Section](/README.md#Testing) for more details.

0 commit comments

Comments
 (0)