Skip to content

Commit

Permalink
fix(all): Fix ESLint for repo (#4617)
Browse files Browse the repository at this point in the history
* fix(all): Fix ESLint for repo

* fix(string): fix string
  • Loading branch information
hartra344 authored Apr 15, 2024
1 parent 3a7d67c commit 4d8ce84
Show file tree
Hide file tree
Showing 37 changed files with 768 additions and 321 deletions.
16 changes: 12 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
{
"root": true,
"ignorePatterns": [
"**/*"
],
"parser": "@typescript-eslint/parser",
"plugins": [
"formatjs",
"react",
"react-hooks"
"react-hooks",
"@typescript-eslint"
],
"settings": {
"react": {
"version": "detect"
}
},
"extends": "eslint:recommended",
"overrides": [
{
"files": [
Expand All @@ -21,6 +26,9 @@
"plugin:import/typescript"
],
"rules": {
"no-unused-vars": "off",
"no-redeclare": "off",
"no-undef": "off",
"no-restricted-syntax": [
"error",
{
Expand Down
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
auto-install-peers=true
resolution-mode=highest
resolution-mode=highest
ignore-workspace-root-check=true
22 changes: 12 additions & 10 deletions Localize/lang/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
"49YUXK": "''{parameterName}'' is required.",
"4BH9uU": "Errors",
"4BrA0z": "Required. The number of days to add. Can be negative to subtract days.",
"4BuCdw": "Specify the behavior and capabilities for transferring content over HTTP.",
"4D7H4R": "Runs {onDays}",
"4Ekn9t": "Undo",
"4IS4yp": "Retry Policy",
Expand Down Expand Up @@ -358,6 +359,7 @@
"D/xTXV": "Show source schema",
"D1lgsT": "Required. The string from which to remove leading and trailing whitespace.",
"D5FIKL": "Paste from sample",
"D6KzoS": "Specify upload chunk size between {minimumSize} and {maximumSize} Mb. Example: 10",
"DDIIAQ": "Node",
"DEKsll": "Retry Policy Interval is invalid, must match ISO 8601 duration format",
"DEu7oK": "(UTC-07:00) Arizona",
Expand Down Expand Up @@ -481,6 +483,7 @@
"IXy91L": "Add a target schema",
"IdOhPY": "{label} To add dynamic data, press the Alt + '/' keys.",
"If+p6C": "(UTC+09:00) Yakutsk",
"IqNEui": "Specify download chunk size between {minimumSize} and {maximumSize} Mb. Example: 10",
"IsVhkH": "No properties",
"IsbbsG": "When a new item",
"IxWip7": "(UTC+03:00) Moscow, St. Petersburg, Volgograd",
Expand Down Expand Up @@ -704,11 +707,10 @@
"SKXopi": "Convert the parameter to an integer",
"SLJkRn": "Remove input",
"SLZ0n4": "Checks if the string starts with a value (case-insensitive, invariant culture)",
"STWbak": "Chunk size",
"SToblZ": "Configure parameters for this node",
"SXb47U": "{minutes}m",
"SY04wn": "Required. The name of the action with a form-data or form-encoded response.",
"SenWwt": "Large messages may be split up into smaller requests to the connector to allow large message upload. More details can be found at http://aka.ms/logicapps-chunk#upload-content-in-chunks",
"SfnWwt": "Specify the behavior and capabilities for transferring content over HTTP.",
"SgiTAh": "Please enter your input",
"Sh10cw": "Save",
"SmCQys": "Custom Tracking Id",
Expand Down Expand Up @@ -1059,6 +1061,7 @@
"_49YUXK.comment": "Required Parameter error message. Do not remove the double single quotes around the display name, as it is needed to wrap the placeholder text.",
"_4BH9uU.comment": "Error section title",
"_4BrA0z.comment": "Required integer parameter to subtract days from time",
"_4BuCdw.comment": "description of upload content transfer setting",
"_4D7H4R.comment": "Recurrence schedule description on days of week at times",
"_4Ekn9t.comment": "Undo",
"_4IS4yp.comment": "title for retry policy setting",
Expand Down Expand Up @@ -1264,6 +1267,7 @@
"_D/xTXV.comment": "Label to open source schema toolbox",
"_D1lgsT.comment": "Required text parameter to apply trim function with",
"_D5FIKL.comment": "Paste from sample",
"_D6KzoS.comment": "tooltip for upload chunk size setting",
"_DDIIAQ.comment": "Title for other node",
"_DEKsll.comment": "error message for invalid retry interval",
"_DEu7oK.comment": "Time zone value ",
Expand Down Expand Up @@ -1387,6 +1391,7 @@
"_IXy91L.comment": "label to inform to add a target schema to be used",
"_IdOhPY.comment": "This is an a11y message meant to help screen reader users figure out how to insert dynamic data",
"_If+p6C.comment": "Time zone value ",
"_IqNEui.comment": "tooltip for download chunk size setting",
"_IsVhkH.comment": "No properties text",
"_IsbbsG.comment": "Chatbot input start of sentence for creating a flow that the user should complete. Trailing space is intentional.",
"_IxWip7.comment": "Time zone value ",
Expand Down Expand Up @@ -1610,11 +1615,10 @@
"_SKXopi.comment": "Label for description of custom int Function",
"_SLJkRn.comment": "Remove input",
"_SLZ0n4.comment": "Label for description of custom startsWith Function",
"_STWbak.comment": "label for chunked transfer node size",
"_SToblZ.comment": "Parameters tab description",
"_SXb47U.comment": "This is a period in time in seconds. {minutes} is replaced by the number and m is an abbreviation of minutes",
"_SY04wn.comment": "Required string parameter to identify action name for formDataMultiValues function",
"_SenWwt.comment": "description of upload content transfer setting",
"_SfnWwt.comment": "description of download content transfer setting",
"_SgiTAh.comment": "Placeholder description for a newly inserted Text parameter",
"_Sh10cw.comment": "Button text for save the changes",
"_SmCQys.comment": "title for client tracking id setting",
Expand Down Expand Up @@ -1997,7 +2001,6 @@
"_iEy9pT.comment": "Token picker mode to insert dynamic content",
"_iHVVTl.comment": "Text for delete node modal body",
"_iJOIca.comment": "Button indicating to go to the next page",
"_iMf2TA.comment": "label for chunked transfer node size",
"_iMicOQ.comment": "Required string parameter to determine which URI to apply uriHost function to",
"_iRe/g7.comment": "Hour of the day",
"_iRjBf4.comment": "This is a tooltip for the Status results badge shown on a card. It's shown when the baged is hovered over.",
Expand Down Expand Up @@ -2049,7 +2052,6 @@
"_kHs5R4.comment": "Chatbot flow preview message reminding user to check workflow actions",
"_kKJMeM.comment": "Example of a sentence that the user should complete",
"_kM+Mr0.comment": "Loading text when items are being fetched",
"_kMf2TA.comment": "tooltip for upload chunk size setting",
"_kN6kce.comment": "Label for description of custom decodeBase64 Function",
"_kSK9Pq.comment": "Time zone value ",
"_kVwJXt.comment": "Time zone value ",
Expand All @@ -2068,12 +2070,12 @@
"_lA/sHA.comment": "Accessibility label for a button to copy all text in a value box",
"_lB56l2.comment": "Error validation message for Numbers",
"_lM9qrG.comment": "Time zone value ",
"_lMf2TA.comment": "tooltip for download chunk size setting",
"_lPTdSf.comment": "Button text for run trigger",
"_lQNKUB.comment": "Describes connection being added",
"_lR7V87.comment": "Section header for the functions section",
"_lX30/R.comment": "Text of Tooltip to collapse",
"_lZT0JI.comment": "Button to add group",
"_lbq5E1.comment": "description of upload content transfer setting",
"_lckgnb.comment": "Required collection parameter to apply reverse function on",
"_lexzgJ.comment": "Message on failure to remove source node",
"_lgs5sf.comment": "label text for stateless run mode",
Expand Down Expand Up @@ -2183,6 +2185,7 @@
"_pc0FCg.comment": "Text for if image does not show up",
"_pcGqoB.comment": "Error loading outputs text",
"_pcuZKB.comment": "Label for signatures of custom intersection Function",
"_pfmki/.comment": "description of download content transfer setting",
"_piaRy6.comment": "Filter by Triggers category of connectors",
"_pozypE.comment": "Label for description of custom trim Function",
"_pr9GwA.comment": "Button text for refresh",
Expand Down Expand Up @@ -2629,7 +2632,6 @@
"iEy9pT": "Dynamic content",
"iHVVTl": "Are you sure you want to delete {nodeId}?",
"iJOIca": "Next",
"iMf2TA": "Chunk size",
"iMicOQ": "Required. The URI to parse.",
"iRe/g7": "21",
"iRjBf4": "This Action has testing configured.",
Expand Down Expand Up @@ -2681,7 +2683,6 @@
"kHs5R4": "Check these actions to see if any parameters need to be set.",
"kKJMeM": "Every week on Monday...",
"kM+Mr0": "Loading...",
"kMf2TA": "Specify upload chunk size between {minimumSize} and {maximumSize} Mb. Example: 10",
"kN6kce": "Returns a string representation of an input based64 string",
"kSK9Pq": "(UTC-05:00) Bogota, Lima, Quito, Rio Branco",
"kVwJXt": "(UTC+04:00) Abu Dhabi, Muscat",
Expand All @@ -2700,12 +2701,12 @@
"lA/sHA": "Copy the value of ''{label}'' to the clipboard",
"lB56l2": "Enter a valid number.",
"lM9qrG": "(UTC+13:00) Nuku'alofa",
"lMf2TA": "Specify download chunk size between {minimumSize} and {maximumSize} Mb. Example: 10",
"lPTdSf": "Run trigger",
"lQNKUB": "A line for the parent element is added automatically.",
"lR7V87": "Functions",
"lX30/R": "Collapse",
"lZT0JI": "Add Group",
"lbq5E1": "Large messages may be split up into smaller requests to the connector to allow large message upload. More details can be found at http://aka.ms/logicapps-chunk#upload-content-in-chunks",
"lckgnb": "Required. The collection to reverse.",
"lexzgJ": "Remove all references to element ' {nodeName} ' before you remove the element.",
"lgs5sf": "Stateless run mode:",
Expand Down Expand Up @@ -2815,6 +2816,7 @@
"pc0FCg": "Button to add dynamic content if Token Picker is hidden",
"pcGqoB": "Error loading outputs",
"pcuZKB": "Returns a single array or object that has common elements between arrays or objects passed in. The parameters for the function can either be a set of objects or a set of arrays (not a mixture of both). If there are two objects with the same name, the last object with that name appears in the final object.",
"pfmki/": "Specify the behavior and capabilities for transferring content over HTTP.",
"piaRy6": "Triggers",
"pozypE": "Trims leading and trailing whitespace from a string",
"pr9GwA": "Refresh",
Expand Down
37 changes: 37 additions & 0 deletions libs/chatbot/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"extends": [
"../../.eslintrc.json"
],
"ignorePatterns": [
"!**/*",
"**/node_modules/**",
"**/build/**",
"**/__test__/**",
"**/__tests__/**"
],
"overrides": [
{
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {}
},
{
"files": [
"*.ts",
"*.tsx"
],
"rules": {}
},
{
"files": [
"*.js",
"*.jsx"
],
"rules": {}
}
]
}
22 changes: 11 additions & 11 deletions libs/chatbot/test-setup.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import '@testing-library/jest-dom/vitest'
import { cleanup } from '@testing-library/react'
import { afterEach, beforeEach, vi } from 'vitest'
import { mockUseIntl } from './src/lib/__test__/intl-test-helper'
import '@testing-library/jest-dom/vitest';
import { cleanup } from '@testing-library/react';
import { afterEach, beforeEach } from 'vitest';
import { mockUseIntl } from './src/lib/__test__/intl-test-helper';
import { initializeIcons } from '@fluentui/react';
import { InitLoggerService, InitChatbotService } from '@microsoft/logic-apps-shared';
InitLoggerService([]);
InitChatbotService({
getCopilotResponse: async (query: string, workflow: any, signal: AbortSignal, armToken: string) => {
return { data: {} } as any;
}
})
getCopilotResponse: async (_query: string, _workflow: any, _signal: AbortSignal, _armToken: string) => {
return { data: {} } as any;
},
});
initializeIcons();
// https://testing-library.com/docs/react-testing-library/api#cleanup
afterEach(() => cleanup())
afterEach(() => cleanup());

beforeEach(() => {
mockUseIntl();
})
mockUseIntl();
});
37 changes: 17 additions & 20 deletions libs/chatbot/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
import { defineConfig } from 'tsup';
import { lessLoader } from 'esbuild-plugin-less';
import svgr from 'esbuild-plugin-svgr'
export default defineConfig({
entry: ['src/index.ts'],
treeshake: true,
outDir: 'build/lib',
sourcemap: 'inline',
minify: false,
clean: true,
// dts: true,
splitting: false,
tsconfig: 'tsconfig.json',
format: ['cjs', 'esm'],
external: ['react'],
injectStyle: false,
loader: {
'.svg': 'dataurl',
},
esbuildPlugins: [
lessLoader(),
],
});
entry: ['src/index.ts'],
treeshake: true,
outDir: 'build/lib',
sourcemap: 'inline',
minify: false,
clean: true,
// dts: true,
splitting: false,
tsconfig: 'tsconfig.json',
format: ['cjs', 'esm'],
external: ['react'],
injectStyle: false,
loader: {
'.svg': 'dataurl',
},
esbuildPlugins: [lessLoader()],
});
37 changes: 37 additions & 0 deletions libs/data-mapper-v2/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"extends": [
"../../.eslintrc.json"
],
"ignorePatterns": [
"!**/*",
"**/node_modules/**",
"**/build/**",
"**/__test__/**",
"**/__tests__/**"
],
"overrides": [
{
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {}
},
{
"files": [
"*.ts",
"*.tsx"
],
"rules": {}
},
{
"files": [
"*.js",
"*.jsx"
],
"rules": {}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { getSelectedSchema } from '../../core';
import { setInitialSchema } from '../../core/state/DataMapSlice';
import { closePanel, ConfigPanelView, openDefaultConfigPanelView } from '../../core/state/PanelSlice';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import type { RootState } from '../../core/state/Store';
import { FileDropdown } from '../fileDropdown/fileDropdown';
import { SchemaType } from '@microsoft/logic-apps-shared';
Expand Down
2 changes: 0 additions & 2 deletions libs/data-mapper-v2/src/core/DataMapDataProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ export interface DataMapDataProviderProps {
const DataProviderInner = ({
xsltFilename,
xsltContent,
mapDefinition,
dataMapMetadata,
sourceSchema,
targetSchema,
availableSchemas,
Expand Down
4 changes: 2 additions & 2 deletions libs/data-mapper-v2/src/utils/Connection.Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { LogCategory, LogService } from './Logging.Utils';
//import { addReactFlowPrefix, addTargetReactFlowPrefix } from './ReactFlow.Util';
import { isSchemaNodeExtended } from './Schema.Utils';
import type { SchemaNodeExtended } from '@microsoft/logic-apps-shared';
import { NormalizedDataType, SchemaNodeProperty, SchemaType } from '@microsoft/logic-apps-shared';
import { NormalizedDataType, SchemaNodeProperty } from '@microsoft/logic-apps-shared';
import type { WritableDraft } from 'immer/dist/internal';

// danielle do we need this?
Expand Down Expand Up @@ -459,7 +459,7 @@ export const getFunctionConnectionUnits = (

export const bringInParentSourceNodesForRepeating = (
parentTargetNode: WritableDraft<SchemaNodeExtended> | undefined,
newState: DataMapOperationState
_newState: DataMapOperationState
) => {
if (parentTargetNode) {
// const inputsToParentTarget = newState.dataMapConnections[addTargetReactFlowPrefix(parentTargetNode?.key)]?.inputs;
Expand Down
Loading

0 comments on commit 4d8ce84

Please sign in to comment.