diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..b512c09d4 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..ff7a769a7 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,32 @@ +module.exports = { + env: { + browser: true, + node: true, + }, + extends: [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended" + ], + parser: "@typescript-eslint/parser", + parserOptions: { + ecmaVersion: 12, + sourceType: "module", + }, + plugins: [ + "svelte3", + "@typescript-eslint" + ], + overrides: [ + { + files: ["*.svelte"], + processor: "svelte3/svelte3", + } + ], + rules: { + "@typescript-eslint/no-explicit-any": "off", + indent: ["error", 2, { "SwitchCase": 1 }] + }, + settings: { + "svelte3/typescript": true, + }, +}; diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml new file mode 100644 index 000000000..39ef39e65 --- /dev/null +++ b/.github/workflows/check-format.yml @@ -0,0 +1,12 @@ +name: check-format +on: [push] + +jobs: + check-format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + - run: npm ci + - run: ./scripts/check-format + shell: bash diff --git a/scripts/check-format b/scripts/check-format new file mode 100755 index 000000000..cef7ee4ce --- /dev/null +++ b/scripts/check-format @@ -0,0 +1,6 @@ +#!/bin/sh + +# Checks local /node_modules, +# if not found will download that package and execute it. +# Does not modify files, informs bad code format +npx eslint .