Skip to content

Commit 2372e8f

Browse files
committed
chore: pnpm lint:fix
1 parent 84cd85f commit 2372e8f

9 files changed

Lines changed: 96 additions & 52 deletions

File tree

babel.config.cjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ const macros = buildMacros();
1616
const isCompat = Boolean(process.env.ENABLE_COMPAT_BUILD);
1717

1818
module.exports = {
19-
presets: [['@babel/preset-typescript', { allowDeclareFields: true, allExtensions: true }]],
19+
presets: [
20+
[
21+
'@babel/preset-typescript',
22+
{ allowDeclareFields: true, allExtensions: true },
23+
],
24+
],
2025
plugins: [
2126
[
2227
'babel-plugin-ember-template-compilation',

babel.publish.config.cjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
* For local dev experience, see the babel.config
55
*/
66
module.exports = {
7-
presets: [['@babel/preset-typescript', { allowDeclareFields: true, allExtensions: true }]],
7+
presets: [
8+
[
9+
'@babel/preset-typescript',
10+
{ allowDeclareFields: true, allExtensions: true },
11+
],
12+
],
813
plugins: [
914
[
1015
'babel-plugin-ember-template-compilation',

demo-app/templates/application.gts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
import type { TemplateOnlyComponent } from '@ember/component/template-only';
22

3-
export default <template>{{outlet}}</template> satisfies TemplateOnlyComponent<{ Args: { model: unknown, controller: unknown } }>
3+
export default <template>{{outlet}}</template> satisfies TemplateOnlyComponent<{
4+
Args: { model: unknown; controller: unknown };
5+
}>;

demo-app/templates/index.gts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ import NestedItem from '../components/nested-item';
247247
<h2>Source only list</h2>
248248

249249
<p>
250-
Use `sourceOnly` to prevent the user from rearranging or dragging into the
251-
list. Effectively, it is marked as immutable, and only used as a source
252-
bucket for other lists.
250+
Use `sourceOnly` to prevent the user from rearranging or dragging into
251+
the list. Effectively, it is marked as immutable, and only used as a
252+
source bucket for other lists.
253253
</p>
254254

255255
<p>
@@ -302,16 +302,16 @@ import NestedItem from '../components/nested-item';
302302
</p>
303303

304304
<p>
305-
Unfortunately, this doesn't work with HTML tables because table semantics
306-
are very restrictive. To work around this problem, top/bottom padding on
307-
table cells can be used instead of selectors.
305+
Unfortunately, this doesn't work with HTML tables because table
306+
semantics are very restrictive. To work around this problem, top/bottom
307+
padding on table cells can be used instead of selectors.
308308
</p>
309309

310310
<p>
311311
This is not a great solution because padding appears
312312
<em>inside</em>
313-
table cells. If you want your cells to have borders, you'll have to apply
314-
them to inner elements instead.
313+
table cells. If you want your cells to have borders, you'll have to
314+
apply them to inner elements instead.
315315
</p>
316316

317317
<p>

src/components/drag-sort-item.gts

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,28 @@ interface DragSortItemSignature<Item extends object> {
4040

4141
export default class DragSortItem<Item extends object> extends Component<
4242
DragSortItemSignature<Item>
43-
> {<template>{{#let (element (if @tagName @tagName "div")) as |Tag|}}
44-
<Tag class="dragSortItem
45-
{{@index}}
46-
{{this.dragSort.targetIndex}}
47-
{{if this.isDraggingOver "-isDraggingOver"}}
48-
{{if this._isDragged "-isDragged"}}
49-
{{if this.shouldShowPlaceholderBefore "-placeholderBefore"}}
50-
{{if this.shouldShowPlaceholderAfter "-placeholderAfter"}}" draggable={{this.draggable}} {{on "dragstart" this.dragStart}} {{on "dragend" this.dragEnd}} {{on "dragover" this.dragOver}} {{on "drop" this.drop}} ...attributes>
51-
{{yield}}
52-
</Tag>
53-
{{/let}}</template>
43+
> {
44+
<template>
45+
{{#let (element (if @tagName @tagName "div")) as |Tag|}}
46+
<Tag
47+
class="dragSortItem
48+
{{@index}}
49+
{{this.dragSort.targetIndex}}
50+
{{if this.isDraggingOver '-isDraggingOver'}}
51+
{{if this._isDragged '-isDragged'}}
52+
{{if this.shouldShowPlaceholderBefore '-placeholderBefore'}}
53+
{{if this.shouldShowPlaceholderAfter '-placeholderAfter'}}"
54+
draggable={{this.draggable}}
55+
{{on "dragstart" this.dragStart}}
56+
{{on "dragend" this.dragEnd}}
57+
{{on "dragover" this.dragOver}}
58+
{{on "drop" this.drop}}
59+
...attributes
60+
>
61+
{{yield}}
62+
</Tag>
63+
{{/let}}
64+
</template>
5465
@service declare dragSort: DragSort<Item>;
5566

5667
declare el: HTMLElement;

src/components/drag-sort-list.gts

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,48 @@ interface DragSortListSignature<Item extends object> {
3434

3535
export default class DragSortList<Item extends object> extends Component<
3636
DragSortListSignature<Item>
37-
> {<template>{{#let (element (if @tagName @tagName "div")) as |Tag|}}
38-
<Tag class="dragSortList
39-
{{if this.draggingEnabled "-draggingEnabled"}}
40-
{{if this.isDragging "-isDragging"}}
41-
{{if this.isDraggingOver "-isDraggingOver"}}
42-
{{if this.isEmpty "-isEmpty"}}
43-
{{if this.isExpanded "-isExpanded"}}
44-
{{if @isHorizontal "-horizontal"}}
45-
{{if @isRtl "-rtl"}}
46-
{{if this.isVertical "-vertical"}}
47-
{{if this.sourceOnly "-sourceOnlyList"}}" {{on "dragenter" this.dragEnter}} {{on "dragover" this.dragOver}} ...attributes>
48-
{{#each @items as |item index|}}
49-
<DragSortItem @additionalArgs={{@additionalArgs}} @determineForeignPositionAction={{@determineForeignPositionAction}} @draggingEnabled={{this.draggingEnabled}} @dragEndAction={{@dragEndAction}} @dragStartAction={{@dragStartAction}} @group={{@group}} @handle={{@handle}} @index={{index}} @isHorizontal={{@isHorizontal}} @isRtl={{@isRtl}} @item={{item}} @items={{@items}} @sourceOnly={{this.sourceOnly}} @tagName={{@childTagName}} class={{@childClass}}>
50-
{{yield item index}}
51-
</DragSortItem>
52-
{{/each}}
53-
</Tag>
54-
{{/let}}</template>
37+
> {
38+
<template>
39+
{{#let (element (if @tagName @tagName "div")) as |Tag|}}
40+
<Tag
41+
class="dragSortList
42+
{{if this.draggingEnabled '-draggingEnabled'}}
43+
{{if this.isDragging '-isDragging'}}
44+
{{if this.isDraggingOver '-isDraggingOver'}}
45+
{{if this.isEmpty '-isEmpty'}}
46+
{{if this.isExpanded '-isExpanded'}}
47+
{{if @isHorizontal '-horizontal'}}
48+
{{if @isRtl '-rtl'}}
49+
{{if this.isVertical '-vertical'}}
50+
{{if this.sourceOnly '-sourceOnlyList'}}"
51+
{{on "dragenter" this.dragEnter}}
52+
{{on "dragover" this.dragOver}}
53+
...attributes
54+
>
55+
{{#each @items as |item index|}}
56+
<DragSortItem
57+
@additionalArgs={{@additionalArgs}}
58+
@determineForeignPositionAction={{@determineForeignPositionAction}}
59+
@draggingEnabled={{this.draggingEnabled}}
60+
@dragEndAction={{@dragEndAction}}
61+
@dragStartAction={{@dragStartAction}}
62+
@group={{@group}}
63+
@handle={{@handle}}
64+
@index={{index}}
65+
@isHorizontal={{@isHorizontal}}
66+
@isRtl={{@isRtl}}
67+
@item={{item}}
68+
@items={{@items}}
69+
@sourceOnly={{this.sourceOnly}}
70+
@tagName={{@childTagName}}
71+
class={{@childClass}}
72+
>
73+
{{yield item index}}
74+
</DragSortItem>
75+
{{/each}}
76+
</Tag>
77+
{{/let}}
78+
</template>
5579
@service declare dragSort: DragSort<Item>;
5680

5781
declare el: HTMLElement;

tests/integration/components/drag-sort-targetindex-regression-test.gjs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { module, test } from 'qunit';
22
import { setupRenderingTest } from 'ember-qunit';
33
import { findAll, render, triggerEvent } from '@ember/test-helpers';
4-
import DragSortList from "ember-drag-sort/components/drag-sort-list";
4+
import DragSortList from 'ember-drag-sort/components/drag-sort-list';
55

66
module(
77
'Integration | Component | drag-sort targetIndex regression test',
@@ -20,11 +20,13 @@ module(
2020

2121
this.setProperties({ items });
2222

23-
await render(<template>
24-
<DragSortList @items={{this.items}} @group="test" as |item|>
25-
<div class="the-item">{{item.name}}</div>
26-
</DragSortList>
27-
</template>);
23+
await render(
24+
<template>
25+
<DragSortList @items={{this.items}} @group="test" as |item|>
26+
<div class="the-item">{{item.name}}</div>
27+
</DragSortList>
28+
</template>,
29+
);
2830

2931
const dragSort = this.owner.lookup('service:drag-sort');
3032
const itemElements = findAll('.dragSortItem');

tsconfig.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
"ember-drag-sort/*": ["./src/*"],
1818
"#src/*": ["./src/*"]
1919
},
20-
"types": [
21-
"ember-source/types",
22-
"vite/client",
23-
"@embroider/core/virtual"
24-
]
20+
"types": ["ember-source/types", "vite/client", "@embroider/core/virtual"]
2521
}
2622
}

vite.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export default defineConfig({
1919
input: {
2020
tests: 'tests/index.html',
2121
},
22-
2322
},
2423
},
2524
});

0 commit comments

Comments
 (0)