From 29c990692f0744ea65e136c53beaf6928b51db98 Mon Sep 17 00:00:00 2001 From: sualko Date: Mon, 27 Apr 2020 16:50:45 +0200 Subject: [PATCH] refactor: enforce semicolons in ts --- .eslintrc.js | 1 + ts/Manager/App.tsx | 6 +++--- ts/Manager/NewRoomForm.tsx | 6 +++--- ts/Manager/RoomRow.tsx | 10 +++++----- ts/admin.ts | 2 +- ts/filelist.ts | 8 ++++---- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 712bbc2..b34149c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -29,5 +29,6 @@ module.exports = { 'array-bracket-newline': ['error', 'consistent'], 'quote-props': ['error', 'as-needed'], 'indent': ['warn', 'tab'], + semi: ["error", "always"], }, } \ No newline at end of file diff --git a/ts/Manager/App.tsx b/ts/Manager/App.tsx index ef60dd7..f9f77de 100644 --- a/ts/Manager/App.tsx +++ b/ts/Manager/App.tsx @@ -27,7 +27,7 @@ function sortRooms(key: SortKey, orderBy: SortOrder) { return 0; } - } + }; } type Props = { @@ -126,7 +126,7 @@ const App: React.FC = () => { - ) -} + ); +}; export default App; \ No newline at end of file diff --git a/ts/Manager/NewRoomForm.tsx b/ts/Manager/NewRoomForm.tsx index 2dd1ec5..7467e2c 100644 --- a/ts/Manager/NewRoomForm.tsx +++ b/ts/Manager/NewRoomForm.tsx @@ -21,11 +21,11 @@ const NewRoomForm: React.FC = (props) => { className="newgroup-name" value={name} placeholder="Room name" - onChange={(event) => {setName(event.target.value)}} /> + onChange={(event) => {setName(event.target.value);}} /> - ) -} + ); +}; export default NewRoomForm; \ No newline at end of file diff --git a/ts/Manager/RoomRow.tsx b/ts/Manager/RoomRow.tsx index 198ab8b..06ce89f 100644 --- a/ts/Manager/RoomRow.tsx +++ b/ts/Manager/RoomRow.tsx @@ -26,7 +26,7 @@ const EditableValue: React.FC = ({ setValue, setActive, acti onClick={event => event.stopPropagation()} initialValue={value} type={type} - /> + />; } function onClick(ev) { @@ -36,7 +36,7 @@ const EditableValue: React.FC = ({ setValue, setActive, acti } return {value}; -} +}; const RoomRow: React.FC = (props) => { const [activeEdit, setActiveEdit] = useState(''); @@ -67,7 +67,7 @@ const RoomRow: React.FC = (props) => { } function edit(field: string, type: 'text' | 'number' = 'text'){ - return + return ; } return ( @@ -99,7 +99,7 @@ const RoomRow: React.FC = (props) => { title="Delete" /> - ) -} + ); +}; export default RoomRow; \ No newline at end of file diff --git a/ts/admin.ts b/ts/admin.ts index 0418e87..ec847b5 100644 --- a/ts/admin.ts +++ b/ts/admin.ts @@ -6,5 +6,5 @@ $(() => { OCP.AppConfig.setValue('bbb', 'api.url', this['api.url'].value); OCP.AppConfig.setValue('bbb', 'api.secret', this['api.secret'].value); - }) + }); }); \ No newline at end of file diff --git a/ts/filelist.ts b/ts/filelist.ts index d3e4889..0d0e59e 100644 --- a/ts/filelist.ts +++ b/ts/filelist.ts @@ -6,9 +6,9 @@ declare const OCA: any; class BigBlueButton { public async getRooms(): Promise { - const response = await axios.get(OC.generateUrl('/apps/bbb/rooms')) + const response = await axios.get(OC.generateUrl('/apps/bbb/rooms')); - return response.data + return response.data; } } @@ -27,12 +27,12 @@ $(() => { 'application/msword', 'application/vnd.ms-powerpoint', ]; - const bbb = new BigBlueButton() + const bbb = new BigBlueButton(); bbb.getRooms().then(rooms => { rooms.forEach(room => { mimeTypes.forEach(mime => registerFileAction(mime, room.id, room.uid, room.name)); - }) + }); }); function registerFileAction(mime, id, uid, name) {