From 3b895e13b0a1bc2415c480f5005b4d0e076c1804 Mon Sep 17 00:00:00 2001 From: mmeest Date: Thu, 4 Sep 2025 13:54:11 +0300 Subject: [PATCH] initial --- .eslintrc.cjs | 67 ++++++++++++++++++++ .github/workflows/node.yml | 3 +- .github/workflows/qlty.yml | 33 ++++++++++ .qlty/.gitignore | 7 +++ .qlty/configs/.hadolint.yaml | 2 + .qlty/configs/.yamllint.yaml | 21 +++++++ .qlty/qlty.toml | 118 +++++++++++++++++++++++++++++++++++ 7 files changed, 250 insertions(+), 1 deletion(-) create mode 100644 .eslintrc.cjs create mode 100644 .github/workflows/qlty.yml create mode 100644 .qlty/.gitignore create mode 100644 .qlty/configs/.hadolint.yaml create mode 100644 .qlty/configs/.yamllint.yaml create mode 100644 .qlty/qlty.toml diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..9ee668c --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,67 @@ +module.exports = { + env: { + browser: true, + es2020: true, + node: true, + jest: true, + }, + extends: [ + 'eslint:recommended', + 'plugin:react/recommended', + 'plugin:react/jsx-runtime', + 'plugin:react-hooks/recommended', + 'airbnb', + 'plugin:prettier/recommended', + ], + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + ecmaFeatures: { + jsx: true, + }, + }, + settings: { + react: { + version: 'detect', + }, + }, + plugins: [ + 'react', + 'react-hooks', + 'react-refresh', + 'prettier', + 'jsx-a11y', + ], + rules: { + camelcase: 0, + 'react/style-prop-object': 0, + 'global-require': 0, + 'import/newline-after-import': 0, + 'import/no-dynamic-require': 0, + 'import/no-extraneous-dependencies': 0, + 'jsx-a11y/anchor-is-valid': ['error'], + 'no-console': 0, + 'no-duplicate-imports': 0, + 'no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_', // Ignore params starting with underscore + varsIgnorePattern: '^_', // Ignore variables starting with underscore + caughtErrorsIgnorePattern: '^_', // Ignore caught errors starting with underscore + }, + ], + 'one-var': 0, + 'prettier/prettier': ['error'], + 'react/forbid-prop-types': [0, { checkChildContextTypes: false }], + 'react/jsx-filename-extension': [1, { extensions: ['.jsx'] }], + 'react/jsx-props-no-spreading': 0, + 'react/jsx-sort-props': ['error'], + 'react/prop-types': 0, + 'react/sort-comp': ['error'], + 'object-literal-sort-keys': 0, + 'react/jsx-no-target-blank': 'off', + 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], + semi: ['error', 'always'], + }, + ignorePatterns: ['**/dist/**', '**/node_modules/**', '**/build/**', '**/coverage/**'], +}; diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index e802188..eb2aa6c 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -1,6 +1,7 @@ name: Node.js CI -on: [push] +on: + push: jobs: build: diff --git a/.github/workflows/qlty.yml b/.github/workflows/qlty.yml new file mode 100644 index 0000000..d6feb7c --- /dev/null +++ b/.github/workflows/qlty.yml @@ -0,0 +1,33 @@ +name: Code Quality Check + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + quality: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Install qlty + run: | + # Install qlty using official install script + curl https://qlty.sh | sh + echo "$HOME/.qlty/bin" >> $GITHUB_PATH + + - name: Run qlty check + run: qlty check diff --git a/.qlty/.gitignore b/.qlty/.gitignore new file mode 100644 index 0000000..3036618 --- /dev/null +++ b/.qlty/.gitignore @@ -0,0 +1,7 @@ +* +!configs +!configs/** +!hooks +!hooks/** +!qlty.toml +!.gitignore diff --git a/.qlty/configs/.hadolint.yaml b/.qlty/configs/.hadolint.yaml new file mode 100644 index 0000000..8f7e23e --- /dev/null +++ b/.qlty/configs/.hadolint.yaml @@ -0,0 +1,2 @@ +ignored: + - DL3008 diff --git a/.qlty/configs/.yamllint.yaml b/.qlty/configs/.yamllint.yaml new file mode 100644 index 0000000..7440066 --- /dev/null +++ b/.qlty/configs/.yamllint.yaml @@ -0,0 +1,21 @@ +extends: default + +rules: + document-start: disable + quoted-strings: + required: only-when-needed + extra-allowed: ["{|}"] + key-duplicates: {} + octal-values: + forbid-implicit-octal: true + line-length: disable + indentation: disable + new-line-at-end-of-file: disable + trailing-spaces: disable + brackets: disable + colons: disable + empty-lines: disable + comments: disable + braces: disable + comments-indentation: disable + commas: disable diff --git a/.qlty/qlty.toml b/.qlty/qlty.toml new file mode 100644 index 0000000..0bf24f6 --- /dev/null +++ b/.qlty/qlty.toml @@ -0,0 +1,118 @@ +# This file was automatically generated by `qlty init`. +# You can modify it to suit your needs. +# We recommend you to commit this file to your repository. +# +# This configuration is used by both Qlty CLI and Qlty Cloud. +# +# Qlty CLI -- Code quality toolkit for developers +# Qlty Cloud -- Fully automated Code Health Platform +# +# Try Qlty Cloud: https://qlty.sh +# +# For a guide to configuration, visit https://qlty.sh/d/config +# Or for a full reference, visit https://qlty.sh/d/qlty-toml +config_version = "0" + +exclude_patterns = [ + "*_min.*", + "*-min.*", + "*.min.*", + "**/.yarn/**", + "**/*.d.ts", + "**/assets/**", + "**/bower_components/**", + "**/build/**", + "**/cache/**", + "**/config/**", + "**/db/**", + "**/deps/**", + "**/dist/**", + "**/extern/**", + "**/external/**", + "**/generated/**", + "**/Godeps/**", + "**/gradlew/**", + "**/mvnw/**", + "**/node_modules/**", + "**/protos/**", + "**/seed/**", + "**/target/**", + "**/templates/**", + "**/testdata/**", + "**/vendor/**", +] + +test_patterns = [ + "**/test/**", + "**/spec/**", + "**/*.test.*", + "**/*.spec.*", + "**/*_test.*", + "**/*_spec.*", + "**/test_*.*", + "**/spec_*.*", +] + +[smells] +mode = "comment" + +[[source]] +name = "default" +default = true + + +[[plugin]] +name = "actionlint" + +[[plugin]] +name = "dockerfmt" + +[[plugin]] +name = "dotenv-linter" +mode = "comment" + +[[plugin]] +name = "eslint" +version = "8.57.1" +package_file = "package.json" +package_filters = ["eslint", "jest", "prettier"] + +[[plugin]] +name = "hadolint" + +[[plugin]] +name = "markdownlint" +drivers = [ + "lint", +] +mode = "comment" + +[[plugin]] +name = "osv-scanner" + +[[plugin]] +name = "prettier" + +[[plugin]] +name = "radarlint-iac" +mode = "monitor" + +[[plugin]] +name = "radarlint-js" + +[[plugin]] +name = "ripgrep" +mode = "comment" + +[[plugin]] +name = "trivy" +drivers = [ + "config", + "fs-vuln", +] + +[[plugin]] +name = "trufflehog" + +[[plugin]] +name = "yamllint"