Skip to content

Commit 89597e2

Browse files
committed
Add Prettier
1 parent 0ecb1a6 commit 89597e2

13 files changed

+8333
-8308
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.{yml,md}]
12+
indent_size = 2

package-lock.json

+8,008-8,002
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+53-46
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,55 @@
11
{
2-
"name": "typescripttolua.github.io",
3-
"version": "1.0.0",
4-
"description": "",
5-
"scripts": {
6-
"test": "echo \"Error: no test specified\" && exit 1",
7-
"build-playground": "webpack --config ./src/playground/webpack.config.js --mode production",
8-
"dev-playground": "webpack-dev-server --content-base dist/ --config src/playground/webpack.config.js --mode development",
9-
"build-landing": "webpack --config ./src/landing/webpack.config.js --mode production",
10-
"dev-landing": "webpack-dev-server --content-base dist/ --config src/landing/webpack.config.js --mode development",
11-
"build": "npx rimraf dist && npm run build-playground && npm run build-landing",
12-
"deploy": "npm run build && npx gh-pages -d dist -b master"
13-
},
14-
"keywords": [],
15-
"author": "",
16-
"license": "",
17-
"devDependencies": {
18-
"@types/highlight.js": "^9.12.3",
19-
"@types/node": "^13.5.0",
20-
"css-loader": "^3.4.2",
21-
"file-loader": "^5.0.2",
22-
"gh-pages": "^2.2.0",
23-
"html-loader": "^0.5.5",
24-
"html-webpack-plugin": "^3.2.0",
25-
"monaco-editor-webpack-plugin": "^1.8.2",
26-
"raw-loader": "^4.0.0",
27-
"rimraf": "^3.0.0",
28-
"sass": "^1.25.0",
29-
"sass-loader": "^8.0.2",
30-
"style-loader": "^1.1.3",
31-
"ts-loader": "^6.2.1",
32-
"typescript": "^3.7.5",
33-
"url-loader": "^3.0.0",
34-
"webpack": "^4.41.5",
35-
"webpack-bundle-analyzer": "^3.6.0",
36-
"webpack-cli": "^3.3.10",
37-
"webpack-dev-server": "^3.10.1",
38-
"webpack-merge": "^4.2.2",
39-
"worker-loader": "^2.0.0"
40-
},
41-
"dependencies": {
42-
"fengari-web": "^0.1.4",
43-
"highlight.js": "^9.18.0",
44-
"monaco-editor": "^0.19.3",
45-
"renderjson": "^1.4.0",
46-
"typescript-to-lua": "^0.31.0"
47-
}
2+
"name": "typescripttolua.github.io",
3+
"version": "1.0.0",
4+
"description": "",
5+
"scripts": {
6+
"test": "echo \"Error: no test specified\" && exit 1",
7+
"build-playground": "webpack --config ./src/playground/webpack.config.js --mode production",
8+
"dev-playground": "webpack-dev-server --content-base dist/ --config src/playground/webpack.config.js --mode development",
9+
"build-landing": "webpack --config ./src/landing/webpack.config.js --mode production",
10+
"dev-landing": "webpack-dev-server --content-base dist/ --config src/landing/webpack.config.js --mode development",
11+
"build": "npx rimraf dist && npm run build-playground && npm run build-landing",
12+
"deploy": "npm run build && npx gh-pages -d dist -b master",
13+
"lint": "npm run lint:prettier",
14+
"lint:prettier": "prettier --check \"**/*.{js,ts,yml,json,md}\""
15+
},
16+
"keywords": [],
17+
"author": "",
18+
"license": "",
19+
"prettier": {
20+
"printWidth": 120,
21+
"trailingComma": "all"
22+
},
23+
"devDependencies": {
24+
"@types/highlight.js": "^9.12.3",
25+
"@types/node": "^13.5.0",
26+
"css-loader": "^3.4.2",
27+
"file-loader": "^5.0.2",
28+
"gh-pages": "^2.2.0",
29+
"html-loader": "^0.5.5",
30+
"html-webpack-plugin": "^3.2.0",
31+
"monaco-editor-webpack-plugin": "^1.8.2",
32+
"prettier": "^1.19.1",
33+
"raw-loader": "^4.0.0",
34+
"rimraf": "^3.0.0",
35+
"sass": "^1.25.0",
36+
"sass-loader": "^8.0.2",
37+
"style-loader": "^1.1.3",
38+
"ts-loader": "^6.2.1",
39+
"typescript": "^3.7.5",
40+
"url-loader": "^3.0.0",
41+
"webpack": "^4.41.5",
42+
"webpack-bundle-analyzer": "^3.6.0",
43+
"webpack-cli": "^3.3.10",
44+
"webpack-dev-server": "^3.10.1",
45+
"webpack-merge": "^4.2.2",
46+
"worker-loader": "^2.0.0"
47+
},
48+
"dependencies": {
49+
"fengari-web": "^0.1.4",
50+
"highlight.js": "^9.18.0",
51+
"monaco-editor": "^0.19.3",
52+
"renderjson": "^1.4.0",
53+
"typescript-to-lua": "^0.31.0"
54+
}
4855
}

src/landing/index.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import '../../assets/styles/landing.scss';
2-
import 'highlight.js/styles/vs2015.css';
1+
import "../../assets/styles/landing.scss";
2+
import "highlight.js/styles/vs2015.css";
33

4-
import {configure, highlightBlock} from 'highlight.js';
4+
import { configure, highlightBlock } from "highlight.js";
55

6-
configure({languages: ["typescript", "lua"]});
6+
configure({ languages: ["typescript", "lua"] });
77

8-
document.addEventListener('DOMContentLoaded', () => {
9-
let codeBlocks = document.getElementsByClassName('example-item');
8+
document.addEventListener("DOMContentLoaded", () => {
9+
let codeBlocks = document.getElementsByClassName("example-item");
1010
for (let i = 0; i < codeBlocks.length; i++) {
1111
highlightBlock(codeBlocks[i]);
1212
}
13-
});
13+
});

src/landing/tsconfig.json

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
{
22
"compilerOptions": {
3-
"sourceMap": true,
4-
"noImplicitAny": true,
5-
"module": "commonjs",
6-
"target": "es5",
7-
"lib": ["es5", "scripthost", "dom", "webworker"],
8-
"allowJs": true,
9-
"strict": true
3+
"sourceMap": true,
4+
"noImplicitAny": true,
5+
"module": "commonjs",
6+
"target": "es5",
7+
"lib": ["es5", "scripthost", "dom", "webworker"],
8+
"allowJs": true,
9+
"strict": true
1010
},
11-
"exclude": [
12-
"webpack*.js"
13-
]
14-
}
11+
"exclude": ["webpack*.js"]
12+
}

src/landing/webpack.config.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
const path = require('path');
2-
const HtmlWebpackPlugin = require('html-webpack-plugin');
1+
const path = require("path");
2+
const HtmlWebpackPlugin = require("html-webpack-plugin");
33

4-
const merge = require('webpack-merge');
5-
const common = require('../webpack.common.js');
4+
const merge = require("webpack-merge");
5+
const common = require("../webpack.common.js");
66

7-
module.exports = merge( common, {
8-
entry: path.resolve(__dirname, './index.ts'),
9-
plugins: [
10-
new HtmlWebpackPlugin({
11-
title: 'TypeScriptToLua',
12-
template: path.resolve(__dirname, '../../assets/layout/template.html'),
13-
inject: 'head',
14-
filename: 'index.html',
15-
contentFile: 'landing.html'
16-
})
17-
],
18-
output:{filename: 'landing_bundle.js'},
19-
});
7+
module.exports = merge(common, {
8+
entry: path.resolve(__dirname, "./index.ts"),
9+
plugins: [
10+
new HtmlWebpackPlugin({
11+
title: "TypeScriptToLua",
12+
template: path.resolve(__dirname, "../../assets/layout/template.html"),
13+
inject: "head",
14+
filename: "index.html",
15+
contentFile: "landing.html",
16+
}),
17+
],
18+
output: { filename: "landing_bundle.js" },
19+
});

src/playground/custom.d.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
declare module 'worker-loader!*' {
2-
class WebpackWorker extends Worker {
3-
constructor();
4-
}
1+
declare module "worker-loader!*" {
2+
class WebpackWorker extends Worker {
3+
constructor();
4+
}
55

6-
export default WebpackWorker;
6+
export default WebpackWorker;
77
}
88

99
interface FSDummy {
1010
readFileSync(fileName: string): Buffer;
1111
}
1212

1313
interface Window {
14-
fs: FSDummy
14+
fs: FSDummy;
1515
}
1616

17-
declare module 'fengari-web';
17+
declare module "fengari-web";

src/playground/fengariWorker.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {lauxlib, lua, lualib, to_jsstring, to_luastring, interop } from "fengari-web";
1+
import { lauxlib, lua, lualib, to_jsstring, to_luastring, interop } from "fengari-web";
22

33
declare var self: any;
44

@@ -51,9 +51,9 @@ onmessage = (event: MessageEvent) => {
5151
if (event.data.luaStr) {
5252
try {
5353
executeLua(event.data.luaStr);
54-
postMessage({luaPrint: self.printStream});
54+
postMessage({ luaPrint: self.printStream });
5555
} catch (e) {
56-
postMessage({luaPrint: e.toString()});
56+
postMessage({ luaPrint: e.toString() });
5757
}
5858
}
59-
};
59+
};

0 commit comments

Comments
 (0)