diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..f428655 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,37 @@ +name: CI Workflow + +on: + push: + branches: + - main + - dev + pull_request: + branches: + - main + - dev + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Nodejs with yarn caching + uses: actions/setup-node@v4 + with: + cache: yarn + node-version-file: ".nvmrc" + + - name: Install dependencies + run: | + yarn install + + - name: Run lint + run: | + cd pkg/supportability-review-app/ + npm run format-check + + - name: Build Rancher Extension + run: | + yarn build-pkg supportability-review-app diff --git a/pkg/supportability-review-app/.eslintrc.cjs b/pkg/supportability-review-app/.eslintrc.cjs new file mode 100644 index 0000000..32c37c1 --- /dev/null +++ b/pkg/supportability-review-app/.eslintrc.cjs @@ -0,0 +1,19 @@ +/* eslint-env node */ +require('@rushstack/eslint-patch/modern-module-resolution'); + +module.exports = { + root: true, + extends: [ + 'plugin:vue/vue3-essential', + 'eslint:recommended', + '@vue/eslint-config-typescript', + '@vue/eslint-config-prettier/skip-formatting' + ], + parserOptions: { + ecmaVersion: 'latest' + }, + rules: { + /* ignore _ variable name */ + '@typescript-eslint/no-unused-vars': ['warn', { varsIgnorePattern: '^_$' }] + } +}; diff --git a/pkg/supportability-review-app/.prettierrc.json b/pkg/supportability-review-app/.prettierrc.json new file mode 100644 index 0000000..0e01f05 --- /dev/null +++ b/pkg/supportability-review-app/.prettierrc.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json.schemastore.org/prettierrc", + "semi": true, + "tabWidth": 2, + "singleQuote": true, + "printWidth": 120, + "trailingComma": "none", + "htmlWhitespaceSensitivity": "ignore", + "bracketSameLine": true +} diff --git a/pkg/supportability-review-app/components/ChecksSummaryWidget.vue b/pkg/supportability-review-app/components/ChecksSummaryWidget.vue index 56e8ed6..e1ee791 100644 --- a/pkg/supportability-review-app/components/ChecksSummaryWidget.vue +++ b/pkg/supportability-review-app/components/ChecksSummaryWidget.vue @@ -29,20 +29,20 @@ export default { }, computed: { summaryData() { - return [this.info.checks_pass, this.info.checks_warn, this.info.checks_fail, this.info.checks_skip] + return [this.info.checks_pass, this.info.checks_warn, this.info.checks_fail, this.info.checks_skip]; } }, methods: { getLabel(index) { - const labels = ['Pass', 'Warn', 'Fail', 'Skip'] - return labels[index] + const labels = ['Pass', 'Warn', 'Fail', 'Skip']; + return labels[index]; }, getBorderClass(index) { - const classes = ['border-success', 'border-warning', 'border-danger', 'border-secondary'] - return classes[index] + const classes = ['border-success', 'border-warning', 'border-danger', 'border-secondary']; + return classes[index]; } } -} +}; diff --git a/pkg/supportability-review-app/edit/sr.cattle.io.reviewbundle.vue b/pkg/supportability-review-app/edit/sr.cattle.io.reviewbundle.vue index 9c0320a..08673e3 100644 --- a/pkg/supportability-review-app/edit/sr.cattle.io.reviewbundle.vue +++ b/pkg/supportability-review-app/edit/sr.cattle.io.reviewbundle.vue @@ -1,9 +1,9 @@