diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index b0963d6..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "env": { - "commonjs": true, - "es6": true, - "jest": true, - "node": true - }, - "extends": "eslint:recommended", - "globals": { - "Atomics": "readonly", - "SharedArrayBuffer": "readonly" - }, - "parserOptions": { - "ecmaVersion": 2018 - }, - "rules": { - } -} diff --git a/.github/linters/.eslintrc.yml b/.github/linters/.eslintrc.yml new file mode 100644 index 0000000..b92a4c3 --- /dev/null +++ b/.github/linters/.eslintrc.yml @@ -0,0 +1,50 @@ +env: + commonjs: true + es6: true + jest: true + node: true + +globals: + Atomics: readonly + SharedArrayBuffer: readonly + +ignorePatterns: + - '!.*' + - '**/node_modules/.*' + - '**/dist/.*' + - '**/coverage/.*' + - '*.json' + +parser: '@babel/eslint-parser' + +parserOptions: + ecmaVersion: 2023 + sourceType: module + requireConfigFile: false + babelOptions: + babelrc: false + configFile: false + presets: + - jest + +plugins: + - jest + +extends: + - eslint:recommended + - plugin:github/recommended + - plugin:jest/recommended + +rules: + { + 'camelcase': 'off', + 'eslint-comments/no-use': 'off', + 'eslint-comments/no-unused-disable': 'off', + 'i18n-text/no-en': 'off', + 'import/no-commonjs': 'off', + 'import/no-namespace': 'off', + 'no-console': 'off', + 'no-unused-vars': 'off', + 'prettier/prettier': 'error', + 'semi': 'off' + } diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml new file mode 100644 index 0000000..6d79773 --- /dev/null +++ b/.github/linters/.markdown-lint.yml @@ -0,0 +1,7 @@ +# Unordered list style +MD004: + style: dash + +# Ordered list item prefix +MD029: + style: one diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml new file mode 100644 index 0000000..c975a33 --- /dev/null +++ b/.github/linters/.yaml-lint.yml @@ -0,0 +1,10 @@ +rules: + document-end: disable + document-start: + level: warning + present: false + line-length: + level: warning + max: 80 + allow-non-breakable-words: true + allow-non-breakable-inline-mappings: true diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..1d4f956 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,44 @@ +name: Lint Code Base + +on: + pull_request: + branches: + - main + push: + branches-ignore: + - main + +jobs: + lint: + name: Lint Code Base + runs-on: ubuntu-latest + + permissions: + contents: read + packages: read + statuses: write + + steps: + - name: Checkout + id: checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + id: setup-node + uses: actions/setup-node@v3 + with: + node-version: 20 + cache: npm + + - name: Install Dependencies + id: install + run: npm ci + + - name: Lint Code Base + id: super-linter + uses: super-linter/super-linter/slim@v5 + env: + DEFAULT_BRANCH: main + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + JAVASCRIPT_DEFAULT_STYLE: prettier + VALIDATE_JSCPD: false