From bd47bb8cdc28662bb404510daedefbf2ca5252ff Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Wed, 21 Jul 2021 08:45:35 +0300 Subject: [PATCH] chore(lint): add lint command (#5106) --- .vscode.example/settings.json | 4 ++++ package.json | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .vscode.example/settings.json diff --git a/.vscode.example/settings.json b/.vscode.example/settings.json new file mode 100644 index 000000000..64be114a1 --- /dev/null +++ b/.vscode.example/settings.json @@ -0,0 +1,4 @@ +{ + "go.lintTool": "golangci-lint", + "go.lintFlags": ["--fast", "-E", "exportloopref"] +} diff --git a/package.json b/package.json index 03731fd25..aa00f0908 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,10 @@ "start:toolkit": "grunt start:toolkit", "build:server:offline": "cd ./api/cmd/portainer && CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags '-s' && mv -f portainer ../../../dist/portainer", "clean:all": "grunt clean:all", - "format": "prettier --loglevel warn --write \"**/*.{js,css,html}\"" + "format": "prettier --loglevel warn --write \"**/*.{js,css,html}\"", + "lint": "yarn lint:client; yarn lint:server", + "lint:server": "cd api && golangci-lint run -E exportloopref", + "lint:client": "eslint --cache --fix ." }, "scriptsComments": { "build": "Build the entire app (backend/frontend) in development mode", @@ -171,4 +174,4 @@ "*.js": "eslint --cache --fix", "*.{js,css,md,html}": "prettier --write" } -} +} \ No newline at end of file