Skip to content

Commit cbed5e3

Browse files
committed
[assets] Move some frontend assets to _vendor_ directories:
This simplifies linting of files we have no grasp on, and clarifies responsibilities. - Add .eslintignore. - Restrict linting to bookwyrm/static.
1 parent 5aea734 commit cbed5e3

File tree

10 files changed

+11
-9
lines changed

10 files changed

+11
-9
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/vendor/**

.github/workflows/lint-frontend.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ jobs:
2222
- name: Install modules
2323
run: yarn
2424

25+
# See .stylelintignore for files that are not linted.
2526
- name: Run stylelint
26-
run: yarn stylelint **/static/**/*.css --report-needless-disables --report-invalid-scope-disables
27+
run: yarn stylelint bookwyrm/static/**/*.css --report-needless-disables --report-invalid-scope-disables
2728

29+
# See .eslintignore for files that are not linted.
2830
- name: Run ESLint
29-
run: yarn eslint . --ext .js,.jsx,.ts,.tsx
31+
run: yarn eslint bookwyrm/static --ext .js,.jsx,.ts,.tsx

.stylelintignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
bookwyrm/static/css/bulma.*.css*
2-
bookwyrm/static/css/icons.css
1+
**/vendor/**
File renamed without changes.
File renamed without changes.

bookwyrm/templates/book/book.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,5 +267,5 @@ <h2 class="title is-5">{% trans "Lists" %}</h2>
267267
{% endblock %}
268268

269269
{% block scripts %}
270-
<script src="/static/js/tabs.js"></script>
270+
<script src="/static/js/vendor/tabs.js"></script>
271271
{% endblock %}

bookwyrm/templates/feed/feed_layout.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,5 @@ <h3 class="title is-4">{% blocktrans with yar=goal.year %}{{ year }} Reading Goa
104104
{% endblock %}
105105

106106
{% block scripts %}
107-
<script src="/static/js/tabs.js"></script>
107+
<script src="/static/js/vendor/tabs.js"></script>
108108
{% endblock %}

bookwyrm/templates/layout.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<head>
66
<title>{% block title %}BookWyrm{% endblock %} | {{ site.name }}</title>
77
<meta name="viewport" content="width=device-width, initial-scale=1">
8-
<link type="text/css" rel="stylesheet" href="/static/css/bulma.min.css">
9-
<link type="text/css" rel="stylesheet" href="/static/css/icons.css">
10-
<link type="text/css" rel="stylesheet" href="/static/css/bookwyrm.css">
8+
<link rel="stylesheet" href="/static/css/vendor/bulma.min.css">
9+
<link rel="stylesheet" href="/static/css/vendor/icons.css">
10+
<link rel="stylesheet" href="/static/css/bookwyrm.css">
1111

1212
<link rel="shortcut icon" type="image/x-icon" href="{% if site.favicon %}/images/{{ site.favicon }}{% else %}/static/images/favicon.ico{% endif %}">
1313

0 commit comments

Comments
 (0)