From cd81e62d0c55f831f469b9c28cb6704feb164721 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Sirois Date: Thu, 5 Sep 2019 01:34:42 -0400 Subject: [PATCH] refact: clean up unused variables & setup matching lint rule --- package.json | 2 +- src/components/Footer/styles.tsx | 1 - src/components/Layout/index.tsx | 10 ---------- src/pages/about.tsx | 2 +- src/pages/index.tsx | 1 - src/pages/rules.tsx | 2 +- tslint.json | 1 + 7 files changed, 4 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index fbc6a5e..8b13722 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "develop": "gatsby develop", "fetch-users": "node ./scripts/fetchUsers.js", "format": "prettier --write src/**/*.{js,jsx}", - "lint": "tslint -c tslint.json '{src,scripts}/**/*.{js,ts,tsx}'", + "lint": "tslint -p tsconfig.json -c tslint.json '{src,scripts}/**/*.{js,ts,tsx}'", "lint:fix": "npm run lint -- --fix", "serve": "gatsby serve", "start": "npm run develop", diff --git a/src/components/Footer/styles.tsx b/src/components/Footer/styles.tsx index 9b6039b..4588dd3 100644 --- a/src/components/Footer/styles.tsx +++ b/src/components/Footer/styles.tsx @@ -1,4 +1,3 @@ -import { Link } from "gatsby" import styled from "styled-components" export const FooterWrapper = styled.footer` diff --git a/src/components/Layout/index.tsx b/src/components/Layout/index.tsx index c899a70..ae18af2 100644 --- a/src/components/Layout/index.tsx +++ b/src/components/Layout/index.tsx @@ -5,7 +5,6 @@ * See: https://www.gatsbyjs.org/docs/use-static-query/ */ -import { graphql, useStaticQuery } from "gatsby" import React, { Fragment, PropsWithChildren } from "react" import { GlobalStyles } from "../../globalStyles" @@ -20,15 +19,6 @@ export function Layout({ location, }: PropsWithChildren<{ location: Location }>) { const isHome = location.pathname === "/" - const data = useStaticQuery(graphql` - query { - site { - siteMetadata { - title - } - } - } - `) return ( diff --git a/src/pages/about.tsx b/src/pages/about.tsx index 81c3e62..35b1d92 100644 --- a/src/pages/about.tsx +++ b/src/pages/about.tsx @@ -1,6 +1,6 @@ import { graphql } from "gatsby" import React, { Fragment } from "react" -import { MarkdownRemark, Query } from "../../generated/graphql" +import { MarkdownRemark } from "../../generated/graphql" import { Markdown } from "../components/Markdown" import { SEO } from "../components/SEO" diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 36a3716..69384ca 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,4 +1,3 @@ -import { Link } from "gatsby" import React, { Fragment } from "react" import { SEO } from "../components/SEO" diff --git a/src/pages/rules.tsx b/src/pages/rules.tsx index 695cc06..91df62a 100644 --- a/src/pages/rules.tsx +++ b/src/pages/rules.tsx @@ -1,6 +1,6 @@ import { graphql } from "gatsby" import React, { Fragment } from "react" -import { MarkdownRemark, Query } from "../../generated/graphql" +import { MarkdownRemark } from "../../generated/graphql" import { Markdown } from "../components/Markdown" import { SEO } from "../components/SEO" diff --git a/tslint.json b/tslint.json index 2714450..5995b34 100644 --- a/tslint.json +++ b/tslint.json @@ -27,6 +27,7 @@ "no-eval": true, "no-parameter-reassignment": true, "no-submodule-imports": false, + "no-unused-variable": true, "react-hooks-nesting": "error" },