Skip to content

Commit

Permalink
fix: eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhnm committed Oct 7, 2024
1 parent 044b16f commit 554f5ea
Show file tree
Hide file tree
Showing 17 changed files with 48 additions and 48 deletions.
5 changes: 1 addition & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@
"switches": "never"
}
],
"@stylistic/indent": [
"error",
4
],
"@stylistic/indent": "off",
"@stylistic/semi": [
"error",
"always"
Expand Down
1 change: 0 additions & 1 deletion apps/miranum-config-editor-webview/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { createResolver } from "./composables/utils";
//
declare const process: { env: { NODE_ENV: string } };
// eslint-disable-next-line react-hooks/rules-of-hooks
const theme = useTheme();
const renderers = [...vuetifyRenderers];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class VsCodeMock implements VsCode {
case MessageType.syncDocument: {
console.log(
"[Log] Send data to the backend...",
JSON.parse(payload?.data ?? '{ "data": "No data"}"'),
JSON.parse(payload?.data ?? `{ "data": "No data"}"`),
);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/miranum-config-editor/src/adapter/adapterIn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
SyncDocumentCommand,
SyncDocumentInPort,
SyncWebviewCommand,
SyncWebviewInPort
SyncWebviewInPort,
} from "../application/portsIn";
import { ConfigEditorData, MessageType, VscMessage } from "@miranum-ide/vscode/shared/miranum-config-editor";

Expand Down
2 changes: 1 addition & 1 deletion apps/miranum-config-editor/src/application/usecases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
SyncDocumentCommand,
SyncDocumentInPort,
SyncWebviewCommand,
SyncWebviewInPort
SyncWebviewInPort,
} from "./portsIn";
import { DocumentOutPort, ReaderOutPort, VsCodeConfigOutPort, WebviewOutPort } from "./portsOut";
import { ConfigEditorData, MessageType, VscMessage } from "@miranum-ide/vscode/shared/miranum-config-editor";
Expand Down
7 changes: 6 additions & 1 deletion apps/miranum-console-webview/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
"*.js",
"*.jsx"
],
"rules": {}
"rules": {
"@stylistic/jsx-indent-props": [
"error",
4
]
}
},
{
"files": [
Expand Down
1 change: 0 additions & 1 deletion apps/miranum-console-webview/src/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export function App() {
<ThemeProvider theme={theme}>
<Container component="main" maxWidth="xs">
<CssBaseline />
{/* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */}
{view === "generateFile" && (
<GenerateInput
currentPath={currentPath}
Expand Down
4 changes: 2 additions & 2 deletions apps/miranum-console/src/app/shared/fs-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export async function getArtifact(
const file = path.fsPath.substring(path.fsPath.lastIndexOf("/") + 1).split(".");

return {
//type = extension => .json has to be renamed
// type = extension => .json has to be renamed
type: file[1],
project: projectName ?? "",
file: {
Expand All @@ -103,7 +103,7 @@ export async function getArtifacts(
for (const file of files) {
const filePath = vscode.Uri.file(path.fsPath + "/" + file[0]);
if (file[1] !== 1) {
//going through sub-folders
// going through sub-folders
artifacts.push(...(await getArtifacts(filePath, projectName)));
} else {
artifacts.push(await getArtifact(filePath, projectName));
Expand Down
8 changes: 2 additions & 6 deletions apps/miranum-console/src/app/vscode/MiranumTreeItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@ export class FolderItem extends TreeItem {
/**
* @override
*/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
public readonly label: string;
public override readonly label: string;

/**
* @override
*/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
public readonly collapsibleState: TreeItemCollapsibleState;
public override readonly collapsibleState: TreeItemCollapsibleState;

/**
* The URI of the directory or file.
Expand Down
4 changes: 3 additions & 1 deletion apps/miranum-jsonforms-builder-webview/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"@vue/eslint-config-prettier/skip-formatting"
],
"ignorePatterns": [
"!**/*"
"!**/*",
"tailwind.config.js",
"postcss.config.js"
],
"parser": "vue-eslint-parser",
"parserOptions": {
Expand Down
1 change: 0 additions & 1 deletion apps/miranum-jsonforms-preview-webview/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const displayData = ref<any | undefined>(undefined);
const displayErrors = ref<any | undefined>(undefined);
let loading = true;
// eslint-disable-next-line react-hooks/rules-of-hooks
const theme = useTheme();
let jsonComponentTheme = ref<"light" | "dark">("light");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const formBuilder = {
"options.placeholder.label": "Platzhalter",
"options.placeholder.description":
"ACHTUNG: Platzhalter können derzeit noch nicht übersetzt werden",
"pattern.description": 'zB: "[abc]+"',
"pattern.description": `zB: "[abc]+"`,
"oneOf.const.label": "Name",
"oneOf.title.label": "Title",
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ export default function MiragonProvider(
* @return {Object[]} modified groups
*/
return function (groups: any) {
//checks whether form files where loaded and either uses default property-panel, or Miranum's custom panel
// checks whether form files where loaded and either uses default properties-panel
// or Miranum's custom panel
if (getFormKeys().length > 0) {
//(window.forms.length > 0) {
// (window.forms.length > 0) {
// Add own "form" group to StartEvent, and remove old Form property
if (is(element, "bpmn:StartEvent")) {
groups.push(createStartFormGroup(element, translate));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export default function (element: any) {
];
}

//camunda:formKey = Embedded or External Task Forms
//camunda:formRef = Camunda Forms
// camunda:formKey = Embedded or External Task Forms
// camunda:formRef = Camunda Forms
function Form(props: any) {
const { element, id } = props;
const modeling = useService("modeling");
Expand All @@ -32,7 +32,7 @@ function Form(props: any) {
});
};

//fetch forms (from window variable) and fill Forms with it
// fetch forms (from window variable) and fill Forms with it
const [forms, setForms] = useState<string[]>([]);
useEffect(() => {
setForms(getFormKeys()); // window.forms);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ export default function (element: any) {

function Form(props: any) {
const { element, id } = props;
//injections
// injections
const modeling = useService("modeling");
const bpmnFactory = useService("bpmnFactory");
const translate = useService("translate");
const debounce = useService("debounceInput");

//currently hard-coded binding
//needed for InputParameter - setValue/getValue
// currently hard-coded binding
// needed for InputParameter - setValue/getValue
const binding = {
type: "camunda:inputParameter",
name: "app_task_schema_key",
};
//both are currently only used for getValue(), if a input has already been allocated
// both are currently only used for getValue(), if a input has already been allocated
const inputOutput = findExtension(getBusinessObject(element), "camunda:InputOutput");
const inputParameter = inputOutput && findInputParameter(inputOutput, binding);

Expand All @@ -55,7 +55,7 @@ function Form(props: any) {
}
};

//fetch forms (from window variable) and fill Forms with it
// fetch forms (from window variable) and fill Forms with it
const [forms, setForms] = useState<string[]>([]);
useEffect(() => {
setForms(getFormKeys()); // window.forms);
Expand All @@ -82,7 +82,7 @@ function Form(props: any) {
});
}

//add or change
// add or change
function addInputParameter(
element: any,
property: any,
Expand All @@ -91,35 +91,35 @@ function addInputParameter(
) {
const { binding, value } = property;

const businessObject = getBusinessObject(element); //alternativ: element.businessObject
const businessObject = getBusinessObject(element); // alternative: element.businessObject
let extensionElements = businessObject.get("extensionElements");
let inputOutput = findExtension(businessObject, "camunda:InputOutput"); //already as a global variable
let inputOutput = findExtension(businessObject, "camunda:InputOutput"); // already as a global variable
let updatedBusinessObject, update;

//goes through all possibilities and sets updateBusinessObject & update accordingly
//case: nothing exists
// goes through all possibilities and sets updateBusinessObject & update accordingly
// case: nothing exists
if (!extensionElements) {
updatedBusinessObject = businessObject;
extensionElements = createExtensionElements(businessObject, bpmnFactory);
inputOutput = createInputOutput(binding, value, bpmnFactory, extensionElements);
extensionElements.values.push(inputOutput);
update = { extensionElements };

//case: Input has existed, but has been deleted again
// case: Input has existed, but has been deleted again
} else if (!inputOutput) {
updatedBusinessObject = extensionElements;
inputOutput = createInputOutput(binding, value, bpmnFactory, extensionElements);
update = { values: extensionElements.get("values").concat(inputOutput) };

//case: input exists, but key is already used => overwrite
// case: input exists, but key is already used => overwrite
} else if (findInputParameter(inputOutput, binding)) {
removeInputParameter(element, binding, modeling);

updatedBusinessObject = extensionElements;
inputOutput = createInputOutput(binding, value, bpmnFactory, extensionElements);
update = { values: extensionElements.get("values").concat(inputOutput) };

//case: input exists, and key isn't allocated yet
// case: input exists, and key isn't allocated yet
} else {
updatedBusinessObject = inputOutput;

Expand All @@ -131,7 +131,7 @@ function addInputParameter(
.concat(inputParameter),
};
}
//write into xml
// write into xml
modeling.updateModdleProperties(element, updatedBusinessObject, update);
}

Expand All @@ -143,7 +143,7 @@ function removeInputParameter(element: any, binding: any, modeling: any) {

const inputParameter = findInputParameter(inputOutput, binding);

//delete External Task paragraph from xml
// delete External Task paragraph from xml
modeling.updateModdleProperties(element, inputOutput, {
inputParameters: without(inputParameters, inputParameter),
});
Expand Down
12 changes: 7 additions & 5 deletions apps/miranum-modeler-dmn-webview/src/types/diagram-js.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,26 @@ declare module "diagram-js/lib/core/EventBus" {

export type EventCallback<T extends string = any> = (
event: EventType<T>,
data: any
data: any,
) => any;

export type EventType<T extends string> = EventMap extends Record<T, infer E>
? E
: InternalEvent;
export type EventType<T extends string> =
EventMap extends Record<T, infer E> ? E : InternalEvent;

interface EventMap {
"commandStack.changed": CommandStackChangedEvent
"commandStack.changed": CommandStackChangedEvent;
}

export interface InternalEvent {
cancelBubble?: boolean;
defaultPrevented?: boolean;

[field: string]: any;

init(data: any): void;

stopPropagation(): void;

preventDefault(): void;
}

Expand Down
4 changes: 2 additions & 2 deletions libs/miranum-core/src/lib/miranum-core.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe("generate", () => {
"my-project",
"imaginary/path/my-project",
);
//name, type, and extension are tested in plugisn.spec.ts
// name, type, and extension are tested in plugisn.spec.ts
expect(artifact.project).toEqual("my-project");
expect(artifact.file.pathInProject).toEqual(
`${file.dir}/${file.name}${file.extension}`,
Expand All @@ -116,7 +116,7 @@ describe("generate", () => {
"my-project",
"imaginary/path/my-project/subfolder",
);
//name, type, and extension are tested in plugisn.spec.ts
// name, type, and extension are tested in plugisn.spec.ts
expect(artifact.project).toEqual("my-project");
expect(artifact.file.pathInProject).toEqual(
`/${file.name}${file.extension}`,
Expand Down

0 comments on commit 554f5ea

Please sign in to comment.