Skip to content

Commit

Permalink
👕 add if to be block, set max width of code
Browse files Browse the repository at this point in the history
  • Loading branch information
arunachalam-monk committed Jul 25, 2024
1 parent 340759f commit 807186a
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 50 deletions.
69 changes: 41 additions & 28 deletions configs/eslint-config-base/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,63 @@ const ERROR = 2;
module.exports = {
root: true,
extends: [
'airbnb-base',
'eslint:recommended',
'plugin:jest/recommended',
'plugin:import/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:prettier/recommended',
'plugin:promise/recommended',
"airbnb-base",
"eslint:recommended",
"plugin:jest/recommended",
"plugin:import/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:prettier/recommended",
"plugin:promise/recommended",
],
plugins: ['import', 'prettier', 'jest'],
plugins: ["import", "prettier", "jest"],
env: {
browser: true,
es6: true,
jest: true,
},
settings: {
'import/resolver': {
"import/resolver": {
node: {
extensions: ['.js', '.jsx'],
extensions: [".js", ".jsx"],
},
},
},
rules: {
'prettier/prettier': ERROR,
'import/prefer-default-export': OFF,
'import/extensions': OFF,
'promise/always-return': OFF,
'no-plusplus': [ERROR, { allowForLoopAfterthoughts: true }],
'lines-between-class-members': OFF,
'dot-notation': OFF,
'indent': OFF,
'promise/catch-or-return': [ERROR, { allowFinally: true }],
'import/no-unresolved': [ERROR, { caseSensitive: false }],
'jest/no-mocks-import': OFF,
'jest/expect-expect': OFF,
"prettier/prettier": ERROR,
"import/prefer-default-export": OFF,
"import/extensions": OFF,
"promise/always-return": OFF,
"no-plusplus": [ERROR, { allowForLoopAfterthoughts: true }],
"lines-between-class-members": OFF,
"dot-notation": OFF,
indent: OFF,
curly: [ERROR, "all"],
"max-len": [
ERROR,
{
code: 120,
comments: 120,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
"capitalized-comments": [ERROR],
"promise/catch-or-return": [ERROR, { allowFinally: true }],
"import/no-unresolved": [ERROR, { caseSensitive: false }],
"jest/no-mocks-import": OFF,
"jest/expect-expect": OFF,
},
overrides: [
{
files: ['test/**/*.{js,jsx}'],
files: ["test/**/*.{js,jsx}"],
rules: {
'import/first': OFF,
'import/order': OFF,
'@typescript-eslint/no-empty-function': OFF,
'class-methods-use-this': OFF,
"import/first": OFF,
"import/order": OFF,
"@typescript-eslint/no-empty-function": OFF,
"class-methods-use-this": OFF,
},
},
],
Expand Down
3 changes: 2 additions & 1 deletion packages/analytics/src/adapters/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export interface AnalyticsAdapter {
resetUser: () => void;
/**
* Track an event.
* We recommend using the '[object][verb]' format for your event names, where '[object]' is the entity that the behavior relates to, and '[verb]' is the behavior itself.
* We recommend using the '[object][verb]' format for your event names, where '[object]' is the entity that the
* behavior relates to, and '[verb]' is the behavior itself.
* For example: `Project Created`, `User Signed Up`, or `Invite Sent`.
*
* @param name The name of the event.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export interface DynamicSVGProps
* import React, { useCallback } from 'react';
* import { DynamicSVG } from '@monkvision/common-ui-web';
*
* const svg = '<svg height="100" width="100"><circle id="circle1" cx="20" cy="20" r="30"/><circle id="circle2" cx="80" cy="80" r="30"/></svg>';
* const svg = `<svg height="100" width="100">
* <circle id="circle1" cx="20" cy="20" r="30"/><circle id="circle2" cx="80" cy="80" r="30"/></svg>`;
*
* // Applies a red fill and an onClick handler on the element with ID "circle1"
* function MyCustomSVG() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { SVGProps } from 'react';
*/
export interface DynamicSVGCustomizationFunctions {
/**
* A callback used to customize SVG tags in a DynamicSVG component based on the HTMLElement itself, or the Elements of the
* groups this element is part of.
* A callback used to customize SVG tags in a DynamicSVG component based on the HTMLElement itself, or the Elements
* of the groups this element is part of.
*
* @param element The element to apply the custom attributes to.
* @param groups SVG group elements this element is part of (the elements are in order).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ export type InspectionGalleryProps = {
*/
onValidate?: () => void;
/**
* Boolean indicating if `Add Damage` feature should be enabled or not. If disabled, the `Add Custom Damage` button will be hidden.
* Boolean indicating if `Add Damage` feature should be enabled or not. If disabled, the `Add Custom Damage` button
* will be hidden.
*
* @default true
*/
Expand All @@ -127,8 +128,8 @@ export type InspectionGalleryProps = {
*/
sights: Sight[];
/**
* Boolean indicating if the user should be allowed to skip the retaking of non-compliant pictures before validating
* the inspection. This prop can only be specified if `captureMode` is set to true.
* Boolean indicating if the user should be allowed to skip the retaking of non-compliant pictures before
* validating the inspection. This prop can only be specified if `captureMode` is set to true.
*
* @default false
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export interface VehicleDynamicWireframeProps {
*/
onClickPart?: (parts: VehiclePart) => void;
/**
* Callback used to customize the display style of each vehicle part on the wireframe. See `DynamicSVGCustomizationFunctions` for more details.
* Callback used to customize the display style of each vehicle part on the wireframe.
* See `DynamicSVGCustomizationFunctions` for more details.
*
* @see DynamicSVGCustomizationFunctions
*/
Expand Down
14 changes: 7 additions & 7 deletions packages/network/src/api/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,19 @@ export function useMonkApi(config: MonkApiConfig) {
/**
* Update the progress status of an inspection task.
*
* **Note : This API call is known to sometimes fail for unknown reasons. In order to fix this, we added a retry config
* to this API request : when failing, this request will retry itself up to 4 times (5 API calls in total), with
* exponentially increasing delay between each request (max delay : 1.5s).**
* **Note : This API call is known to sometimes fail for unknown reasons. In order to fix this, we added a retry
* config to this API request : when failing, this request will retry itself up to 4 times (5 API calls in total),
* with exponentially increasing delay between each request (max delay : 1.5s).**
*
* @param options The options of the request.
*/
updateTaskStatus: reactify(MonkApi.updateTaskStatus, config, dispatch, handleError),
/**
* Start some inspection tasks that were in the NOT_STARTED status. This function actually makes one API call for each
* task provided using the `updateTaskStatus`.
* Start some inspection tasks that were in the NOT_STARTED status. This function actually makes one API call for
* each task provided using the `updateTaskStatus`.
*
* **Note : This API call is known to sometimes fail for unknown reasons. Please take note of the details provided in
* the TSDoc of the `updateTaskStatus` function.**
* **Note : This API call is known to sometimes fail for unknown reasons. Please take note of the details provided
* in the TSDoc of the `updateTaskStatus` function.**
*
* @param options The options of the request.
*
Expand Down
3 changes: 2 additions & 1 deletion packages/sights/test/build/buildJSON.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,9 @@ describe('JSON builder module', () => {
fs.readFileSync = jest
.fn()
.mockImplementation((path: string, options?: { encoding: BufferEncoding }) => {
if (path.endsWith(`vehicle-key-2-${PartSelectionOrientation.FRONT_LEFT}.svg`))
if (path.endsWith(`vehicle-key-2-${PartSelectionOrientation.FRONT_LEFT}.svg`)) {
throw new Error('File Not found');
}
if (options?.encoding === 'utf-8') {
return ` ${resolve(path)} `;
}
Expand Down
14 changes: 8 additions & 6 deletions packages/types/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export type CaptureAppConfig = CameraConfig &
/**
* Value indicating if tasks should be started at the end of the inspection :
* - If not provided or if value is set to `false`, no tasks will be started.
* - If set to `true`, the tasks described by the `tasksBySight` param (or, if not provided, the default tasks of each
* sight) will be started.
* - If set to `true`, the tasks described by the `tasksBySight` param (or, if not provided, the default tasks of
* each sight) will be started.
* - If an array of tasks is provided, the tasks started will be the ones contained in the array.
*
* @default true
Expand Down Expand Up @@ -88,7 +88,8 @@ export type CaptureAppConfig = CameraConfig &
*/
allowSkipRetake?: boolean;
/**
* Boolean indicating if `Add Damage` feature should be enabled or not. If disabled, the `Add Damage` button will be hidden.
* Boolean indicating if `Add Damage` feature should be enabled or not. If disabled, the `Add Damage` button will
* be hidden.
*
* @default true
*/
Expand All @@ -98,7 +99,8 @@ export type CaptureAppConfig = CameraConfig &
*/
sightGuidelines?: SightGuideline[];
/**
* Boolean indicating whether the sight guideline feature is enabled. If disabled, the guideline text will be hidden.
* Boolean indicating whether the sight guideline feature is enabled. If disabled, the guideline text will be
* hidden.
*
* @default true
*/
Expand All @@ -116,8 +118,8 @@ export type CaptureAppConfig = CameraConfig &
*/
allowVehicleTypeSelection: boolean;
/**
* Boolean indicating if the application state (such as auth token, inspection ID etc.) should be fetched from the URL
* search params or not.
* Boolean indicating if the application state (such as auth token, inspection ID etc.) should be fetched from the
* URL search params or not.
*/
fetchFromSearchParams: boolean;
/**
Expand Down

0 comments on commit 807186a

Please sign in to comment.