Shared eslint configurations, useful plugins & custom rules.
Inside of lib/config you'll find a set of configs for different environments + base.js.
Base.js effectively documents our code style. Please make sure any rules you add come with an explanation!
- Make sure that
gstenvis green. See our Dev Environment docs. git clonethis repo &cdinto it as usual- Run
pnpm installto install dependencies.
From the project you want to lint, run pnpm link ../eslint-plugin-ghost
(adjust the path to your local checkout).
- Inside of package.json, add this rule:
"lint": "eslint . --ext .js --cache" - Then, in your project root, create an
.eslintrc.jsfile, and add the following code:
module.exports = {
plugins: ['ghost'],
extends: [
'plugin:ghost/[config]',
]
};
- Change
[config]to be E.g. node, browser, test etc depending on what environment you are linting - If you want style rules disabled, use the
-no-stylepresets instead:browser-no-stylenode-no-stylees-no-stylets-no-stylefilenames-no-styletest-no-stylets-test-no-style
- If you have a test folder, browser JS, etc, you can add multiple
.eslintrc.jsfiles, nesting them inside the folder they belong to. - The
tsandts-testconfigs (and their-no-stylepresets) needtypescript,@typescript-eslint/parserand@typescript-eslint/eslint-plugininstalled in your project. The other configs don't.
pnpm ship— choose a version interactively, publish it, and push the release commit and tag.pnpm ship patch— publish a specified release type (patch,minor, ormajor) non-interactively.
Copyright (c) 2013-2026 Ghost Foundation - Released under the MIT license. Ghost and the Ghost Logo are trademarks of Ghost Foundation Ltd. Please see our trademark policy for info on acceptable usage.