[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.
This commit is contained in:
Fabien Basmaison 2021-04-05 16:17:11 +02:00
parent 5aea7343b4
commit cbed5e331b
10 changed files with 11 additions and 9 deletions

1
.eslintignore Normal file
View File

@ -0,0 +1 @@
**/vendor/**

View File

@ -22,8 +22,10 @@ jobs:
- name: Install modules
run: yarn
# See .stylelintignore for files that are not linted.
- name: Run stylelint
run: yarn stylelint **/static/**/*.css --report-needless-disables --report-invalid-scope-disables
run: yarn stylelint bookwyrm/static/**/*.css --report-needless-disables --report-invalid-scope-disables
# See .eslintignore for files that are not linted.
- name: Run ESLint
run: yarn eslint . --ext .js,.jsx,.ts,.tsx
run: yarn eslint bookwyrm/static --ext .js,.jsx,.ts,.tsx

View File

@ -1,2 +1 @@
bookwyrm/static/css/bulma.*.css*
bookwyrm/static/css/icons.css
**/vendor/**

View File

@ -267,5 +267,5 @@
{% endblock %}
{% block scripts %}
<script src="/static/js/tabs.js"></script>
<script src="/static/js/vendor/tabs.js"></script>
{% endblock %}

View File

@ -104,5 +104,5 @@
{% endblock %}
{% block scripts %}
<script src="/static/js/tabs.js"></script>
<script src="/static/js/vendor/tabs.js"></script>
{% endblock %}

View File

@ -5,9 +5,9 @@
<head>
<title>{% block title %}BookWyrm{% endblock %} | {{ site.name }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link type="text/css" rel="stylesheet" href="/static/css/bulma.min.css">
<link type="text/css" rel="stylesheet" href="/static/css/icons.css">
<link type="text/css" rel="stylesheet" href="/static/css/bookwyrm.css">
<link rel="stylesheet" href="/static/css/vendor/bulma.min.css">
<link rel="stylesheet" href="/static/css/vendor/icons.css">
<link rel="stylesheet" href="/static/css/bookwyrm.css">
<link rel="shortcut icon" type="image/x-icon" href="{% if site.favicon %}/images/{{ site.favicon }}{% else %}/static/images/favicon.ico{% endif %}">