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(all): Move formatter from Prettier to Biome and Speed up eslint #4423

Merged
merged 4 commits into from
Mar 23, 2024
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
6 changes: 3 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
npm run extract
npm run compile:loc
npm run compile:loc:psuedo
npm run lint
npm run pretty
git add .
npx lint-staged
git add .

2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["nrwl.angular-console", "esbenp.prettier-vscode", "firsttris.vscode-jest-runner", "dbaeumer.vscode-eslint"]
"recommendations": ["nrwl.angular-console", "biomejs.biome", "firsttris.vscode-jest-runner", "dbaeumer.vscode-eslint"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,6 @@ function getWorkflowStateType(workflowName: string, kind: string, settings: Reco
return kind?.toLowerCase() === 'stateful'
? localize('logicapps.stateful', 'Stateful')
: settings[settingName]?.toLowerCase() === 'withstatelessrunhistory'
? localize('logicapps.statelessDebug', 'Stateless (debug mode)')
: localize('logicapps.stateless', 'Stateless');
? localize('logicapps.statelessDebug', 'Stateless (debug mode)')
: localize('logicapps.stateless', 'Stateless');
}
4 changes: 2 additions & 2 deletions apps/vs-code-designer/src/app/tree/LogicAppResourceTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ export class LogicAppResourceTree implements ResolvedAppResourceBase {
const confirmationMessage: string = isSlot
? localize('confirmDeleteSlot', 'Are you sure you want to delete slot "{0}"?', fullName)
: isFunctionApp
? localize('confirmDeleteFunctionApp', 'Are you sure you want to delete function app "{0}"?', fullName)
: localize('confirmDeleteWebApp', 'Are you sure you want to delete web app "{0}"?', fullName);
? localize('confirmDeleteFunctionApp', 'Are you sure you want to delete function app "{0}"?', fullName)
: localize('confirmDeleteWebApp', 'Are you sure you want to delete web app "{0}"?', fullName);

const wizardContext = Object.assign(context, {
site: this.site,
Expand Down
44 changes: 9 additions & 35 deletions apps/vs-code-designer/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,8 @@
}
],
"activation": {
"onFetch": [
"microsoft.web/sites"
],
"onResolve": [
"microsoft.web/sites"
]
"onFetch": ["microsoft.web/sites"],
"onResolve": ["microsoft.web/sites"]
}
},
"commands": [
Expand Down Expand Up @@ -723,28 +719,17 @@
"azureLogicAppsStandard.projectRuntime": {
"scope": "resource",
"type": "string",
"enum": [
"~4",
"~3"
],
"enum": ["~4", "~3"],
"description": "The default version of the Azure Functions runtime to use when performing operations like \"Create New Logic App\".",
"enumDescriptions": [
"Azure Functions v4",
"Azure Functions v3 (.NET Core)"
]
"enumDescriptions": ["Azure Functions v4", "Azure Functions v3 (.NET Core)"]
},
"azureLogicAppsStandard.projectLanguage": {
"scope": "resource",
"type": "string",
"enum": [
"JavaScript",
"C#"
],
"enum": ["JavaScript", "C#"],
"readOnly": true,
"description": "The default language to use when performing operations like \"Create New Workflow\".",
"enumDescriptions": [
""
]
"enumDescriptions": [""]
},
"azureLogicAppsStandard.deploySubpath": {
"scope": "resource",
Expand Down Expand Up @@ -856,11 +841,7 @@
},
"azureLogicAppsStandard.projectOpenBehavior": {
"type": "string",
"enum": [
"AddToWorkspace",
"OpenInNewWindow",
"OpenInCurrentWindow"
],
"enum": ["AddToWorkspace", "OpenInNewWindow", "OpenInCurrentWindow"],
"description": "The behavior to use after creating a new project. The options are \"AddToWorkspace\", \"OpenInNewWindow\", or \"OpenInCurrentWindow\"."
},
"azureLogicAppsStandard.show64BitWarning": {
Expand Down Expand Up @@ -989,15 +970,8 @@
},
"homepage": "https://azure.microsoft.com/services/logic-apps/",
"license": "SEE LICENSE IN LICENSE.md",
"categories": [
"Azure"
],
"keywords": [
"Azure",
"Logic App",
"serverless",
"multi-root ready"
],
"categories": ["Azure"],
"keywords": ["Azure", "Logic App", "serverless", "multi-root ready"],
"preview": false,
"publisher": "ms-azuretools",
"icon": "assets/logicapp.png",
Expand Down
7 changes: 3 additions & 4 deletions apps/vs-code-react/src/run-service/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,9 @@ export interface UpdatePanelMetadataMessage {
// Rest of Message Interfaces
export interface InjectValuesMessage {
command: typeof ExtensionCommand.initialize_frame;
data:
| InitializePayload & {
project: string;
};
data: InitializePayload & {
project: string;
};
}

export interface UpdateAccessTokenMessage {
Expand Down
31 changes: 31 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"javascript": {
"formatter": {
"indentWidth": 2,
"indentStyle": "space",
"lineWidth": 140,
"trailingComma": "es5",
"quoteStyle": "single"
}
},
"json": {
"formatter": {
"indentWidth": 2,
"indentStyle": "space",
"lineWidth": 140
}
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"ignore": ["dist/*", "test-results/*", "tmp/*", "playwright-report/*"]
},
"linter": {
"enabled": false
},
"organizeImports": {
"enabled": false,
"include": ["libs/**/*.ts", "libs/**/*.tsx", "apps/**/*.ts", "apps/**/*.tsx"],
"ignore": ["dist/*", "test-results/*", "tmp/*", "playwright-report/*"]
}
}
2 changes: 1 addition & 1 deletion libs/chatbot/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import messages from '../services/intl/src/compiled-lang/strings.json';
import messages from '../logic-apps-shared/src/intl/compiled-lang/strings.json';
import { InitLoggerService } from '@microsoft/designer-client-services-logic-apps';
import { createIntl, createIntlCache } from 'react-intl';
import * as Intl from 'react-intl';
Expand Down
2 changes: 1 addition & 1 deletion libs/data-mapper/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import messages from '../services/intl/src/compiled-lang/strings.json';
import messages from '../logic-apps-shared/src/intl/compiled-lang/strings.json';
import { createIntl, createIntlCache } from 'react-intl';
import * as Intl from 'react-intl';

Expand Down
4 changes: 2 additions & 2 deletions libs/data-mapper/src/lib/components/nodeCard/SchemaCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ export const SchemaCard = (props: NodeProps<SchemaCardProps>) => {
isCurrentNodeSelected || sourceNodeConnectionBeingDrawnFromId === reactFlowId
? selectedCardStyles
: isCurrentNodeHighlighted
? highlightedCardStyles
: undefined;
? highlightedCardStyles
: undefined;

return (
<div className={classes.badgeContainer}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export const BoundedInputEntry = ({ index, input, functionData, connection, conn
const inputConnection = !connection
? undefined
: Object.values(connection.inputs).length > 1
? connection.inputs[index][0]
: connection.inputs[0][index];
? connection.inputs[index][0]
: connection.inputs[0][index];

let inputBox: JSX.Element;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ export const SchemaNodePropertiesTab = ({ currentNode }: SchemaNodePropertiesTab
return input === undefined
? undefined
: isCustomValue(input)
? input
: isSchemaNodeExtended(input.node)
? input.node.name
: functionDropDownItemText(input.reactFlowKey, input.node, connectionDictionary);
? input
: isSchemaNodeExtended(input.node)
? input.node.name
: functionDropDownItemText(input.reactFlowKey, input.node, connectionDictionary);
}

return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ export class MapDefinitionDeserializer {
flattenedChildValueParents.length > 1
? flattenedChildValueParents.reduce((a, b) => (a.lastIndexOf('/') <= b.lastIndexOf('/') ? a : b))
: flattenedChildValueParents.length === 1
? flattenedChildValueParents[0]
: undefined;
? flattenedChildValueParents[0]
: undefined;
const ifConnectionEntry = Object.entries(connections).find(
([_connectionKey, connectionValue]) =>
connectionValue.self.node.key === ifPseudoFunctionKey &&
Expand Down
4 changes: 2 additions & 2 deletions libs/data-mapper/src/lib/utils/Function.Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ export const getInputName = (inputConnection: InputConnection | undefined, conne
return isCustomValue(inputConnection)
? inputConnection
: isSchemaNodeExtended(inputConnection.node)
? inputConnection.node.name
: functionDropDownItemText(inputConnection.reactFlowKey, inputConnection.node, connectionDictionary);
? inputConnection.node.name
: functionDropDownItemText(inputConnection.reactFlowKey, inputConnection.node, connectionDictionary);
}

return undefined;
Expand Down
2 changes: 1 addition & 1 deletion libs/designer-ui/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[
"@nrwl/react/babel",
{
"runtime": "automatic",
"runtime": "automatic"
}
]
],
Expand Down
2 changes: 1 addition & 1 deletion libs/designer-ui/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import messages from '../services/intl/src/compiled-lang/strings.json';
import messages from '../logic-apps-shared/src/intl/compiled-lang/strings.json';
import { initializeIcons } from '@fluentui/react';
import { createIntl, createIntlCache } from 'react-intl';
import * as Intl from 'react-intl';
Expand Down
2 changes: 1 addition & 1 deletion libs/designer-ui/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './lib';
export * from './lib';
19 changes: 10 additions & 9 deletions libs/designer-ui/src/lib/chatbot/components/conversationItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ export const ChatEntryReaction = {
} as const;
export type ChatEntryReaction = (typeof ChatEntryReaction)[keyof typeof ChatEntryReaction];

export type ConversationItem = //TODO: Add other types of items

| UserQueryItem
| AssistantReplyItem
| AssistantReplyWithFlowItem
| AssistantGreetingItem
| AssistantErrorItem
| ConnectionsSetupItem
| OperationsNeedingAttentionItem;
export type ConversationItem =
//TODO: Add other types of items

| UserQueryItem
| AssistantReplyItem
| AssistantReplyWithFlowItem
| AssistantGreetingItem
| AssistantErrorItem
| ConnectionsSetupItem
| OperationsNeedingAttentionItem;

export type ReactionItem =
| AssistantReplyItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export const OperationsNeedingAttentionMessage: React.FC<OperationsNeedingAttent
? intlText.savingDescription_plural
: intlText.savingDescription
: item.operationsNeedingAttention.length > 1
? intlText.editingDescription_plural
: intlText.editingDescription;
? intlText.editingDescription_plural
: intlText.editingDescription;

const operations = item.operationsNeedingAttention.map((info: any) => {
const disabled = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ export const ThumbsReactionButton: React.FC<IThumbsReactionButtonProps> = ({ isV
? isVoted
? DislikeFilled
: isInverted
? DislikeDark
: Dislike
? DislikeDark
: Dislike
: isVoted
? LikeFilled
: isInverted
? LikeDark
: Like;
? LikeFilled
: isInverted
? LikeDark
: Like;
const intl = useIntl();
const intlText = {
upvote: intl.formatMessage({
Expand Down
4 changes: 2 additions & 2 deletions libs/designer-ui/src/lib/combobox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ export const Combobox = ({
const newOptions = isLoading
? [loadingOption]
: errorDetails
? [errorOption]
: options.filter((option) => new RegExp(searchValue.replace(/\\/g, '').toLowerCase()).test(option.displayName.toLowerCase()));
? [errorOption]
: options.filter((option) => new RegExp(searchValue.replace(/\\/g, '').toLowerCase()).test(option.displayName.toLowerCase()));

if (newOptions.length === 0) {
const noValuesLabel = intl.formatMessage({
Expand Down
2 changes: 1 addition & 1 deletion libs/designer-ui/src/lib/connectors/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './predicates';
export * from './predicates';
2 changes: 1 addition & 1 deletion libs/designer-ui/src/lib/connectors/predicates.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HostService } from '@microsoft/designer-client-services-logic-apps';
import type { Connector, OperationApi} from '@microsoft/logic-apps-shared';
import type { Connector, OperationApi } from '@microsoft/logic-apps-shared';
import { getAllConnectorProperties, isBuiltInConnectorId, isCustomConnectorId, isString } from '@microsoft/logic-apps-shared';

export const isBuiltInConnector = (connector: Connector | OperationApi | string): boolean => {
Expand Down
8 changes: 4 additions & 4 deletions libs/designer-ui/src/lib/modals/DeleteNodeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ export const DeleteNodeModal = (props: DeleteNodeModalProps) => {
nodeType === WORKFLOW_NODE_TYPES['OPERATION_NODE']
? operationNodeTitle
: nodeType === WORKFLOW_NODE_TYPES['GRAPH_NODE']
? graphNodeTitle
: nodeType === WORKFLOW_NODE_TYPES['SUBGRAPH_NODE'] // This is only for switch cases
? switchCaseTitle
: otherNodeTitle;
? graphNodeTitle
: nodeType === WORKFLOW_NODE_TYPES['SUBGRAPH_NODE'] // This is only for switch cases
? switchCaseTitle
: otherNodeTitle;

const confirmText = intl.formatMessage({
defaultMessage: 'OK',
Expand Down
4 changes: 2 additions & 2 deletions libs/designer-ui/src/lib/staticResult/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ export const initializePropertyValueInput = (
typeof currProperties === 'string' || typeof currProperties === 'number' || typeof currProperties === 'boolean'
? currProperties
: Object.keys(currProperties).length > 0
? JSON.stringify(currProperties, null, 2)
: schema?.default ?? ''
? JSON.stringify(currProperties, null, 2)
: schema?.default ?? ''
) as string;
return inputVal;
};
2 changes: 1 addition & 1 deletion libs/designer/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import messages from '../services/intl/src/compiled-lang/strings.json';
import messages from '../logic-apps-shared/src/intl/compiled-lang/strings.json';
import { InitLoggerService } from '@microsoft/designer-client-services-logic-apps';
import { createIntl, createIntlCache } from 'react-intl';
import * as Intl from 'react-intl';
Expand Down
4 changes: 2 additions & 2 deletions libs/designer/src/lib/core/actions/bjsworkflow/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ const getOperationType = (operation: DiscoveryOperation<DiscoveryResultTypes>):
? (operation.properties as SomeKindOfAzureOperationDiscovery).isWebhook
? Constants.NODE.TYPE.API_CONNECTION_WEBHOOK
: (operation.properties as SomeKindOfAzureOperationDiscovery).isNotification
? Constants.NODE.TYPE.API_CONNECTION_NOTIFICATION
: Constants.NODE.TYPE.API_CONNECTION
? Constants.NODE.TYPE.API_CONNECTION_NOTIFICATION
: Constants.NODE.TYPE.API_CONNECTION
: operationType;
};

Expand Down
Loading
Loading