Linting SVG files (#1642)

* eslint rules for SVGS

* apply options

* Add typescript eslinter

* Make eslint work with the codebase

* Format icons

* Test svg

* Add workflow

* Fix lint command

* Revert duplicated aliases

* Update .eslintrc.js

Co-authored-by: Jakob Guddas <github@jguddas.de>

* Update .eslintrc.js

Co-authored-by: Jakob Guddas <github@jguddas.de>

* Move linter to separate workflow

* Add pnpm install

* Revert icon changes

* Test eslint workflow

* turn of fail lint-contributors

* Revert theater

* process feedback

---------

Co-authored-by: Jakob Guddas <github@jguddas.de>
This commit is contained in:
Eric Fennis
2023-11-06 11:00:04 +01:00
committed by GitHub
co-authored by Jakob Guddas
parent 207ff6c487
commit 288edde1ea
14 changed files with 595 additions and 228 deletions
+25
View File
@@ -0,0 +1,25 @@
name: Linting
on:
pull_request:
paths:
- icons/**
jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3.8.1
with:
node-version: 18
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Run Linter
run: pnpm lint
+3 -2
View File
@@ -39,8 +39,9 @@ jobs:
# Example for the previous substitution
# input: +++ b/icons/accessibility.json%0A@@ -2,0 +3 @@%0A+ "contributors": ["hi"],%0A@@ -13 +14 @@%0A+}%0A
# output: ::$ANNOTATION_SEVERITY file=icons/accessibility.json,line=2,endLine=3,title=$ANNOTATION_TITLE::$ANNOTATION_DESCRIPTION%0A%0A+ "contributors": ["hi"],%0A@@ -13 +14 @@%0A+}%0A
- name: Fail if contributors have changed
run: git diff --exit-code -- icons/*.json
# - name: Fail if contributors have changed
# run: git diff --exit-code -- icons/*.json
add-changed-icons-comment:
runs-on: ubuntu-latest
permissions: