mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-21 17:48:27 +00:00
lint js
This commit is contained in:
@@ -109,7 +109,7 @@ const BrewCleanup = ({})=>{
|
|||||||
<td style={{ width: '200px' }}>{Moment(brew.updatedAt).fromNow()}</td>
|
<td style={{ width: '200px' }}>{Moment(brew.updatedAt).fromNow()}</td>
|
||||||
<td>{brew.lastViewed ? Moment(brew.lastViewed).fromNow() : 'No last viewed date'}</td>
|
<td>{brew.lastViewed ? Moment(brew.lastViewed).fromNow() : 'No last viewed date'}</td>
|
||||||
<td>{brew.googleId ? 'Google' : 'Homebrewery'}</td>
|
<td>{brew.googleId ? 'Google' : 'Homebrewery'}</td>
|
||||||
</tr>
|
</tr>;
|
||||||
})}
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -120,7 +120,7 @@ const BrewCleanup = ({})=>{
|
|||||||
|
|
||||||
return <div className='result'>
|
return <div className='result'>
|
||||||
{deleteButton && <button onClick={()=>cleanup(type)} className='remove'>
|
{deleteButton && <button onClick={()=>cleanup(type)} className='remove'>
|
||||||
{pendingLost && type === "lost" || pendingJunk && type === "junk"
|
{pendingLost && type === 'lost' || pendingJunk && type === 'junk'
|
||||||
? <i className='fas fa-spin fa-spinner' />
|
? <i className='fas fa-spin fa-spinner' />
|
||||||
: <span><i className='fas fa-times' /> Remove</span>
|
: <span><i className='fas fa-times' /> Remove</span>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,8 +31,7 @@ export async function formatCSS(view) {
|
|||||||
//Prettier can't do it by default, this is crude but it works
|
//Prettier can't do it by default, this is crude but it works
|
||||||
formatted = formatted.replace(
|
formatted = formatted.replace(
|
||||||
/([^{]+)\{\s*\n\s*([^;\n]+:[^;\n]+;)\s*\n\s*\}(\s*)/g,
|
/([^{]+)\{\s*\n\s*([^;\n]+:[^;\n]+;)\s*\n\s*\}(\s*)/g,
|
||||||
(_, selector, decl, whitespace) =>
|
(_, selector, decl, whitespace)=>`${selector} { ${decl.trim()} }${whitespace}`
|
||||||
`${selector} { ${decl.trim()} }${whitespace}`
|
|
||||||
);
|
);
|
||||||
if(formatted === code) return true;
|
if(formatted === code) return true;
|
||||||
|
|
||||||
|
|||||||
@@ -158,8 +158,7 @@ const BrewRenderer = (props)=>{
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderDummyPage = (index)=>
|
const renderDummyPage = (index)=><div className='phb page' id={`p${index + 1}`} key={index}>
|
||||||
<div className='phb page' id={`p${index + 1}`} key={index}>
|
|
||||||
<i className='fas fa-spinner fa-spin' />
|
<i className='fas fa-spinner fa-spin' />
|
||||||
</div>;
|
</div>;
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default function(){
|
|||||||
return ()=>{
|
return ()=>{
|
||||||
document.removeEventListener('print:startprep', handlePrintStartPrep);
|
document.removeEventListener('print:startprep', handlePrintStartPrep);
|
||||||
document.removeEventListener('print:finishedprep', handlePrintPrepFinished);
|
document.removeEventListener('print:finishedprep', handlePrintPrepFinished);
|
||||||
}
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handlePrintStartPrep = ()=>{ setPrinting(true); };
|
const handlePrintStartPrep = ()=>{ setPrinting(true); };
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import _ from 'lodash';
|
|||||||
|
|
||||||
import { DEFAULT_BREW_LOAD } from '../../../../server/brewDefaults.js';
|
import { DEFAULT_BREW_LOAD } from '../../../../server/brewDefaults.js';
|
||||||
|
|
||||||
import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.jsx'
|
import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.jsx';
|
||||||
|
|
||||||
import SplitPane from '@components/splitPane/splitPane.jsx';
|
import SplitPane from '@components/splitPane/splitPane.jsx';
|
||||||
import Editor from '../../editor/editor.jsx';
|
import Editor from '../../editor/editor.jsx';
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import _ from 'lodash';
|
|||||||
|
|
||||||
import { DEFAULT_BREW } from '../../../../server/brewDefaults.js';
|
import { DEFAULT_BREW } from '../../../../server/brewDefaults.js';
|
||||||
|
|
||||||
import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.jsx'
|
import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.jsx';
|
||||||
|
|
||||||
import SplitPane from '@components/splitPane/splitPane.jsx';
|
import SplitPane from '@components/splitPane/splitPane.jsx';
|
||||||
import Editor from '../../editor/editor.jsx';
|
import Editor from '../../editor/editor.jsx';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* eslint-disable max-lines */
|
|
||||||
import './newPage.less';
|
import './newPage.less';
|
||||||
|
|
||||||
// Common imports
|
// Common imports
|
||||||
@@ -10,7 +10,7 @@ import _ from 'lodash';
|
|||||||
import { DEFAULT_BREW } from '../../../../server/brewDefaults.js';
|
import { DEFAULT_BREW } from '../../../../server/brewDefaults.js';
|
||||||
import { printCurrentBrew, fetchThemeBundle, splitTextStyleAndMetadata } from '@shared/helpers.js';
|
import { printCurrentBrew, fetchThemeBundle, splitTextStyleAndMetadata } from '@shared/helpers.js';
|
||||||
|
|
||||||
import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.jsx'
|
import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.jsx';
|
||||||
|
|
||||||
import SplitPane from '@components/splitPane/splitPane.jsx';
|
import SplitPane from '@components/splitPane/splitPane.jsx';
|
||||||
import Editor from '../../editor/editor.jsx';
|
import Editor from '../../editor/editor.jsx';
|
||||||
|
|||||||
@@ -180,5 +180,5 @@ export default function useCommonEditPageFunctions(dependencies) {
|
|||||||
renderSaveButton,
|
renderSaveButton,
|
||||||
autoSaveEnabled,
|
autoSaveEnabled,
|
||||||
unsavedChanges,
|
unsavedChanges,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
+3
-3
@@ -285,9 +285,9 @@ export default async function createApp(vite) {
|
|||||||
'<head>',
|
'<head>',
|
||||||
`<head>\n`
|
`<head>\n`
|
||||||
+ `<script id="props">`
|
+ `<script id="props">`
|
||||||
+ `window.__INITIAL_PROPS__ = ` + safeProps
|
+ `window.__INITIAL_PROPS__ = ${safeProps
|
||||||
+ `</script>\n`
|
}</script>\n${
|
||||||
+ ogMetaTags
|
ogMetaTags}`
|
||||||
);
|
);
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
|
|||||||
Reference in New Issue
Block a user