mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-07-27 19:57:11 +00:00
alphabetize imports
This commit is contained in:
+14
-5
@@ -1,10 +1,10 @@
|
||||
module.exports = {
|
||||
parser: '@typescript-eslint/parser',
|
||||
extends: [
|
||||
"eslint:recommended",
|
||||
'eslint:recommended',
|
||||
'plugin:react/recommended',
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
'plugin:@typescript-eslint/eslint-recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'prettier/@typescript-eslint',
|
||||
'plugin:prettier/recommended',
|
||||
'plugin:import/errors',
|
||||
@@ -15,7 +15,16 @@ module.exports = {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'module',
|
||||
},
|
||||
plugins: ['react'],
|
||||
rules: {
|
||||
"import/order": ["error", {}]
|
||||
}
|
||||
curly: 'error',
|
||||
'no-multi-spaces': 'error',
|
||||
'no-trailing-spaces': 'error',
|
||||
'no-multiple-empty-lines': 'error',
|
||||
'sort-imports': ['error', { ignoreDeclarationSort: true }],
|
||||
'import/order': ['error', { alphabetize: { order: 'asc' } }],
|
||||
},
|
||||
settings: {
|
||||
react: { version: 'detect' },
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Action } from 'redux';
|
||||
import { HubType, Result, ProtectionLevel, Command } from '../protocols/bootloader';
|
||||
import { Command, HubType, ProtectionLevel, Result } from '../protocols/bootloader';
|
||||
|
||||
/**
|
||||
* Bootloader BLE connection actions.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import Button from 'react-bootstrap/Button';
|
||||
import Image from 'react-bootstrap/Image';
|
||||
import OverlayTrigger from 'react-bootstrap/OverlayTrigger';
|
||||
import Tooltip from 'react-bootstrap/Tooltip';
|
||||
import Image from 'react-bootstrap/Image';
|
||||
import React from 'react';
|
||||
|
||||
export interface ActionButtonProps<T = undefined> {
|
||||
/** A unique id for each instance. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import App from './App';
|
||||
|
||||
test('renders learn react link', () => {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
import Container from 'react-bootstrap/Container';
|
||||
import Editor from './Editor';
|
||||
import Toolbar from './Toolbar';
|
||||
import Terminal from './Terminal';
|
||||
import StatusBar from './Statusbar';
|
||||
import Terminal from './Terminal';
|
||||
import Toolbar from './Toolbar';
|
||||
|
||||
function App(): JSX.Element {
|
||||
return (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { ThunkDispatch } from 'redux-thunk';
|
||||
import { AnyAction } from 'redux';
|
||||
import { ThunkDispatch } from 'redux-thunk';
|
||||
import { connect as bleConnect, disconnect as bleDisconnect } from '../actions/ble';
|
||||
import { RootState } from '../reducers';
|
||||
import { BLEConnectionState } from '../reducers/ble';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import React, { ReactElement } from 'react';
|
||||
import { ReactReduxContext } from 'react-redux';
|
||||
import AceEditor from 'react-ace';
|
||||
import Row from 'react-bootstrap/Row';
|
||||
import Col from 'react-bootstrap/Col';
|
||||
import Row from 'react-bootstrap/Row';
|
||||
import { ReactReduxContext } from 'react-redux';
|
||||
import { setEditSession } from '../actions/editor';
|
||||
|
||||
import 'ace-builds/src-noconflict/mode-python';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { ThunkDispatch } from 'redux-thunk';
|
||||
import { AnyAction } from 'redux';
|
||||
import { RootState } from '../reducers';
|
||||
import { ThunkDispatch } from 'redux-thunk';
|
||||
import { flashFirmware } from '../actions/bootloader';
|
||||
import { RootState } from '../reducers';
|
||||
import { BootloaderConnectionState } from '../reducers/bootloader';
|
||||
import OpenFileButton, { OpenFileButtonProps } from './OpenFileButton';
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
import Dropzone from 'react-dropzone';
|
||||
import Button from 'react-bootstrap/Button';
|
||||
import Image from 'react-bootstrap/Image';
|
||||
import OverlayTrigger from 'react-bootstrap/OverlayTrigger';
|
||||
import Tooltip from 'react-bootstrap/Tooltip';
|
||||
import Image from 'react-bootstrap/Image';
|
||||
import Dropzone from 'react-dropzone';
|
||||
|
||||
export interface OpenFileButtonProps {
|
||||
/** A unique id for each instance. */
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { ThunkDispatch } from 'redux-thunk';
|
||||
import { AnyAction } from 'redux';
|
||||
import { ThunkDispatch } from 'redux-thunk';
|
||||
import { startRepl } from '../actions/hub';
|
||||
import { RootState } from '../reducers';
|
||||
import { HubRuntimeState } from '../reducers/hub';
|
||||
import { startRepl } from '../actions/hub';
|
||||
import ActionButton, { ActionButtonProps } from './ActionButton';
|
||||
|
||||
type Dispatch = ThunkDispatch<{}, {}, AnyAction>;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { connect, batch } from 'react-redux';
|
||||
import { ThunkDispatch } from 'redux-thunk';
|
||||
import { AnyAction } from 'redux';
|
||||
import { Ace } from 'ace-builds';
|
||||
import { batch, connect } from 'react-redux';
|
||||
import { AnyAction } from 'redux';
|
||||
import { ThunkDispatch } from 'redux-thunk';
|
||||
import { downloadAndRun } from '../actions/hub';
|
||||
import { compile } from '../actions/mpy';
|
||||
import { RootState } from '../reducers';
|
||||
import { HubRuntimeState } from '../reducers/hub';
|
||||
import { compile } from '../actions/mpy';
|
||||
import { downloadAndRun } from '../actions/hub';
|
||||
import ActionButton, { ActionButtonProps } from './ActionButton';
|
||||
|
||||
type Dispatch = ThunkDispatch<{}, {}, AnyAction>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import Row from 'react-bootstrap/Row';
|
||||
import Col from 'react-bootstrap/Col';
|
||||
import ProgressBar from 'react-bootstrap/ProgressBar';
|
||||
import Row from 'react-bootstrap/Row';
|
||||
import { BLEConnectionState } from '../reducers/ble';
|
||||
|
||||
interface StatusBarState {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { ThunkDispatch } from 'redux-thunk';
|
||||
import { AnyAction } from 'redux';
|
||||
import { ThunkDispatch } from 'redux-thunk';
|
||||
import { stop } from '../actions/hub';
|
||||
import { RootState } from '../reducers';
|
||||
import { HubRuntimeState } from '../reducers/hub';
|
||||
import { stop } from '../actions/hub';
|
||||
import ActionButton, { ActionButtonProps } from './ActionButton';
|
||||
|
||||
type Dispatch = ThunkDispatch<{}, {}, AnyAction>;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import { Terminal as XTerm } from 'xterm';
|
||||
import Row from 'react-bootstrap/Row';
|
||||
import Col from 'react-bootstrap/Col';
|
||||
import Row from 'react-bootstrap/Row';
|
||||
import { connect } from 'react-redux';
|
||||
import { Dispatch } from 'redux';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { Terminal as XTerm } from 'xterm';
|
||||
import { receiveData } from '../actions/terminal';
|
||||
import { terminalOutput } from '../epics/terminal';
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import Row from 'react-bootstrap/Row';
|
||||
import Col from 'react-bootstrap/Col';
|
||||
import React from 'react';
|
||||
import ButtonGroup from 'react-bootstrap/ButtonGroup';
|
||||
import ButtonToolbar from 'react-bootstrap/ButtonToolbar';
|
||||
import React from 'react';
|
||||
import Col from 'react-bootstrap/Col';
|
||||
import Row from 'react-bootstrap/Row';
|
||||
import BluetoothButton from './BluetoothButton';
|
||||
import FlashButton from './FlashButton';
|
||||
import ReplButton from './ReplButton';
|
||||
import RunButton from './RunButton';
|
||||
import StopButton from './StopButton';
|
||||
import ReplButton from './ReplButton';
|
||||
import FlashButton from './FlashButton';
|
||||
|
||||
class Toolbar extends React.Component {
|
||||
render(): JSX.Element {
|
||||
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
import { combineEpics, Epic, ofType } from 'redux-observable';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { AnyAction } from 'redux';
|
||||
import { BLEDataActionType, BLEDataAction, BLEConnectActionType } from '../actions/ble';
|
||||
import { Epic, combineEpics, ofType } from 'redux-observable';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { BLEConnectActionType, BLEDataAction, BLEDataActionType } from '../actions/ble';
|
||||
import { HubRuntimeStatusType, checksum, updateStatus } from '../actions/hub';
|
||||
import { sendData } from '../actions/terminal';
|
||||
import { updateStatus, HubRuntimeStatusType, checksum } from '../actions/hub';
|
||||
import { RootState } from '../reducers';
|
||||
import { HubRuntimeState } from '../reducers/hub';
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import { combineEpics, Epic, ofType } from 'redux-observable';
|
||||
import { AnyAction } from 'redux';
|
||||
import { take, tap, ignoreElements } from 'rxjs/operators';
|
||||
import { Epic, combineEpics, ofType } from 'redux-observable';
|
||||
import { Subject } from 'rxjs';
|
||||
import { ignoreElements, take, tap } from 'rxjs/operators';
|
||||
import { HubActionType, HubChecksumAction } from '../actions/hub';
|
||||
|
||||
const checksumSubject = new Subject<number>();
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { combineEpics, Epic } from 'redux-observable';
|
||||
import { Epic, combineEpics } from 'redux-observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import ble from './ble';
|
||||
import hub from './hub';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { combineEpics, Epic, ofType } from 'redux-observable';
|
||||
import { Subject } from 'rxjs';
|
||||
import { map, tap, ignoreElements } from 'rxjs/operators';
|
||||
import { AnyAction } from 'redux';
|
||||
import { Epic, combineEpics, ofType } from 'redux-observable';
|
||||
import { Subject } from 'rxjs';
|
||||
import { ignoreElements, map, tap } from 'rxjs/operators';
|
||||
import { write } from '../actions/ble';
|
||||
import { TerminalDataAction, TerminalDataActionType } from '../actions/terminal';
|
||||
|
||||
|
||||
+8
-8
@@ -1,16 +1,16 @@
|
||||
import thunkMiddleware from 'redux-thunk';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Provider } from 'react-redux';
|
||||
import { applyMiddleware, createStore } from 'redux';
|
||||
import { createLogger } from 'redux-logger';
|
||||
import { createEpicMiddleware } from 'redux-observable';
|
||||
import { createStore, applyMiddleware } from 'redux';
|
||||
import React from 'react';
|
||||
import { Provider } from 'react-redux';
|
||||
import ReactDOM from 'react-dom';
|
||||
import createSagaMiddleware from 'redux-saga';
|
||||
import rootSaga from './sagas';
|
||||
import rootEpic from './epics';
|
||||
import rootReducer from './reducers';
|
||||
import thunkMiddleware from 'redux-thunk';
|
||||
import './index.scss';
|
||||
import App from './components/App';
|
||||
import rootEpic from './epics';
|
||||
import rootReducer from './reducers';
|
||||
import rootSaga from './sagas';
|
||||
import * as serviceWorker from './serviceWorker';
|
||||
import serviceMiddleware from './services';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Reducer, combineReducers } from 'redux';
|
||||
import {
|
||||
BootloaderConnectionActionType,
|
||||
BootloaderRequestActionType,
|
||||
BootloaderResponseActionType,
|
||||
BootloaderConnectionActionType,
|
||||
} from '../actions/bootloader';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { combineReducers, Reducer } from 'redux';
|
||||
import { Ace } from 'ace-builds';
|
||||
import { Reducer, combineReducers } from 'redux';
|
||||
import { CurrentEditorAction, EditorActionType } from '../actions/editor';
|
||||
|
||||
type CurrentEditSession = Ace.EditSession | null;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { Reducer, combineReducers } from 'redux';
|
||||
import {
|
||||
HubRuntimeStatusAction,
|
||||
HubActionType,
|
||||
HubRuntimeStatusAction,
|
||||
HubRuntimeStatusType,
|
||||
} from '../actions/hub';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { combineReducers } from 'redux';
|
||||
import bootloader, { BootloaderState } from './bootloader';
|
||||
import ble, { BLEState } from './ble';
|
||||
import bootloader, { BootloaderState } from './bootloader';
|
||||
import editor, { EditorState } from './editor';
|
||||
import hub, { HubState } from './hub';
|
||||
|
||||
|
||||
+48
-48
@@ -1,66 +1,66 @@
|
||||
import { Action } from 'redux';
|
||||
import { Channel, buffers } from 'redux-saga';
|
||||
import {
|
||||
Effect,
|
||||
race,
|
||||
put,
|
||||
take,
|
||||
takeEvery,
|
||||
actionChannel,
|
||||
delay,
|
||||
fork,
|
||||
actionChannel,
|
||||
put,
|
||||
race,
|
||||
take,
|
||||
takeEvery,
|
||||
} from 'redux-saga/effects';
|
||||
import { Action } from 'redux';
|
||||
import {
|
||||
BootloaderActionType,
|
||||
infoRequest,
|
||||
BootloaderResponseActionType,
|
||||
BootloaderInfoResponseAction,
|
||||
BootloaderEraseResponseAction,
|
||||
BootloaderFlashFirmwareAction,
|
||||
BootloaderInitResponseAction,
|
||||
eraseRequest,
|
||||
initRequest,
|
||||
programRequest,
|
||||
BootloaderProgramResponseAction,
|
||||
rebootRequest,
|
||||
BootloaderErrorResponseAction,
|
||||
BootloaderRequestActionType,
|
||||
BootloaderRequestAction,
|
||||
eraseResponse,
|
||||
programResponse,
|
||||
initResponse,
|
||||
infoResponse,
|
||||
checksumResponse,
|
||||
stateResponse,
|
||||
BootloaderConnectionActionType,
|
||||
connect,
|
||||
BootloaderConnectionDidErrorAction,
|
||||
BootloaderConnectionDidConnectAction,
|
||||
BootloaderConnectionDidCancelAction,
|
||||
send,
|
||||
BootloaderConnectionDidReceiveAction,
|
||||
BootloaderChecksumResponseAction,
|
||||
BootloaderConnectionActionType,
|
||||
BootloaderConnectionDidCancelAction,
|
||||
BootloaderConnectionDidConnectAction,
|
||||
BootloaderConnectionDidErrorAction,
|
||||
BootloaderConnectionDidReceiveAction,
|
||||
BootloaderEraseResponseAction,
|
||||
BootloaderErrorResponseAction,
|
||||
BootloaderFlashFirmwareAction,
|
||||
BootloaderInfoResponseAction,
|
||||
BootloaderInitResponseAction,
|
||||
BootloaderProgramResponseAction,
|
||||
BootloaderRequestAction,
|
||||
BootloaderRequestActionType,
|
||||
BootloaderResponseActionType,
|
||||
checksumRequest,
|
||||
checksumResponse,
|
||||
connect,
|
||||
eraseRequest,
|
||||
eraseResponse,
|
||||
infoRequest,
|
||||
infoResponse,
|
||||
initRequest,
|
||||
initResponse,
|
||||
programRequest,
|
||||
programResponse,
|
||||
rebootRequest,
|
||||
send,
|
||||
stateResponse,
|
||||
} from '../actions/bootloader';
|
||||
import {
|
||||
createEraseFlashRequest,
|
||||
createProgramFlashRequest,
|
||||
createStartAppRequest,
|
||||
createInitLoaderRequest,
|
||||
createGetInfoRequest,
|
||||
createGetChecksumRequest,
|
||||
createGetFlashStateRequest,
|
||||
createDisconnectRequest,
|
||||
getMessageType,
|
||||
parseEraseFlashResponse,
|
||||
Command,
|
||||
parseProgramFlashResponse,
|
||||
parseInitLoaderResponse,
|
||||
parseGetInfoResponse,
|
||||
parseGetChecksumResponse,
|
||||
parseGetFlashStateResponse,
|
||||
ErrorBytecode,
|
||||
MaxProgramFlashSize,
|
||||
createDisconnectRequest,
|
||||
createEraseFlashRequest,
|
||||
createGetChecksumRequest,
|
||||
createGetFlashStateRequest,
|
||||
createGetInfoRequest,
|
||||
createInitLoaderRequest,
|
||||
createProgramFlashRequest,
|
||||
createStartAppRequest,
|
||||
getMessageType,
|
||||
parseEraseFlashResponse,
|
||||
parseGetChecksumResponse,
|
||||
parseGetFlashStateResponse,
|
||||
parseGetInfoResponse,
|
||||
parseInitLoaderResponse,
|
||||
parseProgramFlashResponse,
|
||||
} from '../protocols/bootloader';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { Action, Dispatch } from 'redux';
|
||||
import { ServiceUUID, CharacteristicUUID } from '../protocols/bootloader';
|
||||
import {
|
||||
BootloaderConnectionActionType,
|
||||
BootloaderConnectionSendAction,
|
||||
didCancel,
|
||||
didConnect,
|
||||
didDisconnect,
|
||||
didError,
|
||||
didReceive,
|
||||
didDisconnect,
|
||||
didConnect,
|
||||
BootloaderConnectionSendAction,
|
||||
didSend,
|
||||
} from '../actions/bootloader';
|
||||
import { CharacteristicUUID, ServiceUUID } from '../protocols/bootloader';
|
||||
import { combineServices } from '.';
|
||||
|
||||
let device: BluetoothDevice | undefined;
|
||||
|
||||
Reference in New Issue
Block a user