Address style comments from PR
This commit is contained in:
Родитель
00f859c4bb
Коммит
f5a52b3760
|
@ -141,7 +141,7 @@ function getWebviewContent(context: vscode.ExtensionContext) {
|
|||
const vscode = acquireVsCodeApi();
|
||||
</script>
|
||||
${loadScript(context, "out/vendor.js")}
|
||||
${loadScript(context, "out/aliens.js")}
|
||||
${loadScript(context, "out/simulator.js")}
|
||||
</body>
|
||||
</html>`;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ interface vscode {
|
|||
|
||||
declare const vscode: vscode;
|
||||
|
||||
const addCategory = () =>
|
||||
const sendMessage = () =>
|
||||
vscode.postMessage({ command: "light-press", text: "HELOOOO" });
|
||||
|
||||
class Simulator extends React.Component<any, IState> {
|
||||
|
@ -83,7 +83,7 @@ class Simulator extends React.Component<any, IState> {
|
|||
button_a: false,
|
||||
button_b: false
|
||||
});
|
||||
addCategory();
|
||||
sendMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ interface IProps {
|
|||
onClick: () => void;
|
||||
}
|
||||
|
||||
const getRGB = (props: IProps): string => {
|
||||
return "rgb(" + props.light.toString() + ")";
|
||||
const getRGB = (light: Array<number>): string => {
|
||||
return "rgb(" + light.toString() + ")";
|
||||
};
|
||||
|
||||
const App: React.FC<IProps> = props => {
|
||||
|
@ -23,7 +23,7 @@ const App: React.FC<IProps> = props => {
|
|||
cx={xPos}
|
||||
cy={yPos}
|
||||
r={radius}
|
||||
fill={getRGB(props)}
|
||||
fill={getRGB(props.light)}
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
|
|
26
tslint.json
26
tslint.json
|
@ -1,15 +1,15 @@
|
|||
{
|
||||
"rules": {
|
||||
"no-string-throw": true,
|
||||
"no-unused-expression": true,
|
||||
"no-duplicate-variable": true,
|
||||
"curly": true,
|
||||
"class-name": true,
|
||||
"semicolon": [
|
||||
true,
|
||||
"always"
|
||||
],
|
||||
"triple-equals": true
|
||||
},
|
||||
"defaultSeverity": "warning"
|
||||
"rulesDirectory": ["node_modules/tslint-microsoft-contrib"],
|
||||
"rules": {
|
||||
"no-string-throw": true,
|
||||
"no-unused-expression": true,
|
||||
"no-duplicate-variable": true,
|
||||
"curly": true,
|
||||
"class-name": true,
|
||||
"semicolon": [true, "always"],
|
||||
"triple-equals": true,
|
||||
"no-relative-imports": false
|
||||
},
|
||||
"defaultSeverity": "warning",
|
||||
"extends": ["tslint-microsoft-contrib/recommended"]
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ const tsImportPlugin = require("ts-import-plugin");
|
|||
|
||||
module.exports = {
|
||||
entry: {
|
||||
aliens: "./src/view/index.tsx"
|
||||
simulator: "./src/view/index.tsx"
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, "out"),
|
||||
|
|
Загрузка…
Ссылка в новой задаче