diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 000000000..2f1ec70b8 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,3 @@ +. "$(dirname -- "$0")/_/husky.sh" + +pnpm lint-staged \ No newline at end of file diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 000000000..6ffcfd6e9 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,4 @@ +. "$(dirname -- "$0")/_/husky.sh" + +pnpm fix-redirects +pnpm link-checker \ No newline at end of file diff --git a/package.json b/package.json index f6cdc65c1..ef9ecd3e5 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,8 @@ "version": "0.0.1", "description": "Optimism Docs", "scripts": { - "lint": "eslint . --ext mdx --max-warnings 0 && pnpm spellcheck:lint && pnpm check-redirects && pnpm link-checker", + "prepare": "husky", + "lint": "eslint . --ext mdx --max-warnings 0 && pnpm spellcheck:lint && pnpm check-redirects", "fix": "eslint . --ext mdx --fix && pnpm spellcheck:fix && pnpm breadcrumbs && pnpm fix-redirects", "spellcheck:lint": "cspell lint \"**/*.mdx\"", "spellcheck:fix": "cspell --words-only --unique \"**/*.mdx\" | sort --ignore-case | uniq > words.txt", @@ -18,6 +19,16 @@ "start": "next start", "postbuild": "next-sitemap" }, + "lint-staged": { + "**/*.mdx": [ + "eslint --max-warnings 0", + "cspell lint" + ], + "**/*": [ + "pnpm fix-redirects", + "pnpm link-checker" + ] + }, "dependencies": { "@eth-optimism/contracts-ts": "^0.17.0", "@eth-optimism/tokenlist": "^9.0.9", @@ -51,6 +62,8 @@ "ethers": "^5", "globby": "^11.0.4", "gray-matter": "^4.0.3", + "husky": "^9.1.7", + "lint-staged": "^15.4.3", "remark": "^15.0.1", "remark-code-import": "^1.2.0", "remark-frontmatter": "^5.0.0", @@ -76,4 +89,4 @@ "nextra@2.13.2": "patches/nextra@2.13.2.patch" } } -} \ No newline at end of file +} diff --git a/pages/operators/node-operators/tutorials/node-from-docker.mdx b/pages/operators/node-operators/tutorials/node-from-docker.mdx index 3570cc75a..77f628f77 100644 --- a/pages/operators/node-operators/tutorials/node-from-docker.mdx +++ b/pages/operators/node-operators/tutorials/node-from-docker.mdx @@ -35,7 +35,7 @@ cd simple-optimism-node ## Configuration -Configuration for `simple-optimism-node` is handled through environment variables inside of an `.env` file. +Configuration for `simple-optimism-node` is handled through environment variables inside of an `.env` file {

Step-by-Step Guide to Creating an .env File

}