[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 - name: Install modules
run: yarn run: yarn
# See .stylelintignore for files that are not linted.
- name: Run stylelint - 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 - 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* **/vendor/**
bookwyrm/static/css/icons.css

View file

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

View file

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

View file

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