mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 11:47:54 +01:00
config: add type linting to commitlint
This commit is contained in:
@@ -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"]
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user