Skip to content

Commit

Permalink
Merge pull request #244 from raaymax/eslint-fix
Browse files Browse the repository at this point in the history
ci: added eslint checks for ui
  • Loading branch information
ramedina86 authored Feb 19, 2024
2 parents 6d4728e + d0e1b6c commit 7f6815e
Show file tree
Hide file tree
Showing 95 changed files with 2,638 additions and 2,948 deletions.
16 changes: 10 additions & 6 deletions alfred/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@


@alfred.command("ci", help="continuous integration pipeline")
def ci():
alfred.invoke_command("ci.mypy")
alfred.invoke_command("ci.pytest")
alfred.invoke_command("npm.build")

@alfred.option('--front', '-f', help="run for frontend only", is_flag=True, default=False)
@alfred.option('--back', '-b', help="run for backend only", is_flag=True, default=False)
def ci(front, back):
if back or (not front and not back):
alfred.invoke_command("ci.mypy")
alfred.invoke_command("ci.pytest")
if front or (not front and not back):
alfred.invoke_command("npm.lint")
alfred.invoke_command("npm.build")

@alfred.command("ci.mypy", help="typing checking with mypy on ./src/streamsync")
def ci_mypy():
Expand All @@ -18,4 +22,4 @@ def ci_mypy():
@alfred.command("ci.pytest", help="run pytest on ./tests")
def ci_test():
os.chdir("tests")
alfred.run("pytest")
alfred.run("pytest")
7 changes: 6 additions & 1 deletion alfred/npm.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import alfred
import os

@alfred.command("npm.lint", help="lint check ui code")
def npm_lint():
os.chdir("ui")
alfred.run("npm run lint:ci")

@alfred.command("npm.build", help="build ui code")
def npm_build():
os.chdir("ui")
Expand All @@ -9,4 +14,4 @@ def npm_build():
@alfred.command("npm.build_custom_components", help="build custom components")
def ui_build_custom():
os.chdir("ui")
alfred.run("npm run custom.build")
alfred.run("npm run custom.build")
21 changes: 12 additions & 9 deletions ui/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
module.exports = {
rules: {
indent: ["error", "tab"],
"prettier/prettier": [2, { useTabs: true }],
indent: "off",
"no-unused-vars": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/ban-types": "warn",
"prettier/prettier": [2, { useTabs: true, endOfLine: "auto" }],
},
parser: "vue-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
ecmaVersion: 2020,
sourceType: "module",
parser: "@typescript-eslint/parser",
ecmaVersion: 2020,
sourceType: "module",
},
root: true,
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:vue/vue3-essential",
"prettier/@typescript-eslint",
"plugin:vue/vue3-recommended",
"eslint:recommended",
"@vue/eslint-config-prettier",
"prettier/vue",
"prettier",
],
plugins: ["prettier", "@typescript-eslint"],
plugins: ["prettier", "@typescript-eslint", "vue"],
env: {
node: true,
},
Expand Down
Loading

0 comments on commit 7f6815e

Please sign in to comment.