Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: added eslint checks for ui #244

Merged
merged 7 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading