root: setup linting config for typescript and css
Installs dependencies for typescript and stylelint and
adds scripts to package.json for linting code. The linter
will ignore code in content/static for now. A new directory
to be added, content/lib, will contain the typescript and
unprocessed css files.
For golang/go#43358
Change-Id: I6ee74665a99af8938df6f1ee675c8705fcce589c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/280599
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
diff --git a/package.json b/package.json
index fc4bd29..ab62f1f 100644
--- a/package.json
+++ b/package.json
@@ -6,10 +6,25 @@
},
"private": true,
"scripts": {
+ "lint": "run-s --continue-on-error \"lint-* -- {1}\" -- ",
+ "lint-js": "eslint . --ext .ts,.js",
+ "lint-css": "stylelint **/*.css",
"license-check": "jsgl --local ."
},
"dependencies": {
+ "@typescript-eslint/eslint-plugin": "4.5.0",
+ "@typescript-eslint/parser": "4.5.0",
+ "eslint": "7.12.0",
+ "eslint-config-prettier": "6.14.0",
+ "eslint-plugin-jest": "^24.1.3",
+ "eslint-plugin-prettier": "^3.3.0",
"js-green-licenses": "^2.0.1",
- "prettier": "2.1.2"
+ "npm-run-all": "4.1.5",
+ "prettier": "2.1.2",
+ "stylelint": "13.8.0",
+ "stylelint-config-prettier": "8.0.2",
+ "stylelint-config-recommended": "3.0.0",
+ "stylelint-prettier": "1.1.2",
+ "typescript": "4.0.3"
}
}