Skip to content
This repository was archived by the owner on Jul 25, 2022. It is now read-only.

Commit 89a70f5

Browse files
committed
chore: Add eslint
1 parent 983c178 commit 89a70f5

File tree

7 files changed

+820
-18
lines changed

7 files changed

+820
-18
lines changed

.eslintrc.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"root": true,
3+
"env": {
4+
"node": true
5+
},
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:react/recommended",
9+
"plugin:@typescript-eslint/recommended"
10+
],
11+
"parser": "@typescript-eslint/parser",
12+
"parserOptions": {
13+
"parser": "@typescript-eslint/parser"
14+
},
15+
"plugins": [
16+
"@typescript-eslint",
17+
"unused-imports",
18+
"eslint-plugin-tsdoc"
19+
],
20+
"rules": {
21+
"quotes": [2, "single", {"avoidEscape": true}],
22+
"object-curly-spacing": [2, "always"],
23+
"unused-imports/no-unused-imports-ts": 2,
24+
"tsdoc/syntax": 2,
25+
"@typescript-eslint/consistent-type-assertions": 2,
26+
"@typescript-eslint/no-empty-interface": 0,
27+
"@typescript-eslint/explicit-module-boundary-types": 0
28+
}
29+
}

app/Terminal.ts

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default class Terminal {
2424
const pty = this.pty.build({
2525

2626
terminal: terminal,
27+
// eslint-disable-next-line @typescript-eslint/no-var-requires
2728
cwd: require('os').homedir(),
2829
});
2930

common/factories/Factory.ts

+1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ export interface Factory<T> {
2424
getFactoryObject(): T;
2525
}
2626

27+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2728
export type FactoryBuildParams = any;

package.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"compile": "electron-webpack",
1515
"dist": "yarn compile && electron-builder",
1616
"dist:dir": "yarn dist --dir -c.compression=store -c.mac.identity=null",
17-
"rebuild": "electron-rebuild"
17+
"rebuild": "electron-rebuild",
18+
"lint": "eslint . --ext .ts,.tsx"
1819
},
1920
"dependencies": {
2021
"chokidar": "^3.4.3",
@@ -32,11 +33,17 @@
3233
"@babel/preset-react": "^7.12.10",
3334
"@types/react": "^17.0.0",
3435
"@types/react-dom": "^17.0.0",
36+
"@typescript-eslint/eslint-plugin": "^4.11.0",
37+
"@typescript-eslint/parser": "^4.11.0",
3538
"electron": "8.2.0",
3639
"electron-builder": "^22.4.1",
3740
"electron-rebuild": "^2.3.4",
3841
"electron-webpack": "^2.8.2",
3942
"electron-webpack-ts": "^4.0.1",
43+
"eslint": "^7.16.0",
44+
"eslint-plugin-react": "^7.21.5",
45+
"eslint-plugin-tsdoc": "^0.2.10",
46+
"eslint-plugin-unused-imports": "^1.0.1",
4047
"node-sass": "^5.0.0",
4148
"sass-loader": "^10.1.0",
4249
"typescript": "^4.1.3",

ui/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default class App extends Component<Props, State> {
5454
render() {
5555

5656
return (
57-
<div className="main" style={{backgroundColor: this.state.config.theme.background}}>
57+
<div className="main" style={{ backgroundColor: this.state.config.theme.background }}>
5858
<Navbar
5959
terminals={this.state.terminals}
6060
selectTerminal={(terminal) => this.selectTerminal(terminal)}

ui/components/terminals/AppTerminal.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ export default class AppTerminal extends Component<Props, State> {
4242
* we update the config of the state terminal instance.
4343
*
4444
* @param prevProps - The previous props
45-
* @param prevState - The previous state
46-
* @param snapshot
4745
*/
48-
componentDidUpdate(prevProps: Readonly<Props>, prevState: Readonly<State>, snapshot?: any) {
46+
componentDidUpdate(prevProps: Readonly<Props>) {
4947

5048
this.state.terminal?.focus();
5149

0 commit comments

Comments
 (0)