Skip to content

Commit 334aaad

Browse files
committed
Added fmt and lint command
1 parent e8aa839 commit 334aaad

File tree

5 files changed

+28
-10
lines changed

5 files changed

+28
-10
lines changed

.github/workflows/test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ jobs:
1717
uses: denolib/setup-deno@master
1818
- name: Show Deno version
1919
run: deno --version
20+
- name: Run lint
21+
run: make lint
2022
- name: Run tests
2123
run: make test

Makefile

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
.PHONY: test
1+
SHELL=/bin/bash
2+
TARGET_SRC=$(shell shopt -s globstar && ls ./**/*.{ts,js,tsx} | grep -v ./vendor | grep -v ./testdata)
23

34
test:
45
deno run --allow-net serve_test.ts
56
deno run --allow-net --allow-read static_test.ts
67
deno run --allow-net helpers_test.ts
8+
9+
lint:
10+
deno fmt --check $(TARGET_SRC)
11+
12+
fmt:
13+
deno fmt $(TARGET_SRC)
14+
15+
.PHONY: test lint format

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@ interface HTTPResponse {
192192
dem update https://deno.land/std@v0.xx.x
193193
```
194194

195+
### Lint
196+
197+
- `make lint`
198+
199+
### Format
200+
201+
- `make fmt`
202+
195203
### Testing
196204

197205
- `make test`

example/jsx/index.tsx

+5-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
import {
33
h,
44
renderHTML,
5-
} from 'https://denopkg.com/syumai/deno-libs/jsx/renderer.ts';
6-
import { app, get } from 'https://denopkg.com/syumai/dinatra/mod.ts';
5+
} from "https://denopkg.com/syumai/deno-libs/jsx/renderer.ts";
6+
import { app, get } from "https://denopkg.com/syumai/dinatra/mod.ts";
77

88
app(
9-
get('/', () =>
9+
get("/", () =>
1010
renderHTML(
1111
<html>
1212
<body>Hello, world!</body>
13-
</html>
14-
)
15-
)
13+
</html>,
14+
)),
1615
);

example/static/public/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const countContainer = document.getElementById('count');
2-
const plusBtn = document.getElementById('plusBtn');
1+
const countContainer = document.getElementById("count");
2+
const plusBtn = document.getElementById("plusBtn");
33
let count = 0;
4-
plusBtn.addEventListener('click', () => {
4+
plusBtn.addEventListener("click", () => {
55
count++;
66
countContainer.textContent = count.toString();
77
});

0 commit comments

Comments
 (0)