Skip to content

Commit

Permalink
html: update lint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
tsl0922 committed Jun 23, 2019
1 parent ae83791 commit 86123ca
Show file tree
Hide file tree
Showing 11 changed files with 1,112 additions and 438 deletions.
6 changes: 3 additions & 3 deletions html/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
root = true

[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
30 changes: 20 additions & 10 deletions html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,44 @@
"prestart": "gulp clean",
"start": "webpack-dev-server",
"build": "NODE_ENV=production webpack && gulp",
"lint": "tslint --project ."
"check": "gts check",
"fix": "gts fix"
},
"eslintConfig": {
"extends": "eslint-config-aerian"
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.ts": [
"gts fix",
"git add"
],
"src/**/*.scss": [
"scssfmt",
"git add"
]
},
"eslintIgnore": [
"build/*"
],
"devDependencies": {
"copy-webpack-plugin": "^5.0.3",
"css-loader": "^1.0.1",
"gts": "^1.0.0",
"gulp": "^4.0.2",
"gulp-clean": "^0.4.0",
"gulp-inline-source": "^4.0.0",
"html-webpack-plugin": "^3.2.0",
"husky": "^2.4.1",
"lint-staged": "^8.2.1",
"mini-css-extract-plugin": "^0.6.0",
"node-sass": "^4.12.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"sass-loader": "^7.1.0",
"scssfmt": "^1.0.7",
"style-loader": "^0.23.1",
"terser-webpack-plugin": "^1.3.0",
"ts-loader": "^6.0.1",
"tslint": "^5.16.0",
"tslint-config-prettier": "^1.18.0",
"tslint-consistent-codestyle": "^1.15.1",
"tslint-eslint-rules": "^5.4.0",
"tslint-loader": "^3.5.4",
"tslint-react": "^4.0.0",
"typescript": "^3.4.5",
"webpack": "^4.32.2",
"webpack-cli": "^3.3.2",
Expand Down
71 changes: 38 additions & 33 deletions html/src/components/app.tsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,51 @@
import { Component, h } from 'preact';

import { ITerminalOptions, ITheme } from 'xterm';
import Xterm from './terminal';
import { Xterm } from './terminal';

if ((module as any).hot) {
// tslint:disable-next-line:no-var-requires
require('preact/debug');
// tslint:disable-next-line:no-var-requires
require('preact/debug');
}

const protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
const wsPath = window.location.pathname.endsWith('/') ? 'ws' : '/ws';
const url = [protocol, window.location.host, window.location.pathname, wsPath, window.location.search].join('');
const url = [
protocol,
window.location.host,
window.location.pathname,
wsPath,
window.location.search,
].join('');
const termOptions = {
fontSize: 13,
fontFamily: 'Menlo For Powerline,Consolas,Liberation Mono,Menlo,Courier,monospace',
theme: {
foreground: '#d2d2d2',
background: '#2b2b2b',
cursor: '#adadad',
black: '#000000',
red: '#d81e00',
green: '#5ea702',
yellow: '#cfae00',
blue: '#427ab3',
magenta: '#89658e',
cyan: '#00a7aa',
white: '#dbded8',
brightBlack: '#686a66',
brightRed: '#f54235',
brightGreen: '#99e343',
brightYellow: '#fdeb61',
brightBlue: '#84b0d8',
brightMagenta: '#bc94b7',
brightCyan: '#37e6e8',
brightWhite: '#f1f1f0'
} as ITheme
fontSize: 13,
fontFamily:
'Menlo For Powerline,Consolas,Liberation Mono,Menlo,Courier,monospace',
theme: {
foreground: '#d2d2d2',
background: '#2b2b2b',
cursor: '#adadad',
black: '#000000',
red: '#d81e00',
green: '#5ea702',
yellow: '#cfae00',
blue: '#427ab3',
magenta: '#89658e',
cyan: '#00a7aa',
white: '#dbded8',
brightBlack: '#686a66',
brightRed: '#f54235',
brightGreen: '#99e343',
brightYellow: '#fdeb61',
brightBlue: '#84b0d8',
brightMagenta: '#bc94b7',
brightCyan: '#37e6e8',
brightWhite: '#f1f1f0',
} as ITheme,
} as ITerminalOptions;

export default class App extends Component {
public render() {
return (
<Xterm id='terminal-container' url={url} options={termOptions} />
);
}
export class App extends Component {
render() {
return <Xterm id="terminal-container" url={url} options={termOptions} />;
}
}

0 comments on commit 86123ca

Please sign in to comment.