feat: extract Directus sync/branding and optimize Gitea CI with Next.js lint support
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
export default {
|
||||
const config = {
|
||||
extends: ["@commitlint/config-conventional"],
|
||||
rules: {
|
||||
"header-max-length": [2, "always", 150],
|
||||
@@ -6,3 +6,5 @@ export default {
|
||||
"subject-full-stop": [0],
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
@@ -1,4 +1,22 @@
|
||||
export default {
|
||||
"*.{js,jsx,ts,tsx}": ["eslint --fix", "prettier --write"],
|
||||
import path from "path";
|
||||
|
||||
const buildLintCommand = (filenames) => {
|
||||
const isNext =
|
||||
process.env.npm_package_devDependencies_next ||
|
||||
process.env.npm_package_dependencies_next;
|
||||
|
||||
if (isNext) {
|
||||
return `next lint --fix --file ${filenames
|
||||
.map((f) => path.relative(process.cwd(), f))
|
||||
.join(" --file ")}`;
|
||||
}
|
||||
|
||||
return "eslint --fix";
|
||||
};
|
||||
|
||||
const config = {
|
||||
"*.{js,jsx,ts,tsx}": [buildLintCommand, "prettier --write"],
|
||||
"*.{json,md,css,scss}": ["prettier --write"],
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
Reference in New Issue
Block a user