Skip to content

Fix/linting #378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 27, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix linting issues on src
Signed-off-by: shmck <[email protected]>
  • Loading branch information
ShMcK committed Jun 27, 2020
commit 37e32b60397659217334a639e828993742b8b966
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
plugins: ['prettier'],
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array
'plugin:prettier/recommended',
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,30 @@
"watch": "tsc -watch -p ./"
},
"dependencies": {
"@sentry/node": "^5.17.0",
"@types/assert": "^1.4.7",
"@types/jest": "^26.0.0",
"@sentry/node": "^5.18.1",
"@types/assert": "^1.5.1",
"@types/jest": "^26.0.3",
"@types/jsdom": "^16.2.3",
"@types/node": "^14.0.13",
"@types/node": "^14.0.14",
"@types/node-fetch": "^2.5.7",
"@types/semver": "^7.2.0",
"@typescript-eslint/eslint-plugin": "^3.3.0",
"@typescript-eslint/parser": "^3.3.0",
"@types/semver": "^7.3.1",
"@typescript-eslint/eslint-plugin": "^3.4.0",
"@typescript-eslint/parser": "^3.4.0",
"chokidar": "^3.4.0",
"dotenv": "^8.2.0",
"eslint": "^7.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint": "^7.3.1",
"git-url-parse": "^11.1.2",
"jest": "^26.0.1",
"jest": "^26.1.0",
"jsdom": "^16.2.2",
"node-fetch": "^2.6.0",
"prettier": "^2.0.5",
"semver": "^7.3.2",
"ts-jest": "^26.1.0",
"ts-jest": "^26.1.1",
"typescript": "^3.9.5"
},
"devDependencies": {
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"prettier": "2.0.5",
"vscode": "^1.1.37",
"vscode-test": "^1.4.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/actions/saveCommit.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as git from '../services/git'

async function saveCommit() {
async function saveCommit(): Promise<void> {
git.saveCommit('Save progress')
}

Expand Down
2 changes: 1 addition & 1 deletion src/channel/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Context {
const position: CR.Position = this.position.setPositionFromProgress(tutorial, progress)
return { progress, position }
}
public reset = () => {
public reset = (): void => {
this.tutorial.reset()
this.progress.reset()
this.position.reset()
Expand Down
4 changes: 2 additions & 2 deletions src/channel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Channel implements Channel {
}

// receive from webview
public receive = async (action: T.Action) => {
public receive = async (action: T.Action): Promise<void> => {
// action may be an object.type or plain string
const actionType: string = typeof action === 'string' ? action : action.type
// const onError = (error: T.ErrorMessage) => this.send({ type: 'ERROR', payload: { error } })
Expand Down Expand Up @@ -325,7 +325,7 @@ class Channel implements Channel {
}
}
// send to webview
public send = async (action: T.Action) => {
public send = async (action: T.Action): Promise<void> => {
// Error middleware
if (action?.payload?.error?.type) {
// load error markdown message
Expand Down
2 changes: 1 addition & 1 deletion src/editor/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface CreateCommandProps {
workspaceState: vscode.Memento
}

export const createCommands = ({ extensionPath, workspaceState }: CreateCommandProps) => {
export const createCommands = ({ extensionPath, workspaceState }: CreateCommandProps): { [key: string]: any } => {
// React panel webview
let webview: any
let currentPosition: T.Position
Expand Down
64 changes: 0 additions & 64 deletions web-app/.eslintrc.js

This file was deleted.

26 changes: 13 additions & 13 deletions web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
"extends": "react-app"
},
"dependencies": {
"@alifd/next": "^1.20.12",
"@alifd/next": "^1.20.14",
"@alifd/theme-4": "^0.3.1",
"@emotion/babel-preset-css-prop": "^10.0.27",
"@emotion/core": "^10.0.28",
"@sentry/browser": "^5.17.0",
"@sentry/browser": "^5.18.1",
"js-yaml": "^3.14.0",
"markdown-it": "^11.0.0",
"markdown-it-emoji": "^1.4.0",
"moment": "^2.26.0",
"moment": "^2.27.0",
"prismjs": "^1.20.0",
"react": "^16.13.1",
"react-addons-css-transition-group": "^15.6.2",
Expand All @@ -42,34 +42,34 @@
"xstate": "^4.10.0"
},
"devDependencies": {
"@babel/core": "^7.10.2",
"@babel/core": "^7.10.3",
"@storybook/addon-actions": "^5.3.19",
"@storybook/addon-knobs": "^5.3.19",
"@storybook/addon-links": "^5.3.19",
"@storybook/addons": "^5.3.19",
"@storybook/preset-create-react-app": "^3.1.0",
"@storybook/preset-create-react-app": "^3.1.2",
"@storybook/react": "^5.3.19",
"@types/graphql": "^14.5.0",
"@types/highlight.js": "^9.12.4",
"@types/jest": "^26.0.0",
"@types/js-yaml": "^3.12.4",
"@types/jest": "^26.0.3",
"@types/js-yaml": "^3.12.5",
"@types/markdown-it": "^10.0.1",
"@types/node": "^14.0.13",
"@types/node": "^14.0.14",
"@types/prismjs": "^1.16.1",
"@types/react": "^16.9.36",
"@types/react": "^16.9.41",
"@types/react-addons-css-transition-group": "^15.0.5",
"@types/react-dom": "^16.9.8",
"@typescript-eslint/eslint-plugin": "^3.3.0",
"@typescript-eslint/parser": "^3.3.0",
"@typescript-eslint/eslint-plugin": "^3.4.0",
"@typescript-eslint/parser": "^3.4.0",
"babel-loader": "8.1.0",
"babel-plugin-import": "^1.13.0",
"customize-cra": "^1.0.0",
"eslint": "^7.2.0",
"eslint": "^7.3.1",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"mini-css-extract-plugin": "^0.9.0",
"node-sass": "^4.14.1",
"prettier": "^2.0.5",
"prettier": "2.0.5",
"react-app-rewired": "^2.1.6",
"react-scripts": "^3.4.1",
"sass-loader": "^8.0.2",
Expand Down
1 change: 1 addition & 0 deletions web-app/src/containers/Tutorial/components/Hints.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const Hints = (props: Props) => {
return (
<div style={styles.hints}>
<div style={styles.hintList}>
{/* only show revealed hints */}
{props.hints.map((h, i) => {
return i <= hintIndex ? (
<div key={i} style={styles.hint}>
Expand Down