diff --git a/eslint.config.js b/eslint.config.js index 523623f28..2ac40a269 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,6 +1,6 @@ // eslint.config.js -const { defineConfig } = require("eslint/config"); -const globals = require("globals"); +const { defineConfig } = require('eslint/config'); +const globals = require('globals'); const { fixupPluginRules } = require('@eslint/compat'); const eslintPluginDiff = require('eslint-plugin-diff'); @@ -11,6 +11,16 @@ const runESMImports = async () => { }; module.exports = runESMImports().then(() => defineConfig([ + // Global ignores - must be a standalone object with ONLY ignores + { + ignores: [ + '**/node_modules/**/*', + '**/dist/**/*', + '**/*.bru', + 'packages/bruno-js/src/sandbox/bundle-browser-rollup.js', + 'packages/bruno-app/public/static/**/*' + ] + }, { plugins: { 'diff': fixupPluginRules(eslintPluginDiff), @@ -34,13 +44,13 @@ module.exports = runESMImports().then(() => defineConfig([ 'packages/bruno-converters/**/*.js', 'packages/bruno-electron/**/*.js', 'packages/bruno-filestore/**/*.ts', + 'packages/bruno-schema-types/**/*.ts', 'packages/bruno-js/**/*.js', 'packages/bruno-lang/**/*.js', 'packages/bruno-requests/**/*.ts', 'packages/bruno-requests/**/*.js', 'packages/bruno-tests/**/*.{js,ts}' ], - processor: 'diff/diff', rules: { ...stylistic.configs.customize({ indent: 2, @@ -56,7 +66,7 @@ module.exports = runESMImports().then(() => defineConfig([ minElements: 2, consistent: true }], - '@stylistic/function-paren-newline': ['error', 'never'], + '@stylistic/function-paren-newline': ['off'], '@stylistic/array-bracket-spacing': ['error', 'never'], '@stylistic/arrow-spacing': ['error', { before: true, after: true }], '@stylistic/function-call-spacing': ['error', 'never'], @@ -64,12 +74,14 @@ module.exports = runESMImports().then(() => defineConfig([ '@stylistic/padding-line-between-statements': ['off'], '@stylistic/semi-style': ['error', 'last'], '@stylistic/max-len': ['off'], - '@stylistic/jsx-one-expression-per-line': ['off'] + '@stylistic/jsx-one-expression-per-line': ['off'], + '@stylistic/max-statements-per-line': ['off'], + '@stylistic/no-mixed-operators': ['off'] } }, { - files: ["packages/bruno-app/**/*.{js,jsx,ts}"], - ignores: ["**/*.config.js", "**/public/**/*"], + files: ['packages/bruno-app/**/*.{js,jsx,ts}'], + ignores: ['**/*.config.js', '**/public/**/*'], languageOptions: { globals: { ...globals.browser, @@ -82,114 +94,114 @@ module.exports = runESMImports().then(() => defineConfig([ }, parserOptions: { ecmaFeatures: { - jsx: true, - }, - }, + jsx: true + } + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { // It prevents lint errors when using CommonJS exports (module.exports) in Jest mocks. - files: ["packages/bruno-app/src/test-utils/mocks/codemirror.js"], + files: ['packages/bruno-app/src/test-utils/mocks/codemirror.js'], languageOptions: { globals: { ...globals.node, - ...globals.jest, - }, + ...globals.jest + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-cli/**/*.js"], - ignores: ["**/*.config.js"], + files: ['packages/bruno-cli/**/*.js'], + ignores: ['**/*.config.js'], languageOptions: { globals: { ...globals.node, - ...globals.jest, + ...globals.jest }, parserOptions: { - ecmaVersion: "latest" - }, + ecmaVersion: 'latest' + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-common/**/*.ts"], - ignores: ["**/*.config.js", "**/dist/**/*"], + files: ['packages/bruno-common/**/*.ts'], + ignores: ['**/*.config.js', '**/dist/**/*'], languageOptions: { globals: { ...globals.node, - ...globals.jest, + ...globals.jest }, - parser: require("@typescript-eslint/parser"), + parser: require('@typescript-eslint/parser'), parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - project: "./packages/bruno-common/tsconfig.json", - }, + ecmaVersion: 'latest', + sourceType: 'module', + project: './packages/bruno-common/tsconfig.json' + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-converters/**/*.js"], - ignores: ["**/*.config.js", "**/dist/**/*"], + files: ['packages/bruno-converters/**/*.js'], + ignores: ['**/*.config.js', '**/dist/**/*'], languageOptions: { globals: { ...globals.node, - ...globals.jest, + ...globals.jest }, parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - }, + ecmaVersion: 'latest', + sourceType: 'module' + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-electron/**/*.js"], - ignores: ["**/*.config.js", "**/web/**/*"], + files: ['packages/bruno-electron/**/*.js'], + ignores: ['**/*.config.js', '**/web/**/*'], languageOptions: { globals: { ...globals.node, - ...globals.jest, - }, + ...globals.jest + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-filestore/**/*.ts"], - ignores: ["**/*.config.js", "**/dist/**/*"], + files: ['packages/bruno-filestore/**/*.ts'], + ignores: ['**/*.config.js', '**/dist/**/*'], languageOptions: { globals: { ...globals.node, - ...globals.jest, + ...globals.jest }, - parser: require("@typescript-eslint/parser"), + parser: require('@typescript-eslint/parser'), parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - project: "./packages/bruno-filestore/tsconfig.json", - }, + ecmaVersion: 'latest', + sourceType: 'module', + project: './packages/bruno-filestore/tsconfig.json' + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-js/**/*.js"], - ignores: ["**/*.config.js", "**/dist/**/*"], + files: ['packages/bruno-js/**/*.js'], + ignores: ['**/*.config.js', '**/dist/**/*'], languageOptions: { globals: { ...globals.node, @@ -200,65 +212,65 @@ module.exports = runESMImports().then(() => defineConfig([ typeDetectGlobalObject: false }, parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - }, + ecmaVersion: 'latest', + sourceType: 'module' + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-lang/**/*.js"], - ignores: ["**/*.config.js", "**/dist/**/*"], + files: ['packages/bruno-lang/**/*.js'], + ignores: ['**/*.config.js', '**/dist/**/*'], languageOptions: { globals: { ...globals.node, - ...globals.jest, + ...globals.jest }, parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - }, + ecmaVersion: 'latest', + sourceType: 'module' + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-requests/**/*.ts"], - ignores: ["**/*.config.js", "**/dist/**/*"], + files: ['packages/bruno-requests/**/*.ts'], + ignores: ['**/*.config.js', '**/dist/**/*'], languageOptions: { globals: { ...globals.node, - ...globals.jest, + ...globals.jest }, - parser: require("@typescript-eslint/parser"), + parser: require('@typescript-eslint/parser'), parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - project: "./packages/bruno-requests/tsconfig.json", - }, + ecmaVersion: 'latest', + sourceType: 'module', + project: './packages/bruno-requests/tsconfig.json' + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-requests/**/*.js"], - ignores: ["**/*.config.js", "**/dist/**/*"], + files: ['packages/bruno-requests/**/*.js'], + ignores: ['**/*.config.js', '**/dist/**/*'], languageOptions: { globals: { ...globals.node, - ...globals.jest, + ...globals.jest }, parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - }, + ecmaVersion: 'latest', + sourceType: 'module' + } }, rules: { - "no-undef": "error", - }, - }, + 'no-undef': 'error' + } + } ])); diff --git a/packages/bruno-app/babel.config.js b/packages/bruno-app/babel.config.js index e04b84e5e..a3be21ad1 100644 --- a/packages/bruno-app/babel.config.js +++ b/packages/bruno-app/babel.config.js @@ -6,4 +6,4 @@ module.exports = { }] ], plugins: ['babel-plugin-styled-components'] -}; \ No newline at end of file +}; diff --git a/packages/bruno-app/jest.config.js b/packages/bruno-app/jest.config.js index fdab3f936..31cac61da 100644 --- a/packages/bruno-app/jest.config.js +++ b/packages/bruno-app/jest.config.js @@ -1,10 +1,10 @@ module.exports = { rootDir: '.', transform: { - '^.+\\.[jt]sx?$': 'babel-jest', + '^.+\\.[jt]sx?$': 'babel-jest' }, transformIgnorePatterns: [ - "/node_modules/(?!strip-json-comments|nanoid|xml-formatter)/", + '/node_modules/(?!strip-json-comments|nanoid|xml-formatter)/' ], moduleNameMapper: { '^assets/(.*)$': '/src/assets/$1', @@ -22,9 +22,9 @@ module.exports = { testEnvironment: 'jsdom', setupFilesAfterEnv: ['@testing-library/jest-dom'], setupFiles: [ - '/jest.setup.js', + '/jest.setup.js' ], testMatch: [ '/src/**/*.spec.[jt]s?(x)' ] -}; \ No newline at end of file +}; diff --git a/packages/bruno-app/public/theme/dark.js b/packages/bruno-app/public/theme/dark.js index b34340c81..417e6714a 100644 --- a/packages/bruno-app/public/theme/dark.js +++ b/packages/bruno-app/public/theme/dark.js @@ -1,6 +1,6 @@ const darkTheme = { - brand: '#546de5', - text: 'rgb(52 52 52)', + 'brand': '#546de5', + 'text': 'rgb(52 52 52)', 'primary-text': '#ffffff', 'primary-theme': '#1e1e1e', 'secondary-text': '#929292', diff --git a/packages/bruno-app/public/theme/light.js b/packages/bruno-app/public/theme/light.js index 6ba048f6a..ea37ebdae 100644 --- a/packages/bruno-app/public/theme/light.js +++ b/packages/bruno-app/public/theme/light.js @@ -1,6 +1,6 @@ const lightTheme = { - brand: '#546de5', - text: 'rgb(52 52 52)', + 'brand': '#546de5', + 'text': 'rgb(52 52 52)', 'primary-text': 'rgb(52 52 52)', 'primary-theme': '#ffffff', 'secondary-text': '#929292', diff --git a/packages/bruno-app/src/components/BrunoSupport/index.js b/packages/bruno-app/src/components/BrunoSupport/index.js index 190ef6ef4..545e1c56a 100644 --- a/packages/bruno-app/src/components/BrunoSupport/index.js +++ b/packages/bruno-app/src/components/BrunoSupport/index.js @@ -6,7 +6,7 @@ import StyledWrapper from './StyledWrapper'; const BrunoSupport = ({ onClose }) => { return ( - +
diff --git a/packages/bruno-app/src/components/CodeEditor/index.js b/packages/bruno-app/src/components/CodeEditor/index.js index 9157fb00a..d139d1ec0 100644 --- a/packages/bruno-app/src/components/CodeEditor/index.js +++ b/packages/bruno-app/src/components/CodeEditor/index.js @@ -105,7 +105,7 @@ export default class CodeEditor extends React.Component { }, 'Cmd-H': 'replace', 'Ctrl-H': 'replace', - Tab: function (cm) { + 'Tab': function (cm) { cm.getSelection().includes('\n') || editor.getLine(cm.getCursor().line) == cm.getSelection() ? cm.execCommand('indentMore') : cm.replaceSelection(' ', 'end'); @@ -151,7 +151,7 @@ export default class CodeEditor extends React.Component { } else if (this.props.mode == 'application/xml') { var doc = new DOMParser(); try { - //add header element and remove prefix namespaces for DOMParser + // add header element and remove prefix namespaces for DOMParser var dcm = doc.parseFromString( ' ' + internal.replace(/(?<=\<|<\/)\w+:/g, '') + '', 'application/xml' @@ -188,7 +188,7 @@ export default class CodeEditor extends React.Component { } return found; }); - + if (editor) { editor.setOption('lint', this.props.mode && editor.getValue().trim().length > 0 ? this.lintOptions : false); editor.on('change', this._onEdit); @@ -197,7 +197,7 @@ export default class CodeEditor extends React.Component { this.addOverlay(); const getAllVariablesHandler = () => getAllVariables(this.props.collection, this.props.item); - + // Setup AutoComplete Helper for all modes const autoCompleteOptions = { showHintsFor: this.props.showHintsFor, diff --git a/packages/bruno-app/src/components/CodeEditor/index.spec.js b/packages/bruno-app/src/components/CodeEditor/index.spec.js index 973a8d3a9..b745890c0 100644 --- a/packages/bruno-app/src/components/CodeEditor/index.spec.js +++ b/packages/bruno-app/src/components/CodeEditor/index.spec.js @@ -10,10 +10,10 @@ jest.mock('codemirror', () => { const MOCK_THEME = { codemirror: { - bg: "#1e1e1e", - border: "#333", + bg: '#1e1e1e', + border: '#333' }, - textLink: "#007acc", + textLink: '#007acc' }; const setupEditorState = (editor, { value, cursorPosition }) => { @@ -27,8 +27,8 @@ const setupEditorState = (editor, { value, cursorPosition }) => { }); editor.state = { - completionActive: null, - } + completionActive: null + }; }; const setupEditorWithRef = () => { @@ -47,5 +47,5 @@ describe('CodeEditor', () => { jest.resetModules(); }); - it("add CodeEditor related tests here", () => {}); -}); \ No newline at end of file + it('add CodeEditor related tests here', () => {}); +}); diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/ApiKeyAuth/index.js b/packages/bruno-app/src/components/CollectionSettings/Auth/ApiKeyAuth/index.js index 2de1495c8..b2f70923f 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/ApiKeyAuth/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/ApiKeyAuth/index.js @@ -43,16 +43,16 @@ const ApiKeyAuth = ({ collection }) => { }; useEffect(() => { - !apikeyAuth?.placement && - dispatch( - updateCollectionAuth({ - mode: 'apikey', - collectionUid: collection.uid, - content: { - placement: 'header' - } - }) - ); + !apikeyAuth?.placement + && dispatch( + updateCollectionAuth({ + mode: 'apikey', + collectionUid: collection.uid, + content: { + placement: 'header' + } + }) + ); }, [apikeyAuth]); return ( diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/AuthMode/index.js b/packages/bruno-app/src/components/CollectionSettings/Auth/AuthMode/index.js index f7bd8f0b1..781e9f477 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/AuthMode/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/AuthMode/index.js @@ -87,7 +87,7 @@ const AuthMode = ({ collection }) => { }} > NTLM Auth -
+
{ diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/NTLMAuth/index.js b/packages/bruno-app/src/components/CollectionSettings/Auth/NTLMAuth/index.js index 50e1bbbc6..a967ccb48 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/NTLMAuth/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/NTLMAuth/index.js @@ -9,13 +9,7 @@ import { updateCollectionAuth } from 'providers/ReduxStore/slices/collections'; import { saveCollectionSettings } from 'providers/ReduxStore/slices/collections/actions'; import StyledWrapper from './StyledWrapper'; - - - - const NTLMAuth = ({ collection }) => { - - const dispatch = useDispatch(); const { storedTheme } = useTheme(); @@ -25,7 +19,6 @@ const NTLMAuth = ({ collection }) => { const handleSave = () => dispatch(saveCollectionSettings(collection.uid)); - const handleUsernameChange = (username) => { dispatch( updateCollectionAuth({ @@ -67,10 +60,7 @@ const NTLMAuth = ({ collection }) => { } }) ); - }; - - - + }; return ( diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/index.js b/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/index.js index 2dfe54c44..da0f8a38d 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/index.js @@ -10,7 +10,7 @@ import OAuth2ClientCredentials from 'components/RequestPane/Auth/OAuth2/ClientCr import OAuth2Implicit from 'components/RequestPane/Auth/OAuth2/Implicit/index'; import GrantTypeSelector from 'components/RequestPane/Auth/OAuth2/GrantTypeSelector/index'; -const GrantTypeComponentMap = ({collection }) => { +const GrantTypeComponentMap = ({ collection }) => { const dispatch = useDispatch(); const save = () => { diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/index.js b/packages/bruno-app/src/components/CollectionSettings/Auth/index.js index af457e6f4..0e643c4e7 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/index.js @@ -13,7 +13,6 @@ import StyledWrapper from './StyledWrapper'; import OAuth2 from './OAuth2'; import NTLMAuth from './NTLMAuth'; - const Auth = ({ collection }) => { const authMode = collection.draft?.root ? get(collection, 'draft.root.request.auth.mode') : get(collection, 'root.request.auth.mode'); const dispatch = useDispatch(); @@ -36,7 +35,7 @@ const Auth = ({ collection }) => { } case 'ntlm': { return ; - } + } case 'oauth2': { return ; } diff --git a/packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.js b/packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.js index c1707801c..b871be3e3 100644 --- a/packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.js @@ -39,7 +39,7 @@ const ClientCertSettings = ({ collection }) => { domain: Yup.string() .required() .trim() - .test('not-empty-after-trim', 'Domain is required', value => value && value.trim().length > 0), + .test('not-empty-after-trim', 'Domain is required', (value) => value && value.trim().length > 0), type: Yup.string().required().oneOf(['cert', 'pfx']), certFilePath: Yup.string().when('type', { is: (type) => type == 'cert', @@ -151,22 +151,22 @@ const ClientCertSettings = ({ collection }) => { {!clientCertConfig.length ? 'No client certificates added' : clientCertConfig.map((clientCert, index) => ( -
  • -
    -
    - - {clientCert.domain} -
    -
    - - {clientCert.type === 'cert' ? clientCert.certFilePath : clientCert.pfxFilePath} -
    +
  • +
    +
    + + {clientCert.domain} +
    +
    + + {clientCert.type === 'cert' ? clientCert.certFilePath : clientCert.pfxFilePath} +
    -
    -
  • - ))} +
    + + ))}

    Add Client Certificate

    diff --git a/packages/bruno-app/src/components/CollectionSettings/Docs/index.js b/packages/bruno-app/src/components/CollectionSettings/Docs/index.js index 38d314de5..00e2271b0 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Docs/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Docs/index.js @@ -38,21 +38,21 @@ const Docs = ({ collection }) => { })) ); toggleViewMode(); - } + }; const onSave = () => { dispatch(saveCollectionSettings(collection.uid)); toggleViewMode(); - } + }; return ( -
    -
    +
    +
    Documentation
    -
    +
    {isEditing ? ( <>
    @@ -81,14 +81,13 @@ const Docs = ({ collection }) => { fontSize={get(preferences, 'font.codeFontSize')} /> ) : ( -
    -
    +
    +
    { - docs?.length > 0 ? - - : - - } + docs?.length > 0 + ? + : + }
    )} @@ -98,7 +97,6 @@ const Docs = ({ collection }) => { export default Docs; - const documentationPlaceholder = ` Welcome to your collection documentation! This space is designed to help you document your API collection effectively. diff --git a/packages/bruno-app/src/components/CollectionSettings/Headers/index.js b/packages/bruno-app/src/components/CollectionSettings/Headers/index.js index a03c93506..e0846dff5 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Headers/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Headers/index.js @@ -123,8 +123,7 @@ const Headers = ({ collection }) => { }, header, 'name' - ) - } + )} autocomplete={headerAutoCompleteList} collection={collection} /> @@ -143,8 +142,7 @@ const Headers = ({ collection }) => { }, header, 'value' - ) - } + )} collection={collection} autocomplete={MimeTypes} /> diff --git a/packages/bruno-app/src/components/CollectionSettings/Overview/Info/index.js b/packages/bruno-app/src/components/CollectionSettings/Overview/Info/index.js index 2a09512de..be15d598d 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Overview/Info/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Overview/Info/index.js @@ -1,9 +1,9 @@ -import React from "react"; +import React from 'react'; import { getTotalRequestCountInCollection } from 'utils/collections/'; import { IconBox, IconFolder, IconWorld, IconApi, IconShare } from '@tabler/icons'; -import { areItemsLoading, getItemsLoadStats } from "utils/collections/index"; -import { useState } from "react"; -import ShareCollection from "components/ShareCollection/index"; +import { areItemsLoading, getItemsLoadStats } from 'utils/collections/index'; +import { useState } from 'react'; +import ShareCollection from 'components/ShareCollection/index'; const Info = ({ collection }) => { const totalRequestsInCollection = getTotalRequestCountInCollection(collection); @@ -11,10 +11,10 @@ const Info = ({ collection }) => { const isCollectionLoading = areItemsLoading(collection); const { loading: itemsLoadingCount, total: totalItems } = getItemsLoadStats(collection); const [showShareCollectionModal, toggleShowShareCollectionModal] = useState(false); - + const handleToggleShowShareCollectionModal = (value) => (e) => { toggleShowShareCollectionModal(value); - } + }; return (
    @@ -55,7 +55,7 @@ const Info = ({ collection }) => {
    Requests
    { - isCollectionLoading? `${totalItems - itemsLoadingCount} out of ${totalItems} requests in the collection loaded` : `${totalRequestsInCollection} request${totalRequestsInCollection !== 1 ? 's' : ''} in collection` + isCollectionLoading ? `${totalItems - itemsLoadingCount} out of ${totalItems} requests in the collection loaded` : `${totalRequestsInCollection} request${totalRequestsInCollection !== 1 ? 's' : ''} in collection` }
    @@ -79,4 +79,4 @@ const Info = ({ collection }) => { ); }; -export default Info; \ No newline at end of file +export default Info; diff --git a/packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js b/packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js index 4c7406580..d498ca451 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js @@ -1,7 +1,7 @@ import React from 'react'; -import { flattenItems } from "utils/collections"; +import { flattenItems } from 'utils/collections'; import { IconAlertTriangle } from '@tabler/icons'; -import StyledWrapper from "./StyledWrapper"; +import StyledWrapper from './StyledWrapper'; import { useDispatch, useSelector } from 'react-redux'; import { isItemARequest, itemIsOpenedInTabs } from 'utils/tabs/index'; import { getDefaultRequestPaneTab } from 'utils/collections/index'; @@ -12,13 +12,13 @@ const RequestsNotLoaded = ({ collection }) => { const dispatch = useDispatch(); const tabs = useSelector((state) => state.tabs.tabs); const flattenedItems = flattenItems(collection.items); - const itemsFailedLoading = flattenedItems?.filter(item => item?.partial && !item?.loading); + const itemsFailedLoading = flattenedItems?.filter((item) => item?.partial && !item?.loading); if (!itemsFailedLoading?.length) { return null; } - const handleRequestClick = (item) => e => { + const handleRequestClick = (item) => (e) => { e.preventDefault(); if (isItemARequest(item)) { dispatch(hideHomePage()); @@ -39,7 +39,7 @@ const RequestsNotLoaded = ({ collection }) => { ); return; } - } + }; return ( @@ -61,7 +61,7 @@ const RequestsNotLoaded = ({ collection }) => { {flattenedItems?.map((item, index) => ( item?.partial && !item?.loading ? ( - + {item?.pathname?.split(`${collection?.pathname}/`)?.[1]} diff --git a/packages/bruno-app/src/components/CollectionSettings/Overview/index.js b/packages/bruno-app/src/components/CollectionSettings/Overview/index.js index 9792c224c..806ac2a53 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Overview/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Overview/index.js @@ -1,8 +1,8 @@ -import StyledWrapper from "./StyledWrapper"; -import Docs from "../Docs"; -import Info from "./Info"; +import StyledWrapper from './StyledWrapper'; +import Docs from '../Docs'; +import Info from './Info'; import { IconBox } from '@tabler/icons'; -import RequestsNotLoaded from "./RequestsNotLoaded"; +import RequestsNotLoaded from './RequestsNotLoaded'; const Overview = ({ collection }) => { return ( @@ -22,6 +22,6 @@ const Overview = ({ collection }) => {
    ); -} +}; -export default Overview; \ No newline at end of file +export default Overview; diff --git a/packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js b/packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js index 039b2eab8..9b7f07073 100644 --- a/packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js @@ -156,9 +156,9 @@ const ProxySettings = ({ collection }) => {
      -
    • global - use global proxy config
    • -
    • enabled - use collection proxy config
    • -
    • disable - disable proxy
    • +
    • global - use global proxy config
    • +
    • enabled - use collection proxy config
    • +
    • disable - disable proxy
    @@ -367,4 +367,4 @@ const ProxySettings = ({ collection }) => { ); }; -export default ProxySettings; \ No newline at end of file +export default ProxySettings; diff --git a/packages/bruno-app/src/components/CollectionSettings/Vars/VarsTable/index.js b/packages/bruno-app/src/components/CollectionSettings/Vars/VarsTable/index.js index e84ddc081..25136bfa3 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Vars/VarsTable/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Vars/VarsTable/index.js @@ -127,8 +127,7 @@ const VarsTable = ({ collection, vars, varType }) => { }, _var, 'value' - ) - } + )} collection={collection} /> diff --git a/packages/bruno-app/src/components/Cookies/ModifyCookieModal/index.js b/packages/bruno-app/src/components/Cookies/ModifyCookieModal/index.js index b35c360ee..a59e5ed9f 100644 --- a/packages/bruno-app/src/components/Cookies/ModifyCookieModal/index.js +++ b/packages/bruno-app/src/components/Cookies/ModifyCookieModal/index.js @@ -125,7 +125,7 @@ const ModifyCookieModal = ({ onClose, domain, cookie }) => { ); if (!isEmpty(validationErrors)) { - toast.error(Object.values(validationErrors).join("\n")); + toast.error(Object.values(validationErrors).join('\n')); return; } @@ -208,7 +208,7 @@ const ModifyCookieModal = ({ onClose, domain, cookie }) => { onClose={onClose} handleCancel={onClose} handleConfirm={onSubmit} - customHeader={ + customHeader={(

    {title}

    @@ -223,7 +223,7 @@ const ModifyCookieModal = ({ onClose, domain, cookie }) => {
    - } + )} >
    e.preventDefault()} className="px-2"> {isRawMode ? ( diff --git a/packages/bruno-app/src/components/Cookies/index.js b/packages/bruno-app/src/components/Cookies/index.js index b00bd5a48..c5138bcbb 100644 --- a/packages/bruno-app/src/components/Cookies/index.js +++ b/packages/bruno-app/src/components/Cookies/index.js @@ -72,7 +72,7 @@ const CollectionProperties = ({ onClose }) => { const [searchText, setSearchText] = useState(null); const handleAddCookie = (domain) => { - if(domain) setCurrentDomain(domain); + if (domain) setCurrentDomain(domain); setIsModifyCookieModalOpen(true); }; diff --git a/packages/bruno-app/src/components/Devtools/Console/DebugTab/StyledWrapper.js b/packages/bruno-app/src/components/Devtools/Console/DebugTab/StyledWrapper.js index e8e95b070..1180739fd 100644 --- a/packages/bruno-app/src/components/Devtools/Console/DebugTab/StyledWrapper.js +++ b/packages/bruno-app/src/components/Devtools/Console/DebugTab/StyledWrapper.js @@ -160,4 +160,4 @@ const StyledWrapper = styled.div` } `; -export default StyledWrapper; \ No newline at end of file +export default StyledWrapper; diff --git a/packages/bruno-app/src/components/Devtools/Console/DebugTab/index.js b/packages/bruno-app/src/components/Devtools/Console/DebugTab/index.js index 1faa14ec7..a5810e3bc 100644 --- a/packages/bruno-app/src/components/Devtools/Console/DebugTab/index.js +++ b/packages/bruno-app/src/components/Devtools/Console/DebugTab/index.js @@ -1,7 +1,7 @@ import React from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { IconBug } from '@tabler/icons'; -import { +import { setSelectedError, clearDebugErrors } from 'providers/ReduxStore/slices/logs'; @@ -10,10 +10,10 @@ import StyledWrapper from './StyledWrapper'; const ErrorRow = ({ error, isSelected, onClick }) => { const formatTime = (timestamp) => { const date = new Date(timestamp); - return date.toLocaleTimeString('en-US', { - hour12: false, - hour: '2-digit', - minute: '2-digit', + return date.toLocaleTimeString('en-US', { + hour12: false, + hour: '2-digit', + minute: '2-digit', second: '2-digit', fractionalSecondDigits: 3 }); @@ -38,18 +38,18 @@ const ErrorRow = ({ error, isSelected, onClick }) => { }; return ( -
    {getShortMessage(error.message)}
    - +
    {getLocation(error)}
    - +
    {formatTime(error.timestamp)}
    @@ -59,7 +59,7 @@ const ErrorRow = ({ error, isSelected, onClick }) => { const DebugTab = () => { const dispatch = useDispatch(); - const { debugErrors, selectedError } = useSelector(state => state.logs); + const { debugErrors, selectedError } = useSelector((state) => state.logs); const handleErrorClick = (error) => { dispatch(setSelectedError(error)); @@ -85,7 +85,7 @@ const DebugTab = () => {
    Location
    Time
    - +
    {debugErrors.map((error, index) => ( { ); }; -export default DebugTab; \ No newline at end of file +export default DebugTab; diff --git a/packages/bruno-app/src/components/Devtools/Console/ErrorDetailsPanel/StyledWrapper.js b/packages/bruno-app/src/components/Devtools/Console/ErrorDetailsPanel/StyledWrapper.js index c7d4360ac..09299b0df 100644 --- a/packages/bruno-app/src/components/Devtools/Console/ErrorDetailsPanel/StyledWrapper.js +++ b/packages/bruno-app/src/components/Devtools/Console/ErrorDetailsPanel/StyledWrapper.js @@ -225,4 +225,4 @@ const StyledWrapper = styled.div` } `; -export default StyledWrapper; \ No newline at end of file +export default StyledWrapper; diff --git a/packages/bruno-app/src/components/Devtools/Console/ErrorDetailsPanel/index.js b/packages/bruno-app/src/components/Devtools/Console/ErrorDetailsPanel/index.js index 91499b4a3..e4017f10d 100644 --- a/packages/bruno-app/src/components/Devtools/Console/ErrorDetailsPanel/index.js +++ b/packages/bruno-app/src/components/Devtools/Console/ErrorDetailsPanel/index.js @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import { useSelector, useDispatch } from 'react-redux'; -import { +import { IconX, IconBug, IconFileText, @@ -15,7 +15,7 @@ import StyledWrapper from './StyledWrapper'; const ErrorInfoTab = ({ error }) => { const { version } = useApp(); - + const formatTimestamp = (timestamp) => { const date = new Date(timestamp); return date.toLocaleString(); @@ -23,7 +23,7 @@ const ErrorInfoTab = ({ error }) => { const generateGitHubIssueUrl = () => { const title = `Bug: ${error.message.substring(0, 50)}${error.message.length > 50 ? '...' : ''}`; - + const body = `## Bug Report ### Error Details @@ -66,7 +66,7 @@ ${error.args ? error.args.map((arg, index) => { const encodedTitle = encodeURIComponent(title); const encodedBody = encodeURIComponent(body); - + return `https://github.com/usebruno/bruno/issues/new?template=BLANK_ISSUE&title=${encodedTitle}&body=${encodedBody}`; }; @@ -84,33 +84,33 @@ ${error.args ? error.args.map((arg, index) => { {error.message || 'No message available'}
    - + {error.filename && (
    {error.filename}
    )} - + {error.lineno && (
    {error.lineno}{error.colno ? `:${error.colno}` : ''}
    )} - +
    {formatTimestamp(error.timestamp)}
    - +

    Report Issue

    Found a bug? Help us improve Bruno by reporting this error on GitHub.

    -
    - -
    - - - - - - + {isOpen && ( -
    +
    Filter by Method -
    - +
    - {Object.keys(filters).map(method => ( + {Object.keys(filters).map((method) => (