Add eslint settings to vscode config (#17680)

* Add eslint settings to vscode config

* Lint vscode settings as json5

* A tiny bit better argument parsing, oops
This commit is contained in:
moxian
2022-04-29 13:07:46 +01:00
committed by GitHub
parent b54dd401b9
commit b000bd2a88
5 changed files with 29 additions and 3 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ jobs:
bash tools/ci/install_dreamchecker.sh
- name: Run Linters
run: |
find . -name "*.json" -not -path "*/node_modules/*" -print0 | xargs -0 python3 ./tools/ci/json_verifier.py
tools/ci/check_json.sh
tools/ci/build_tgui.sh
tools/ci/check_grep.sh
python3 tools/ci/check_line_endings.py
+16 -1
View File
@@ -4,5 +4,20 @@
},
"gitlens.advanced.blame.customArguments": [
"--ignore-revs-file", "${workspaceRoot}/.git-blame-ignore-revs"
]
],
// ESLint settings:
"eslint.workingDirectories": [
"tgui/"
],
"eslint.rules.customizations": [
// We really want to fail the CI builds on styling errors,
// but it's better to show them as yellow squigglies in IDE
// and thus differentiate from the red typescript ones which
// are actually hard errors.
{ "rule": "*", "severity": "warn" }
],
"eslint.format.enable": true,
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
}
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
set -euo pipefail
# We probably could validate literally everything as json5, but let's be cautions for no good reason here.
find .vscode/ -name "*.json" -print0 | xargs -0 python3 tools/ci/json_verifier.py -5
find . -name "*.json" -not -path "*/node_modules/*" -and -not -path "./.vscode/*" -print0 | xargs -0 python3 tools/ci/json_verifier.py
+1
View File
@@ -7,4 +7,5 @@ source ~/.nvm/nvm.sh
nvm install $NODE_VERSION
nvm use $NODE_VERSION
npm install --global yarn
python3 -m pip install json5
+5 -1
View File
@@ -1,5 +1,9 @@
import sys
import json
if sys.argv[1:2] == ["-5"]:
import json5 as json
sys.argv.pop(1)
else:
import json
if len(sys.argv) <= 1:
exit(1)