From e2bb35a1b0b95ff25a1ab3678ca95f3983ce3f74 Mon Sep 17 00:00:00 2001 From: freshavocado7 Date: Thu, 26 Sep 2024 13:18:28 +0200 Subject: [PATCH] fix: Resolve trailing whitespace issue --- frontend/.eslintrc.cjs | 15 ++++++++++----- frontend/.prettierrc.js | 2 ++ frontend/src/components/ModelDiff.jsx | 4 ---- frontend/src/components/TemplateDetails.jsx | 13 ++++++------- frontend/src/components/WiredTemplatesList.jsx | 5 +++-- frontend/src/views/ModelComparisonView.jsx | 4 ++-- frontend/src/views/TemplateView.jsx | 4 ++-- 7 files changed, 25 insertions(+), 22 deletions(-) diff --git a/frontend/.eslintrc.cjs b/frontend/.eslintrc.cjs index b7db9aa..0c5238e 100644 --- a/frontend/.eslintrc.cjs +++ b/frontend/.eslintrc.cjs @@ -9,12 +9,17 @@ module.exports = { 'plugin:react/recommended', 'plugin:react/jsx-runtime', 'plugin:react-hooks/recommended', - 'plugin:storybook/recommended' + 'plugin:storybook/recommended', + 'prettier' ], ignorePatterns: ['dist', '.eslintrc.cjs'], parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, - settings: { react: { version: '18.2' } }, - plugins: ['react-refresh'], + settings: { + react: { + version: '18.2' + } + }, + plugins: ['react-refresh', 'prettier'], rules: { 'react/jsx-no-target-blank': 'off', 'react/prop-types': 'off', @@ -22,7 +27,7 @@ module.exports = { 'warn', { allowConstantExport: true } ], - 'max-len': ['error', { code: 100 }], - 'react/no-unescaped-entities': 'off' + 'max-len': ['error', { code: 100, ignoreUrls: true, ignoreStrings: true }], + 'prettier/prettier': ['error'] } }; diff --git a/frontend/.prettierrc.js b/frontend/.prettierrc.js index 9585637..2947e97 100644 --- a/frontend/.prettierrc.js +++ b/frontend/.prettierrc.js @@ -15,5 +15,7 @@ module.exports = { singleQuote: true, trailingComma: 'none', bracketSameLine: true, + endOfLine: 'lf', + useTabs: false, endingPosition: 'absolute-with-indent' }; diff --git a/frontend/src/components/ModelDiff.jsx b/frontend/src/components/ModelDiff.jsx index 52872e9..0c086a9 100644 --- a/frontend/src/components/ModelDiff.jsx +++ b/frontend/src/components/ModelDiff.jsx @@ -141,10 +141,6 @@ export const ModelDiff = ({ onRefetch, hasDiffed }) => {

Cannot generate model diff: {error}

-

- Select 'Deep clone' before running the session or run - model within git repo. -

) : ( <> diff --git a/frontend/src/components/TemplateDetails.jsx b/frontend/src/components/TemplateDetails.jsx index f293c58..002bc05 100644 --- a/frontend/src/components/TemplateDetails.jsx +++ b/frontend/src/components/TemplateDetails.jsx @@ -110,11 +110,10 @@ export const TemplateDetails = ({ endpoint, onSingleInstance }) => { }} className={`${ objectID && object.idx === objectID - ? `w-full bg-custom-blue text-white dark:bg-custom-blue - dark:text-gray-100` - : `w-full bg-gray-200 text-gray-900 - dark:bg-custom-dark-4` - + ? `w-full bg-custom-blue text-white + dark:bg-custom-blue ` + 'dark:text-gray-100' + : 'w-full bg-gray-200 text-gray-900 ' + + 'dark:bg-custom-dark-4' } dark:bg-dark-quaternary m-2 min-w-0 cursor-pointer rounded-lg shadow-md hover:bg-custom-blue hover:text-white dark:border-gray-700 dark:shadow-dark @@ -122,8 +121,8 @@ export const TemplateDetails = ({ endpoint, onSingleInstance }) => {
+ dark:text-gray-100 + ${objectID && object.idx === objectID ? '' : ''}`}> {object.name}
diff --git a/frontend/src/components/WiredTemplatesList.jsx b/frontend/src/components/WiredTemplatesList.jsx index 4ad9668..34ba87f 100644 --- a/frontend/src/components/WiredTemplatesList.jsx +++ b/frontend/src/components/WiredTemplatesList.jsx @@ -32,8 +32,9 @@ export const WiredTemplatesList = () => { if (error) { return (
+ className={ + 'rounded bg-red-500 p-4 text-2xl text-white dark:bg-custom-dark-error' + }> {error === 'Failed to fetch' ? `Can't connect to the server. Maybe your session was inactive for too long? If that's the case, request a new session / restart the app.` diff --git a/frontend/src/views/ModelComparisonView.jsx b/frontend/src/views/ModelComparisonView.jsx index a9da790..c666b19 100644 --- a/frontend/src/views/ModelComparisonView.jsx +++ b/frontend/src/views/ModelComparisonView.jsx @@ -114,8 +114,8 @@ export const ModelComparisonView = ({ endpoint }) => { )}
+ className={`flex-1 overflow-y-hidden + ${isSmallScreen ? (isSidebarVisible ? 'pl-96' : '') : 'pl-96'}`}>
{objectID && }
diff --git a/frontend/src/views/TemplateView.jsx b/frontend/src/views/TemplateView.jsx index 38b3f35..7a8f6a3 100644 --- a/frontend/src/views/TemplateView.jsx +++ b/frontend/src/views/TemplateView.jsx @@ -84,8 +84,8 @@ export const TemplateView = ({ endpoint }) => {

+ dark:text-gray-300 + ${isSidebarVisible && isSmallScreen ? 'hidden' : ''}`}> Select an Instance

)}