Skip to content

About

Shared eslint configurations

Resources

Security policy

Stars

8 stars

Watchers

10 watching

Forks

Repository files navigation

eslint-plugin-ghost

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!

Basic setup

  1. Make sure that gstenv is green. See our Dev Environment docs.
  2. git clone this repo & cd into it as usual
  3. Run pnpm install to install dependencies.

Testing

From the project you want to lint, run pnpm link ../eslint-plugin-ghost (adjust the path to your local checkout).

Usage

  • Inside of package.json, add this rule: "lint": "eslint . --ext .js --cache"
  • Then, in your project root, create an .eslintrc.js file, 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-style presets instead:
    • browser-no-style
    • node-no-style
    • es-no-style
    • ts-no-style
    • filenames-no-style
    • test-no-style
    • ts-test-no-style
  • If you have a test folder, browser JS, etc, you can add multiple .eslintrc.js files, nesting them inside the folder they belong to.
  • The ts and ts-test configs (and their -no-style presets) need typescript, @typescript-eslint/parser and @typescript-eslint/eslint-plugin installed in your project. The other configs don't.

Publishing

  • 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, or major) non-interactively.

Copyright & License

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.

About

Shared eslint configurations

Resources

Security policy

Stars

8 stars

Watchers

10 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages