Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

config: add type linting to commitlint

Abdullah Attafe793fc7ad30
diff --git a/commitlint.config.js b/commitlint.config.js
index c03d08312..12cc32c47 100644
--- a/commitlint.config.js
+++ b/commitlint.config.js
@@ -6,12 +6,32 @@ const { readFileSync } = require("fs");
const authorEmail = execSync(`git show -s --format='%ae' HEAD`)
.toString("utf-8")
.trim();
-
const authors = readFileSync("AUTHORS", "utf-8");
const isAuthor = authors.includes(`<${authorEmail}>`);
+const SCOPES = [
+ // apps
+ "mobile",
+ "web",
+
+ // packages
+ "crypto",
+ "crypto-worker",
+ "editor",
+ "logger",
+ "streamable-fs",
+
+ // repo maintenance
+ "config", // changing configuration of already installed tools in the repo
+ "ci", // changes related to CI
+ "setup", // setting up someting new in the repo (e.g. eslint, commitlint)
+ "docs" // changes related to documentation (README etc.)
+];
+
module.exports = {
rules: {
- "signed-off-by": [isAuthor ? 0 : 2, "always", `Signed-off-by:`]
+ "signed-off-by": [isAuthor ? 0 : 2, "always", `Signed-off-by:`],
+ "type-enum": [2, "always", SCOPES],
+ "type-empty": [2, "never"]
}
};