diff --git a/package.json b/package.json index f4c2c69..ff32f15 100644 --- a/package.json +++ b/package.json @@ -14,10 +14,10 @@ "scripts": { "start": "react-scripts start", "build": "react-scripts build", - "lint": "eslint src --ext .js,.jsx,.ts,.tsx", "test": "react-scripts test", "eject": "react-scripts eject", - "depcruise": "depcruise src --include-only '^src' --config --metrics --output-type dot | dot -T svg | depcruise-wrap-stream-in-html > dependency-graph.html" + "depcruise": "depcruise src --include-only '^src' --config --metrics --output-type dot | dot -T svg | depcruise-wrap-stream-in-html > dependency-graph.html", + "sweep-check": "scripts/sweep-check.sh" }, "eslintConfig": { "extends": [ diff --git a/scripts/sweep-check.sh b/scripts/sweep-check.sh new file mode 100755 index 0000000..3c5f56a --- /dev/null +++ b/scripts/sweep-check.sh @@ -0,0 +1,5 @@ + +if [[ $1 == *".ts" || $1 == *".tsx" ]]; then + eslint $1 + tsc $1 --noEmit +fi diff --git a/sweep.yaml b/sweep.yaml index cb5d8ac..9a671c2 100644 --- a/sweep.yaml +++ b/sweep.yaml @@ -36,7 +36,7 @@ sandbox: - npm install -g yarn - yarn install check: - - yarn lint + - yarn sweep-check {file_path} # This setting contains a list of rules that Sweep will check for. If any of these rules are broken in a new commit, Sweep will create an pull request to fix the broken rule. rules: