Skip to content

Commit 8d4cf7f

Browse files
committed
Fix linting finally
1 parent f41bd79 commit 8d4cf7f

8 files changed

Lines changed: 8 additions & 53 deletions

File tree

.eslintrc.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ module.exports = {
55
},
66
extends: [
77
"plugin:vue/recommended",
8-
"@vue/airbnb",
98
"@vue/typescript/recommended",
109

1110
"@vue/prettier/recommended",
@@ -14,17 +13,7 @@ module.exports = {
1413
rules: {
1514
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
1615
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
17-
"no-restricted-syntax": [
18-
"off",
19-
{
20-
selector: "ForOfStatement",
21-
},
22-
],
23-
// Why the heck is this not default airbnb
24-
"no-plusplus": ["error", { allowForLoopAfterthoughts: true }],
25-
// Broken with typescript (still)
26-
"no-unused-vars": "off",
27-
"no-continue": "off",
28-
"no-multi-assign": "off",
16+
"@typescript-eslint/no-non-null-assertion": "off",
17+
"@typescript-eslint/no-explicit-any": "off",
2918
},
3019
};

src/components/baklava-options-plugin/optionPlugin.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable import/no-unresolved, import/extensions */
21
/*
32
Eslint has problems with importing ts modules for some reason &
43
the setting that's supposed to fix it doesn't work:

src/components/node-editor/ContextMenuOpsi.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
</template>
3030

3131
<script lang="ts">
32-
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
32+
import { Component, Vue } from "vue-property-decorator";
3333
import { Components } from "@baklavajs/plugin-renderer-vue";
3434
3535
import ClickOutside from "v-click-outside";
@@ -40,7 +40,8 @@ import ClickOutside from "v-click-outside";
4040
},
4141
})
4242
export default class ContextMenu extends Components.ContextMenu {
43-
onClickOutside(event: MouseEvent) {
43+
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
44+
onClickOutside(e: MouseEvent) {
4445
if (this.value) {
4546
this.$emit("input", false);
4647
}
@@ -54,6 +55,7 @@ export default class ContextMenu extends Components.ContextMenu {
5455
isActive: true,
5556
};
5657
58+
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
5759
onContextOutside(e: MouseEvent) {
5860
if (this.value) {
5961
this.$emit("input", false);

src/components/node-editor/EditorOpsi.vue

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,8 @@
5555
<script lang="ts">
5656
import { Component, Watch } from "vue-property-decorator";
5757
58-
// eslint-disable-next-line import/no-unresolved, import/extensions
59-
import {
60-
IEditor,
61-
INode,
62-
ITransferConnection,
63-
INodeInterface,
64-
ITemporaryConnection,
65-
TemporaryConnectionState,
66-
// eslint-disable-next-line import/no-unresolved, import/extensions
67-
} from "@baklavajs/core/dist/baklavajs-core/types";
6858
import { Editor } from "@baklavajs/plugin-renderer-vue";
69-
// eslint-disable-next-line import/no-unresolved, import/extensions
7059
import { IMenuItem } from "@baklavajs/plugin-renderer-vue/dist/baklavajs-plugin-renderer-vue/src/components/ContextMenu.vue";
71-
// eslint-disable-next-line import/no-unresolved, import/extensions
7260
import { IViewNode } from "@baklavajs/plugin-renderer-vue/dist/baklavajs-plugin-renderer-vue/types";
7361
7462
@Component

src/components/node-editor/NodeOpsi.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ import { Component } from "vue-property-decorator";
109109
110110
import { Components } from "@baklavajs/plugin-renderer-vue";
111111
112-
// eslint-disable-next-line import/no-unresolved, import/extensions
113112
import { IViewNode } from "@baklavajs/plugin-renderer-vue/dist/baklavajs-plugin-renderer-vue/types";
114113
115114
@Component
@@ -172,8 +171,6 @@ export default class NodeViewOpsi extends Components.Node {
172171
// Set the node options based on the original node
173172
for (const option of Object.entries(nodeSave.options)) {
174173
const [name, value] = option[1];
175-
176-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
177174
node.setOptionValue(name, value);
178175
}
179176

src/components/node-editor/nodeTreeSerialize.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Connection, Editor, NodeInterface, NodeOption, Node } from "@baklavajs/core";
22
import { Input, Link, Nodetree } from "@/api/nodeSchema";
33
import { ViewPlugin } from "@baklavajs/plugin-renderer-vue";
4-
// eslint-disable-next-line import/no-unresolved, import/extensions
54
import { IViewNode } from "@baklavajs/plugin-options-vue/dist/baklavajs-plugin-renderer-vue/types";
65

76
function linkFromNodeInterface(intf: NodeInterface): Link {
@@ -80,9 +79,7 @@ export function saveNodetree(editor: Editor, view: ViewPlugin): Nodetree {
8079
}
8180

8281
export function loadNodeTree(editor: Editor, view: ViewPlugin, nodetree: Nodetree) {
83-
// eslint-disable-next-line no-param-reassign
8482
view.panning = nodetree.extras.panning ?? view.panning;
85-
// eslint-disable-next-line no-param-reassign
8683
view.scaling = nodetree.extras.scaling ?? view.scaling;
8784

8885
for (let i = editor.connections.length - 1; i >= 0; i--) {
@@ -111,13 +108,11 @@ export function loadNodeTree(editor: Editor, view: ViewPlugin, nodetree: Nodetre
111108
nodeMap.set(node.id, node);
112109

113110
for (const [name, value] of Object.entries(n.settings)) {
114-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
115111
node.options.get(name)!.value = value;
116112
}
117113

118114
for (const [name, value] of Object.entries(n.inputs)) {
119115
if (value.value) {
120-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
121116
node.interfaces.get(`in-${name}`)!.value = value.value;
122117
} else if (value.link) {
123118
const arr = linkMap.get(node) ?? [];
@@ -137,7 +132,6 @@ export function loadNodeTree(editor: Editor, view: ViewPlugin, nodetree: Nodetre
137132
for (const [node, linkArr] of linkMap) {
138133
for (const { fromName, fromId, toName } of linkArr) {
139134
const toInterface = node.getInterface(toName);
140-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
141135
const fromInterface = nodeMap.get(fromId)!.getInterface(fromName);
142136

143137
editor.addConnection(fromInterface, toInterface);

src/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import "@/styles/node.scss";
88

99
import App from "@/App.vue";
1010

11-
// eslint-disable-next-line
12-
import vClickOutside from "v-click-outside"
11+
import vClickOutside from "v-click-outside";
1312

1413
Vue.use(vClickOutside);
1514

src/views/Editor.vue

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ export default Vue.extend({
2727
};
2828
},
2929
async created() {
30-
/* eslint-disable @typescript-eslint/no-explicit-any */
3130
this.viewPlugin.components.node = NodeOpsi as any;
3231
this.viewPlugin.components.nodeInterface = NodeInterfaceOpsi as any;
3332
this.viewPlugin.components.contextMenu = ContextMenuOpsi as any;
34-
/* eslint-enable @typescript-eslint/no-explicit-any */
3533
3634
this.editor.use(this.viewPlugin);
3735
this.editor.use(this.interfacePlugin);
@@ -57,8 +55,6 @@ export default Vue.extend({
5755
});
5856
5957
const nodetree = await getNodetree();
60-
// eslint-disable-next-line no-console
61-
console.log(nodetree);
6258
loadNodeTree(this.editor, this.viewPlugin, nodetree);
6359
6460
this.editor.nodes.forEach((node) => {
@@ -77,16 +73,7 @@ export default Vue.extend({
7773
},
7874
methods: {
7975
async save() {
80-
const updatedNodetree = saveNodetree(this.editor, this.viewPlugin);
81-
// eslint-disable-next-line no-console
82-
console.log(updatedNodetree);
83-
// eslint-disable-next-line no-console
84-
console.log(JSON.stringify(updatedNodetree));
85-
86-
// eslint-disable-next-line no-console
87-
console.log(await postNodetree(updatedNodetree));
88-
// eslint-disable-next-line no-console
89-
console.log(await getNodetree());
76+
return postNodetree(saveNodetree(this.editor, this.viewPlugin));
9077
},
9178
},
9279
});

0 commit comments

Comments
 (0)