Skip to content

Commit cfaa48b

Browse files
authored
Merge pull request #415 from coderoad/fix/linting
Fix/linting
2 parents bca6384 + aa6367b commit cfaa48b

14 files changed

+1101
-487
lines changed

Diff for: .github/workflows/test.yml

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: CI
22
on: push
33
jobs:
4+
lint:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- name: Install modules
9+
run: yarn install
10+
- name: Lint
11+
run: yarn lint
412
build-extension:
513
runs-on: ubuntu-latest
614
steps:

Diff for: package.json

+12-7
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,34 @@
3535
},
3636
"dependencies": {
3737
"@types/assert": "^1.5.1",
38-
"@types/jest": "^26.0.5",
38+
"@types/jest": "^26.0.8",
3939
"@types/jsdom": "^16.2.3",
40-
"@types/node": "^14.0.24",
40+
"@types/node": "^14.0.27",
4141
"@types/node-fetch": "^2.5.7",
4242
"@types/semver": "^7.3.1",
43-
"@typescript-eslint/eslint-plugin": "^3.7.0",
44-
"@typescript-eslint/parser": "^3.7.0",
43+
"@typescript-eslint/eslint-plugin": "^3.7.1",
44+
"@typescript-eslint/parser": "^3.7.1",
4545
"chokidar": "^3.4.1",
4646
"dotenv": "^8.2.0",
47-
"eslint": "^7.5.0",
47+
"eslint": "^7.6.0",
4848
"git-url-parse": "^11.1.2",
49-
"jest": "^26.1.0",
49+
"jest": "^26.2.2",
5050
"jsdom": "^16.3.0",
5151
"node-fetch": "^2.6.0",
5252
"semver": "^7.3.2",
53-
"ts-jest": "^26.1.3",
53+
"ts-jest": "^26.1.4",
5454
"typescript": "^3.9.7",
5555
"vscode-extension-telemetry": "^0.1.6"
5656
},
5757
"devDependencies": {
5858
"eslint-config-prettier": "^6.11.0",
5959
"eslint-config-react-app": "^5.2.1",
60+
"eslint-plugin-flowtype": "^5.2.0",
61+
"eslint-plugin-import": "^2.22.0",
62+
"eslint-plugin-jsx-a11y": "^6.3.1",
6063
"eslint-plugin-prettier": "^3.1.4",
64+
"eslint-plugin-react": "^7.20.5",
65+
"eslint-plugin-react-hooks": "^4.0.8",
6166
"prettier": "2.0.5",
6267
"vscode": "^1.1.37",
6368
"vscode-test": "^1.4.0"

Diff for: src/actions/onErrorPage.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as T from 'typings'
22
import { readFile } from '../services/node'
33
import logger from '../services/logger'
44

5-
const onErrorPage = async (action: T.Action) => {
5+
const onErrorPage = async (action: T.Action): void => {
66
// Error middleware
77
if (action?.payload?.error?.type) {
88
// load error markdown message

Diff for: src/actions/onOpenLogs.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as T from 'typings'
22
import { showOutput } from '../services/testRunner/output'
33

4-
export const onOpenLogs = async (action: T.Action) => {
4+
export const onOpenLogs = async (action: T.Action): void => {
55
const channel = action.payload.channel
66
await showOutput(channel)
77
}

Diff for: src/actions/onRunReset.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type ResetAction = {
1111
}
1212

1313
// reset to the start of the last test
14-
const onRunReset = async (action: ResetAction, context: Context) => {
14+
const onRunReset = async (action: ResetAction, context: Context): void => {
1515
// reset to timeline
1616
const tutorial: TT.Tutorial | null = context.tutorial.get()
1717
const position: T.Position = action.position ? action.position : context.position.get()

Diff for: src/actions/onStartup.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const onStartup = async (
1111
context: Context,
1212
workspaceState: vscode.Memento,
1313
send: (action: T.Action) => Promise<void>,
14-
) => {
14+
): void => {
1515
try {
1616
// check if a workspace is open, otherwise nothing works
1717
const noActiveWorkspace = !WORKSPACE_ROOT.length

Diff for: src/actions/onTest.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import * as vscode from 'vscode'
44
import { COMMANDS } from '../commands'
55
import Context from '../services/context/context'
66

7-
export const onTestPass = (action: T.Action, context: Context) => {
7+
export const onTestPass = (action: T.Action, context: Context): void => {
88
context.position.set({ ...action.payload.position, complete: true })
99
git.saveCommit('Save progress')
1010
}
1111

12-
export const onRunTest = (action?: T.Action) => {
12+
export const onRunTest = (action?: T.Action): void => {
1313
vscode.commands.executeCommand(COMMANDS.RUN_TEST, action?.payload)
1414
}

Diff for: src/actions/onTutorialConfigContinue.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Context from '../services/context/context'
55
import tutorialConfig from './utils/tutorialConfig'
66
import { COMMANDS } from '../commands'
77

8-
const onTutorialConfigContinue = async (action: T.Action, context: Context, send: any) => {
8+
const onTutorialConfigContinue = async (action: T.Action, context: Context, send: T.Send): void => {
99
try {
1010
const tutorialContinue: TT.Tutorial | null = context.tutorial.get()
1111
if (!tutorialContinue) {

Diff for: src/actions/onTutorialConfigNew.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { version, compareVersions } from '../services/dependencies'
88
import Context from '../services/context/context'
99
import tutorialConfig from './utils/tutorialConfig'
1010

11-
const onTutorialConfigNew = async (action: T.Action, context: Context, send: any) => {
11+
const onTutorialConfigNew = async (action: T.Action, context: Context, send: T.Send): void => {
1212
try {
1313
const data: TT.Tutorial = action.payload.tutorial
1414

@@ -82,7 +82,7 @@ const onTutorialConfigNew = async (action: T.Action, context: Context, send: any
8282
if (satisfiedDependency !== true) {
8383
const error: E.ErrorMessage = satisfiedDependency || {
8484
type: 'UnknownError',
85-
message: `Something went wrong comparing dependency for ${name}`,
85+
message: `Something went wrong comparing dependency for ${dep.name}`,
8686
actions: [
8787
{
8888
label: 'Try Again',

Diff for: src/actions/onValidateSetup.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as E from 'typings/error'
22
import { version } from '../services/dependencies'
33
import { checkWorkspaceEmpty } from '../services/workspace'
44

5-
const onValidateSetup = async (send: any) => {
5+
const onValidateSetup = async (send: T.Send): void => {
66
try {
77
// check workspace is selected
88
const isEmptyWorkspace = await checkWorkspaceEmpty()

Diff for: typings/index.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ export interface Action {
5454
meta?: any
5555
}
5656

57+
export type Send = (action: Action) => void
58+
5759
export interface Environment {
5860
machineId: string
5961
sessionId: string

Diff for: web-app/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
"extends": "react-app"
2626
},
2727
"dependencies": {
28-
"@alifd/next": "^1.20.20",
28+
"@alifd/next": "^1.20.24",
2929
"@emotion/babel-preset-css-prop": "^10.0.27",
3030
"@emotion/core": "^10.0.28",
31-
"babel-jest": "^26.1.0",
31+
"babel-jest": "^26.2.2",
3232
"js-yaml": "^3.14.0",
3333
"markdown-it": "^11.0.0",
3434
"markdown-it-emoji": "^1.4.0",
@@ -42,7 +42,7 @@
4242
"xstate": "^4.11.0"
4343
},
4444
"devDependencies": {
45-
"@babel/core": "^7.10.5",
45+
"@babel/core": "^7.11.0",
4646
"@storybook/addon-actions": "^5.3.19",
4747
"@storybook/addon-knobs": "^5.3.19",
4848
"@storybook/addon-links": "^5.3.19",
@@ -51,12 +51,12 @@
5151
"@storybook/react": "^5.3.19",
5252
"@types/graphql": "^14.5.0",
5353
"@types/highlight.js": "^9.12.4",
54-
"@types/jest": "^26.0.5",
54+
"@types/jest": "^26.0.8",
5555
"@types/js-yaml": "^3.12.5",
5656
"@types/markdown-it": "^10.0.1",
57-
"@types/node": "^14.0.24",
57+
"@types/node": "^14.0.27",
5858
"@types/prismjs": "^1.16.1",
59-
"@types/react": "^16.9.43",
59+
"@types/react": "^16.9.44",
6060
"@types/react-addons-css-transition-group": "^15.0.5",
6161
"@types/react-dom": "^16.9.8",
6262
"babel-loader": "8.1.0",

0 commit comments

Comments
 (0)