Skip to content

Commit aa8ec6f

Browse files
committed
Merge branch 'master' into allow-block_list_migrate-mirror_8040
2 parents b9dda50 + 7ab3633 commit aa8ec6f

File tree

10 files changed

+84
-12
lines changed

10 files changed

+84
-12
lines changed

.eslintrc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ reportUnusedDisableDirectives: true
33

44
ignorePatterns:
55
- /web_src/js/vendor
6+
- /templates/base/head.tmpl
7+
- /templates/repo/activity.tmpl
8+
- /templates/repo/view_file.tmpl
69

710
parserOptions:
811
sourceType: module
@@ -12,6 +15,7 @@ plugins:
1215
- eslint-plugin-unicorn
1316
- eslint-plugin-import
1417
- eslint-plugin-vue
18+
- eslint-plugin-html
1519

1620
extends:
1721
- plugin:vue/recommended
@@ -27,12 +31,19 @@ globals:
2731
SimpleMDE: false
2832
u2fApi: false
2933

34+
settings:
35+
html/html-extensions: [".tmpl"]
36+
3037
overrides:
31-
- files: ["web_src/**/*.js", "web_src/**/*.vue"]
38+
- files: ["web_src/**/*.js", "web_src/**/*.vue", "templates/**/*.tmpl"]
3239
env:
3340
browser: true
3441
jquery: true
3542
node: false
43+
- files: ["templates/**/*.tmpl"]
44+
rules:
45+
no-tabs: [0]
46+
indent: [2, tab, {SwitchCase: 1}]
3647
- files: ["web_src/**/*worker.js"]
3748
env:
3849
worker: true

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ lint: lint-frontend lint-backend
312312

313313
.PHONY: lint-frontend
314314
lint-frontend: node_modules
315-
npx eslint --max-warnings=0 web_src/js build webpack.config.js
315+
npx eslint --max-warnings=0 web_src/js build templates webpack.config.js
316316
npx stylelint --max-warnings=0 web_src/less
317317

318318
.PHONY: lint-backend

package-lock.json

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
},
5656
"devDependencies": {
5757
"eslint": "7.13.0",
58+
"eslint-plugin-html": "6.1.1",
5859
"eslint-plugin-import": "2.22.1",
5960
"eslint-plugin-unicorn": "23.0.0",
6061
"eslint-plugin-vue": "7.1.0",

services/pull/pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ func GetCommitMessages(pr *models.PullRequest) string {
610610
}
611611
element = element.Next()
612612
}
613-
613+
skip += limit
614614
}
615615
}
616616

templates/base/footer.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js"></script>
1717
<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/meta.js"></script>
1818
<script>
19-
CodeMirror.modeURL = "{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/%N/%N.js";
19+
CodeMirror.modeURL = '{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/%N/%N.js';
2020
</script>
2121
{{end}}
2222

templates/repo/diff/box.tmpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,14 @@
278278

279279
{{if .IsSplitStyle}}
280280
<script>
281-
document.addEventListener('DOMContentLoaded', function() {
281+
document.addEventListener('DOMContentLoaded', () => {
282282
$('tr.add-code').each(function() {
283-
var prev = $(this).prev();
284-
if(prev.is('.del-code') && prev.children().eq(5).text().trim() === '') {
285-
while(prev.prev().is('.del-code') && prev.prev().children().eq(5).text().trim() === '') {
283+
let prev = $(this).prev();
284+
if (prev.is('.del-code') && prev.children().eq(5).text().trim() === '') {
285+
while (prev.prev().is('.del-code') && prev.prev().children().eq(5).text().trim() === '') {
286286
prev = prev.prev();
287287
}
288-
prev.children().eq(3).attr("data-line-num", $(this).children().eq(3).attr("data-line-num"));
288+
prev.children().eq(3).attr('data-line-num', $(this).children().eq(3).attr('data-line-num'));
289289
prev.children().eq(3).html($(this).children().eq(3).html());
290290
prev.children().eq(4).html($(this).children().eq(4).html());
291291
prev.children().eq(5).html($(this).children().eq(5).html());

templates/repo/home.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
if (httpsButton) httpsButton.classList[isSSH ? 'remove' : 'add']('primary');
136136
setTimeout(() => {
137137
if (sshButton) sshButton.classList.remove('no-transition');
138-
if (httpsButto) httpsButton.classList.remove('no-transition');
138+
if (httpsButton) httpsButton.classList.remove('no-transition');
139139
}, 100);
140140
</script>
141141
{{if or (not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH))}}

templates/repo/issue/view_content/pull.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
{{if .CanChange }}
4848
<a href="#" class="ui poping up icon re-request-review {{if .Checked}}checked{{end}}" data-issue-id="{{$.Issue.ID}}" data-content="{{if .Checked}} {{$.i18n.Tr "repo.issues.remove_request_review"}} {{else}} {{$.i18n.Tr "repo.issues.re_request_review"}} {{end}}" data-id="{{.ItemID}}" data-update-url="{{$.RepoLink}}/issues/request_review">
49-
{{svg "octicon-sync"}}
49+
{{if .Checked}} {{svg "octicon-trashcan"}} {{else}} {{svg "octicon-sync"}} {{end}}
5050
</a>
5151
{{end}}
5252
{{svg (printf "octicon-%s" .Review.Type.Icon)}}

templates/repo/issue/view_content/sidebar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
{{if .CanChange}}
7272
<a href="#" class="ui poping up icon re-request-review {{if .Checked}}checked{{end}}" data-content="{{if .Checked}} {{$.i18n.Tr "repo.issues.remove_request_review"}} {{else}} {{$.i18n.Tr "repo.issues.re_request_review"}} {{end}}" data-issue-id="{{$.Issue.ID}}" data-id="{{.ItemID}}" data-update-url="{{$.RepoLink}}/issues/request_review">
73-
{{svg "octicon-sync"}}
73+
{{if .Checked}} {{svg "octicon-trashcan"}} {{else}} {{svg "octicon-sync"}} {{end}}
7474
</a>
7575
{{end}}
7676
{{svg (printf "octicon-%s" .Review.Type.Icon)}}

0 commit comments

Comments
 (0)