refactor: enforce semicolons in ts

pull/9/head
sualko 2020-04-27 16:50:45 +02:00
parent 938e8ee68c
commit 29c990692f
6 changed files with 17 additions and 16 deletions

View File

@ -29,5 +29,6 @@ module.exports = {
'array-bracket-newline': ['error', 'consistent'], 'array-bracket-newline': ['error', 'consistent'],
'quote-props': ['error', 'as-needed'], 'quote-props': ['error', 'as-needed'],
'indent': ['warn', 'tab'], 'indent': ['warn', 'tab'],
semi: ["error", "always"],
}, },
} }

View File

@ -27,7 +27,7 @@ function sortRooms(key: SortKey, orderBy: SortOrder) {
return 0; return 0;
} }
} };
} }
type Props = { type Props = {
@ -126,7 +126,7 @@ const App: React.FC<Props> = () => {
</tfoot> </tfoot>
</table> </table>
</div> </div>
) );
} };
export default App; export default App;

View File

@ -21,11 +21,11 @@ const NewRoomForm: React.FC<Props> = (props) => {
className="newgroup-name" className="newgroup-name"
value={name} value={name}
placeholder="Room name" placeholder="Room name"
onChange={(event) => {setName(event.target.value)}} /> onChange={(event) => {setName(event.target.value);}} />
<input type="submit" value="Create" /> <input type="submit" value="Create" />
</form> </form>
) );
} };
export default NewRoomForm; export default NewRoomForm;

View File

@ -26,7 +26,7 @@ const EditableValue: React.FC<EditableValueProps> = ({ setValue, setActive, acti
onClick={event => event.stopPropagation()} onClick={event => event.stopPropagation()}
initialValue={value} initialValue={value}
type={type} type={type}
/> />;
} }
function onClick(ev) { function onClick(ev) {
@ -36,7 +36,7 @@ const EditableValue: React.FC<EditableValueProps> = ({ setValue, setActive, acti
} }
return <a className="action-rename" onClick={onClick}>{value}</a>; return <a className="action-rename" onClick={onClick}>{value}</a>;
} };
const RoomRow: React.FC<Props> = (props) => { const RoomRow: React.FC<Props> = (props) => {
const [activeEdit, setActiveEdit] = useState(''); const [activeEdit, setActiveEdit] = useState('');
@ -67,7 +67,7 @@ const RoomRow: React.FC<Props> = (props) => {
} }
function edit(field: string, type: 'text' | 'number' = 'text'){ function edit(field: string, type: 'text' | 'number' = 'text'){
return <EditableValue field={field} value={room[field]} active={activeEdit} setActive={setActiveEdit} setValue={updateRoom} type={type} /> return <EditableValue field={field} value={room[field]} active={activeEdit} setActive={setActiveEdit} setValue={updateRoom} type={type} />;
} }
return ( return (
@ -99,7 +99,7 @@ const RoomRow: React.FC<Props> = (props) => {
title="Delete" /> title="Delete" />
</td> </td>
</tr> </tr>
) );
} };
export default RoomRow; export default RoomRow;

View File

@ -6,5 +6,5 @@ $(() => {
OCP.AppConfig.setValue('bbb', 'api.url', this['api.url'].value); OCP.AppConfig.setValue('bbb', 'api.url', this['api.url'].value);
OCP.AppConfig.setValue('bbb', 'api.secret', this['api.secret'].value); OCP.AppConfig.setValue('bbb', 'api.secret', this['api.secret'].value);
}) });
}); });

View File

@ -6,9 +6,9 @@ declare const OCA: any;
class BigBlueButton { class BigBlueButton {
public async getRooms(): Promise<Room[]> { public async getRooms(): Promise<Room[]> {
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/msword',
'application/vnd.ms-powerpoint', 'application/vnd.ms-powerpoint',
]; ];
const bbb = new BigBlueButton() const bbb = new BigBlueButton();
bbb.getRooms().then(rooms => { bbb.getRooms().then(rooms => {
rooms.forEach(room => { rooms.forEach(room => {
mimeTypes.forEach(mime => registerFileAction(mime, room.id, room.uid, room.name)); mimeTypes.forEach(mime => registerFileAction(mime, room.id, room.uid, room.name));
}) });
}); });
function registerFileAction(mime, id, uid, name) { function registerFileAction(mime, id, uid, name) {