Skip to content

Commit

Permalink
daml-types.ts: Lint tests as well (digital-asset#4208)
Browse files Browse the repository at this point in the history
* daml-types.ts: Lint tests as well

Also simplify file selection a bit.

CHANGELOG_BEGIN
CHANGELOG_END

* Fix build command in test script

CHANGELOG_BEGIN
CHANGELOG_END
  • Loading branch information
hurryabit authored and mergify[bot] committed Jan 25, 2020
1 parent 2160ad5 commit 8b7878f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion language-support/ts/codegen/tests/build-and-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ cd $TMP_DIR
$DAML2TS -o generated/src/daml --main-package-name daml-tests $DAR
sed -i "s/0.0.0-SDKVERSION/${VERSION}/" generated/package.json
$YARN install --frozen-lockfile
$YARN workspaces run build
cd generated
$YARN build
$YARN lint
JAVA=$JAVA SANDBOX=$SANDBOX JSON_API=$JSON_API DAR=$DAR $YARN test
9 changes: 4 additions & 5 deletions language-support/ts/daml-types/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ load("@sdk_version//:sdk_version.bzl", "sdk_version")

ts_library(
name = "daml-types",
srcs = glob(
["**/*.ts"],
exclude = ["**/*.test.ts"],
),
srcs = glob(["**/*.ts"]),
data = [
":LICENSE",
":package.json",
Expand All @@ -42,8 +39,10 @@ eslint_test(
name = "lint",
srcs = glob(
["**/*.ts"],
exclude = ["**/*.test.ts"],
exclude = ["lib/**/*"],
),
data = ["tsconfig.json"],
tsconfig = "tsconfig.eslint.json",
)

pkg_npm(
Expand Down
2 changes: 1 addition & 1 deletion language-support/ts/daml-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
"project": "./tsconfig.eslint.json"
},
"plugins": [
"@typescript-eslint"
Expand Down
7 changes: 7 additions & 0 deletions language-support/ts/daml-types/tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"files": [
"index.ts",
"index.test.ts"
]
}
6 changes: 1 addition & 5 deletions language-support/ts/daml-types/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,5 @@
"declaration": true,
"sourceMap": true
},
"include": ["**/*.ts"],
"exclude": [
"**/*.test.ts",
"lib/**/*"
]
"files": ["index.ts"]
}

0 comments on commit 8b7878f

Please sign in to comment.