Use opinionated code formatter `prettier` and `eslint` for static code
analysis of JavaScript code.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
--- /dev/null
+{
+ "env": {
+ "browser": true,
+ "es2020": true
+ },
+ "extends": [
+ "eslint:recommended",
+ "prettier"
+ ]
+}
- pre-build
- test
+check HTML, JS, CSS with eslint and prettier:
+ stage: pre-build
+ image: node
+ cache:
+ paths:
+ - node_modules/
+ script:
+ - yarn install
+ - yarn prettier --check www/
+ - yarn eslint www/
+
check HTML, CSS and SVG with html5validator:
stage: pre-build
image: cyb3rjak3/html5validator:latest
--- /dev/null
+{
+ "devDependencies": {
+ "eslint": "^7.6.0",
+ "eslint-config-prettier": "^6.11.0",
+ "eslint-plugin-prettier": "^3.1.4",
+ "prettier": "^2.0.5"
+ }
+}