pw_web_ui: Add linting with eslint and prettier
Uses gts to run eslint and prettier.gts is Google's TypeScript
formatter (https://github.com/google/gts).
Run `yarn run check` or `yarn run fix` to lint or format the code.
A future CL will add running this linter as a presubmit step.
This CL also formats several project files that weren't linted.
Change-Id: Ibfee61efb0d1f18cbd9aae5e6cb32687e8dce8ac
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12120
Commit-Queue: Matthew Soulanille <msoulanille@google.com>
Reviewed-by: Matthew Soulanille <msoulanille@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Reviewed-by: Max Koopman <koopman@google.com>
diff --git a/package.json b/package.json
index 0250504..55b642c 100644
--- a/package.json
+++ b/package.json
@@ -13,8 +13,11 @@
"@rollup/plugin-commonjs": "^13.0.0",
"@rollup/plugin-node-resolve": "^8.0.1",
"@types/jasmine": "^3.5.10",
+ "@types/node": "^13.11.1",
"@types/react": "^16.9.36",
"@types/react-dom": "^16.9.8",
+ "eslint-plugin-react": "^7.20.0",
+ "gts": "^2.0.2",
"jasmine": "^3.5.0",
"jasmine-core": "^3.5.0",
"karma": "5.0.2",
@@ -33,5 +36,9 @@
"rxjs": "^6.5.5",
"tmp": "0.1.0",
"typescript": "^3.9.3"
+ },
+ "scripts": {
+ "check": "gts check",
+ "fix": "gts fix"
}
}