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

chore(lint): update ESLInt and Prettier #213

Merged
merged 1 commit into from
Nov 13, 2023
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
chore(lint): update ESLInt and Prettier
  • Loading branch information
jledentu committed Nov 13, 2023
commit 98ff695fc50898ce50001e1841e2608d69faf08e
2 changes: 1 addition & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {

async viteFinal(config) {
const { config: userConfig } = await loadConfigFromFile(
path.resolve(__dirname, "../vite.config.js")
path.resolve(__dirname, "../vite.config.js"),
);

return {
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,20 @@
"core-js": "^2",
"cz-conventional-changelog": "^3.1.0",
"dot": "^1.1.3",
"eslint": "^8.11.0",
"eslint-config-prettier": "^8.5.0",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-custom-alias": "^1.3.2",
"eslint-import-resolver-webpack": "^0.13.2",
"eslint-plugin-html": "^6.2.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-prettier": "^4.0.0",
"eslint-import-resolver-webpack": "^0.13.8",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-storybook": "^0.6.15",
"eslint-plugin-vue": "^8.5.0",
"eslint-plugin-vue": "^9.18.1",
"happy-dom": "^12.10.3",
"husky": "^4.2.3",
"jest-serializer-vue": "^3.1.0",
"lint-staged": "^10.0.7",
"prettier": "^2.5.1",
"prettier": "^3.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^2.70.1",
Expand Down
4 changes: 2 additions & 2 deletions src/components/Finder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function renderTree(h, context, item) {
}

const expandedChild = item.children.find((child) =>
context.treeModel.isNodeExpanded(child.id)
context.treeModel.isNodeExpanded(child.id),
);

const options = {
Expand Down Expand Up @@ -413,7 +413,7 @@ export default {
duration,
scrollLeft,
scrollDistance,
scrollDuration
scrollDuration,
);
window.requestAnimationFrame(step);
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/FinderItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default {
if (newValue && this.canDrop && !this.node.isLeaf) {
this.dragOverTimeout = setTimeout(
() => this.treeModel.expandNode(this.node.id, "dragover"),
500
500,
);
} else {
if (this.dragOverTimeout) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/FinderList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default {
expandedItemIndex() {
return Math.max(
0,
this.items.findIndex((item) => this.treeModel.isNodeExpanded(item.id))
this.items.findIndex((item) => this.treeModel.isNodeExpanded(item.id)),
);
},
},
Expand Down
8 changes: 4 additions & 4 deletions src/components/__tests__/FinderItem.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ describe("FinderItem", () => {
expect(dataTransfer.setDragImage).not.toHaveBeenCalled();
expect(dataTransfer.setData).toHaveBeenCalledWith(
"text/plain",
"test111"
"test111",
);
expect(treeModel.startDrag).toHaveBeenCalledWith("test111");
});
Expand All @@ -229,7 +229,7 @@ describe("FinderItem", () => {
expect(dataTransfer.setDragImage).not.toHaveBeenCalled();
expect(dataTransfer.setData).toHaveBeenCalledWith(
"text/plain",
"test111"
"test111",
);
expect(treeModel.startDrag).toHaveBeenCalledWith("test111");
});
Expand Down Expand Up @@ -290,7 +290,7 @@ describe("FinderItem", () => {
expect(dataTransfer.setDragImage).toHaveBeenCalledWith(
ghost.vm.$el,
0,
0
0,
);
});
});
Expand All @@ -314,7 +314,7 @@ describe("FinderItem", () => {

expect(treeModel.expandNode).toHaveBeenCalledWith(
"test111",
"dragover"
"dragover",
);
});

Expand Down
6 changes: 3 additions & 3 deletions src/utils/__tests__/tree-model.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe("TreeModel", () => {
{
id: "test12",
},
]
],
);
expect(model.isNodeSelected("test12")).toBe(true);
});
Expand Down Expand Up @@ -415,7 +415,7 @@ describe("TreeModel", () => {
{ id: "test11" },
{ id: "test112" },
{ id: "test12" },
]
],
);
expect(onMove).toHaveBeenCalledWith({
moved: "test12",
Expand Down Expand Up @@ -462,7 +462,7 @@ describe("TreeModel", () => {
expect(onExpand).toHaveBeenCalledWith(
["test1", "test11", "test12"],
"drop",
[{ id: "test1" }, { id: "test11" }, { id: "test12" }]
[{ id: "test1" }, { id: "test11" }, { id: "test12" }],
);
expect(onMove).toHaveBeenCalledWith({
moved: "test12",
Expand Down
6 changes: 3 additions & 3 deletions src/utils/__tests__/tree-utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe("Tree Utils", () => {
id: "test12",
},
],
})
}),
).toEqual({
test1: {
id: "test1",
Expand Down Expand Up @@ -143,13 +143,13 @@ describe("Tree Utils", () => {

it("should return the filtered nodes", () => {
expect(
sortBy(getFilteredNodes((node) => node.keep, "test1", nodesMap))
sortBy(getFilteredNodes((node) => node.keep, "test1", nodesMap)),
).toEqual(["test1", "test11", "test112", "test12"]);
});

it("should return [] if no node matches", () => {
expect(
getFilteredNodes((node) => node.id === "notfound", "test1", nodesMap)
getFilteredNodes((node) => node.id === "notfound", "test1", nodesMap),
).toEqual([]);
});
});
Expand Down
14 changes: 7 additions & 7 deletions src/utils/tree-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default class extends EventManager {
parent.children = differenceBy(
parent.children || [],
[node],
({ id }) => id
({ id }) => id,
);
}
}
Expand Down Expand Up @@ -102,7 +102,7 @@ export default class extends EventManager {
.map((child) =>
this._computeVisibleTree(child.id, {
expanded,
})
}),
)
: [],
isLeaf: children.length === 0,
Expand Down Expand Up @@ -135,7 +135,7 @@ export default class extends EventManager {
"expand",
this.expanded,
sourceEvent,
this.expanded.map((id) => this._getNodeData(id))
this.expanded.map((id) => this._getNodeData(id)),
);
}

Expand All @@ -151,17 +151,17 @@ export default class extends EventManager {
? getFilteredNodes(
(node) => node.selectable !== false,
nodeId,
this.nodesMap
this.nodesMap,
)
: [nodeId];
this.selected = (isSelected ? union : difference)(
this.selected,
nodeIdsToSelect
nodeIdsToSelect,
);
this.trigger(
"select",
this.selected,
this.selected.map((id) => this._getNodeData(id))
this.selected.map((id) => this._getNodeData(id)),
);
}

Expand Down Expand Up @@ -277,7 +277,7 @@ export default class extends EventManager {
this.filtered = getFilteredNodes(
this._filter,
this.root.id,
this.nodesMap
this.nodesMap,
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion stories/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function createChildren(parentId, parentLabel, parentIndex, parentDepth) {
`${parentId}-${index + 1}`,
`${parentLabel} > ${index + 1}`,
index,
parentDepth + 1
parentDepth + 1,
)
: [],
});
Expand Down
Loading
Loading