diff --git a/.github/workflows/check_formatting.yml b/.github/workflows/check_formatting.yml index 7525d4fa7..0e5cf7eb6 100644 --- a/.github/workflows/check_formatting.yml +++ b/.github/workflows/check_formatting.yml @@ -9,4 +9,22 @@ jobs: - uses: actions/checkout@v3 - uses: psf/black@stable with: - options: "--check --line-length=79" # In line with .vscode/settings.json \ No newline at end of file + options: "--check --line-length=79" # In line with .vscode/settings.json + - name: Install pylint + run: pip install pylint + - name: Run pylint + run: pylint python/src + lint_typescript: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '14' + - name: Install dependencies + run: cd typescript && yarn install + - name: Run eslint + run: cd typescript && yarn lint --fix + - name: Run prettier + run: cd typescript && yarn prettier --write diff --git a/.vscode/settings.json b/.vscode/settings.json index 9915ca6aa..1a141c2bb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -28,6 +28,9 @@ "editor.rulers": [79] }, "black-formatter.args": ["--line-length=79"], - // example: "--disable=C0114,C0115,C0116" - "pylint.args": [], + "pylint.args": ["--disable=C0114,C0115,C0116"], + "eslint.options": { + "extensions": [".js", ".jsx", ".ts", ".tsx"] + }, + "prettier.requireConfig": true } diff --git a/typescript/.eslintrc.js b/typescript/.eslintrc.js index ed6b0e0fd..6185e4d17 100644 --- a/typescript/.eslintrc.js +++ b/typescript/.eslintrc.js @@ -1,9 +1,9 @@ export default { root: true, - extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], + extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"], parser: "@typescript-eslint/parser", parserOptions: { project: "./tsconfig.json", tsconfigRootDir: __dirname }, - plugins: ["@typescript-eslint"], + plugins: ["@typescript-eslint", "prettier"], rules: { "@typescript-eslint/no-unused-vars": [ "warn", @@ -14,5 +14,6 @@ export default { }, ], "@typescript-eslint/no-non-null-assertion": "off", + "prettier/prettier": "error", }, };