From 91c470ed9d8e0e5875258651cb84db0477596e9e Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Sat, 10 Feb 2024 20:47:19 +0100 Subject: [PATCH] ci: add js linting --- .editorconfig | 8 ++++++ .github/workflows/js.yml | 27 +++++++++++++++++++ biome.json | 19 +++++++++++++ .../component/sw-mail-template-list/index.js | 23 +++++++++------- 4 files changed, 67 insertions(+), 10 deletions(-) create mode 100644 .editorconfig create mode 100644 .github/workflows/js.yml create mode 100644 biome.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d3fcdc6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +charset = utf-8 diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml new file mode 100644 index 0000000..0a9cee8 --- /dev/null +++ b/.github/workflows/js.yml @@ -0,0 +1,27 @@ +name: JavaScript +on: + push: + paths: + - '**/*.js' + - '**/*.ts' + branches: + - main + pull_request: + paths: + - '**/*.js' + - '**/*.ts' + +jobs: + run: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Biome CLI + uses: biomejs/setup-biome@v2 + with: + version: latest + + - name: Run Biome + run: biome ci . diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..7e8d4b8 --- /dev/null +++ b/biome.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", + "files": { + "ignore": ["src/Resources/public", "src/Resources/app/storefront/dist"] + }, + "javascript": { + "formatter": { + "indentStyle": "space", + "indentWidth": 4, + "quoteStyle": "single" + } + }, + "json": { + "formatter": { + "indentStyle": "space", + "indentWidth": 4 + } + } +} diff --git a/src/Resources/app/administration/src/module/sw-mail-template/component/sw-mail-template-list/index.js b/src/Resources/app/administration/src/module/sw-mail-template/component/sw-mail-template-list/index.js index a5bebf5..ba76607 100644 --- a/src/Resources/app/administration/src/module/sw-mail-template/component/sw-mail-template-list/index.js +++ b/src/Resources/app/administration/src/module/sw-mail-template/component/sw-mail-template-list/index.js @@ -6,16 +6,19 @@ Shopware.Component.override('sw-mail-template-list', { getListColumns() { const columns = this.$super('getListColumns'); - columns.unshift({ - property: 'froshTemplateMail', - label: 'sw-mail-template.list.columnTemplateMail', - allowResize: true, - }, { - property: 'technicalName', - label: 'sw-mail-template.list.columnTechnicalName', - allowResize: true, - visible: false, - }); + columns.unshift( + { + property: 'froshTemplateMail', + label: 'sw-mail-template.list.columnTemplateMail', + allowResize: true, + }, + { + property: 'technicalName', + label: 'sw-mail-template.list.columnTechnicalName', + allowResize: true, + visible: false, + }, + ); return columns; },