Skip to content

Instantly share code, notes, and snippets.

@bluenex
Last active May 4, 2019 15:04
Show Gist options
  • Save bluenex/86c79172340a291522bc18c6549d1466 to your computer and use it in GitHub Desktop.
Save bluenex/86c79172340a291522bc18c6549d1466 to your computer and use it in GitHub Desktop.
My personal Gatsby starter as a commands. Will probably become a repo later.

Create a project with hello-world base:

gatsby new gatsby-tutorial https://github.com/gatsbyjs/gatsby-starter-hello-world 

Install plugins. Here are plugins at the moment:

dev dependencies:

npm install --save gatsby-plugin-typography typography react-typography typography-theme-moraga gatsby-plugin-styled-components styled-components babel-plugin-styled-components prop-types

npm install --save-dev gatsby-plugin-eslint eslint eslint-loader eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react

.eslintrc.json

{
  "extends": "airbnb",
  "plugins": [
    "react"
  ],
  "parser": "babel-eslint",
  "rules": {
    "no-nested-ternary": "off",
    "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
    "no-underscore-dangle": 0,
    "react/prop-types": ["error", { "ignore": ["navigation"] }],
    "global-require": 0
  }
}

gatsby-config.js

module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-typography`,
      options: {
        pathToConfigModule: `src/utils/typography`,
      },
    },
    {
      resolve: `gatsby-plugin-styled-components`,
      options: {
        // Add any options here
      },
    },
    'gatsby-plugin-eslint',
  ],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment