Skip to content

Commit

Permalink
feat(dev): Added ESlint plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
kevee committed Mar 25, 2020
1 parent 1260904 commit e9c94ba
Show file tree
Hide file tree
Showing 15 changed files with 165 additions and 86 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ module.exports = {
rules: {
semi: [2, 'never'],
'jsx-a11y/href-no-hash': ['off'],
'react/prop-types': ['off'],
'react/jsx-props-no-spreading': ['off'],
'react/no-danger': ['off'],
'react/jsx-filename-extension': ['warn', { extensions: ['.js', '.jsx'] }],
'max-len': [
'warn',
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ gatsby develop

The site is now running at `http://localhost:8000`. Any changes you make to code is live-updated. There is a GraphQL preview tool available at `http://localhost:8000/___graphql` to see what data is exposed to the website.

Note that any changes you make while running Gatsby will automatically checked with [ESLint](https://eslint.org/), so check your console as you save files.

## Storybook

All common components throughout the site are documented in [Storybook](https://storybook.js.org/). You can find all our component stories in `/src/stories`.
Expand Down
55 changes: 28 additions & 27 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,35 @@ module.exports = {
},
},
plugins: [
`gatsby-plugin-react-helmet`,
`gatsby-plugin-sass`,
`gatsby-plugin-mdx`,
`gatsby-transformer-yaml`,
'gatsby-plugin-react-helmet',
'gatsby-plugin-sass',
'gatsby-plugin-mdx',
'gatsby-transformer-yaml',
'gatsby-plugin-eslint',
{
resolve: `gatsby-transformer-remark`,
resolve: 'gatsby-transformer-remark',
options: {
plugins: [`gatsby-remark-autolink-headers`],
plugins: ['gatsby-remark-autolink-headers'],
},
},
{
resolve: `gatsby-source-filesystem`,
resolve: 'gatsby-source-filesystem',
options: {
name: `content`,
name: 'content',
path: `${__dirname}/src/content/pages/`,
},
},
{
resolve: `gatsby-source-filesystem`,
resolve: 'gatsby-source-filesystem',
options: {
name: `snippets`,
name: 'snippets',
path: `${__dirname}/src/content/snippets/`,
},
},
{
resolve: `gatsby-source-filesystem`,
resolve: 'gatsby-source-filesystem',
options: {
name: `navigation`,
name: 'navigation',
path: `${__dirname}/src/data/navigation`,
},
},
Expand All @@ -61,67 +62,67 @@ module.exports = {
options: {
typePrefix: 'covid__',
name: 'state',
url: `https://covidtracking.com/api/states`,
url: 'https://covidtracking.com/api/states',
},
},
{
resolve: 'gatsby-source-apiserver',
options: {
typePrefix: 'covid__',
name: 'stateInfo',
url: `https://covidtracking.com/api/states/info`,
url: 'https://covidtracking.com/api/states/info',
},
},
{
resolve: 'gatsby-source-apiserver',
options: {
typePrefix: 'covid__',
name: 'stateDaily',
url: `https://covidtracking.com/api/states/daily`,
url: 'https://covidtracking.com/api/states/daily',
},
},
{
resolve: 'gatsby-source-apiserver',
options: {
typePrefix: 'covid__',
name: 'us',
url: `https://covidtracking.com/api/us`,
url: 'https://covidtracking.com/api/us',
},
},
{
resolve: 'gatsby-source-apiserver',
options: {
typePrefix: 'covid__',
name: 'usDaily',
url: `https://covidtracking.com/api/us/daily`,
url: 'https://covidtracking.com/api/us/daily',
},
},
{
resolve: 'gatsby-source-apiserver',
options: {
typePrefix: 'covid__',
name: 'screenshots',
url: `https://covidtracking.com/api/screenshots`,
url: 'https://covidtracking.com/api/screenshots',
},
},
{
resolve: 'gatsby-source-apiserver',
options: {
typePrefix: 'covid__',
name: 'press',
url: `https://covidtracking.com/api/press`,
url: 'https://covidtracking.com/api/press',
},
},
{
resolve: `gatsby-plugin-manifest`,
resolve: 'gatsby-plugin-manifest',
options: {
name: `The COVID Tracking Project`,
short_name: `COVID Tracking Project`,
start_url: `/`,
background_color: `#ffffff`,
theme_color: `#ffffff`,
display: `minimal-ui`,
icon: `src/images/icons/icon-512.png`, // This path is relative to the root of the site.
name: 'The COVID Tracking Project',
short_name: 'COVID Tracking Project',
start_url: '/',
background_color: '#ffffff',
theme_color: '#ffffff',
display: 'minimal-ui',
icon: 'src/images/icons/icon-512.png', // This path is relative to the root of the site.
},
},
],
Expand Down
127 changes: 106 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@storybook/addon-info": "^5.3.17",
"gatsby": "^2.19.45",
"gatsby-image": "^2.2.44",
"gatsby-plugin-eslint": "^2.0.8",
"gatsby-plugin-manifest": "^2.2.48",
"gatsby-plugin-mdx": "^1.1.1",
"gatsby-plugin-offline": "^3.0.41",
Expand Down Expand Up @@ -41,6 +42,11 @@
"@storybook/addons": "^5.3.17",
"@storybook/react": "^5.3.17",
"babel-loader": "^8.1.0",
"eslint": "^6.8.0",
"eslint-config-airbnb": "^18.1.0",
"eslint-config-prettier": "^6.10.1",
"eslint-loader": "^3.0.3",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1"
},
"keywords": [
Expand Down
Loading

0 comments on commit e9c94ba

Please sign in to comment.