gatsby-plugin-eslint-config

A Gatsby plugin that extends the default ESLint configuration.

Disclaimer

This plugin supports almost all rules added by the default configuration. Some rules are temporarily disabled. Please refer to these issues for more information.

Installation

npm i -D eslint-plugin-gatsby@npm:gatsby-plugin-eslint-config
yarn add -D eslint-plugin-gatsby@npm:gatsby-plugin-eslint-config

Installing eslint-plugin-gatsby@npm:gatsby-plugin-eslint-config sets eslint-plugin-gatsby as an alias for this plugin. This is done so that the plugin can be imported into .eslintrc.js.

Usage

.eslintrc.js

module.exports = {
  plugins: ["gatsby"],
  extends: ["plugin:gatsby/recommended"],
}

gatsby-config.js

module.exports = {
  plugins: [
    {
      resolve: "eslint-plugin-gatsby",
      options: {
        extensions: ["js", "jsx", "ts", "tsx"],
        failOnError: false,
      },
    },
  ],
}

Refer to the complete list of options.