diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index ac7d75f9..00000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,5 +0,0 @@ -version: '2' -checks: - method-lines: - config: - threshold: 55 # Gatsby's StaticQuery makes render functions pretty long diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index b444fcfc..00000000 --- a/.editorconfig +++ /dev/null @@ -1,14 +0,0 @@ - -# EditorConfig is awesome: http://EditorConfig.org -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -insert_final_newline = true -charset = utf-8 -trim_trailing_whitespace = true - -[*.scss] -indent_size = 4 diff --git a/.eslintrc b/.eslintrc index fc16e217..6501cb73 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,34 +1,36 @@ { "parser": "babel-eslint", - "extends": [ - "eslint:recommended", - "plugin:react/recommended", - "plugin:jsx-a11y/recommended", - "plugin:prettier/recommended" - ], - "plugins": ["react", "graphql", "prettier", "jsx-a11y"], + "extends": ["eslint:recommended", "prettier"], "parserOptions": { - "sourceType": "module", - "ecmaFeatures": { - "jsx": true, - "modules": true + "ecmaVersion": 2018, + "sourceType": "module" + }, + "env": { "browser": true, "node": true, "es6": true, "jest": true }, + "settings": { "react": { "version": "detect" } }, + "overrides": [ + { + "files": ["**/*.ts", "**/*.tsx"], + "parser": "@typescript-eslint/parser", + "extends": [ + "plugin:@typescript-eslint/recommended", + "plugin:jsx-a11y/recommended", + "prettier/@typescript-eslint", + "plugin:prettier/recommended", + "plugin:react/recommended" + ], + "plugins": ["@typescript-eslint", "react", "graphql", "jsx-a11y"], + "rules": { + "object-curly-spacing": ["error", "always"], + "react/prop-types": "off", + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/no-explicit-any": "off" + }, + "parserOptions": { + "ecmaFeatures": { "jsx": true }, + "ecmaVersion": 2018, + "sourceType": "module", + "project": "./tsconfig.json" + } } - }, - "env": { - "browser": true, - "node": true, - "es6": true, - "jest": true - }, - "rules": { - "quotes": ["error", "single"], - "semi": ["error", "never"], - "object-curly-spacing": ["error", "always"], - "prettier/prettier": "error" - }, - "settings": { - "react": { - "version": "16" - } - } + ] } diff --git a/.prettierignore b/.prettierignore index 2667b906..220f5418 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,3 +2,4 @@ node_modules/ .cache/ static/ public/ +coverage/ diff --git a/.prettierrc b/.prettierrc index 49955e2e..338a8b9c 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,6 @@ { "semi": false, "singleQuote": true, - "trailingComma": "none" + "trailingComma": "none", + "tabWidth": 2 } diff --git a/.stylelintrc b/.stylelintrc index ba14b900..350adbfc 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -2,12 +2,12 @@ "extends": [ "stylelint-config-standard", "stylelint-config-css-modules", - "./node_modules/prettier-stylelint/config.js" + "stylelint-prettier/recommended" ], + "plugins": ["stylelint-prettier"], "syntax": "scss", "rules": { - "indentation": 4, - "number-leading-zero": "never", + "prettier/prettier": true, "at-rule-no-unknown": null } } diff --git a/.travis.yml b/.travis.yml index 71b3b94f..b99c7822 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,15 +19,13 @@ before_install: before_script: - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - - "./cc-test-reporter before-build" + - './cc-test-reporter before-build' script: - npm test + - './cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT' - travis_wait 60 npm run build -after_script: - - "./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT" - after_success: - pip install --user awscli - export PATH=$PATH:$HOME/.local/bin @@ -37,8 +35,8 @@ notifications: email: false slack: template: - - "%{branch} *%{result}* build (<%{build_url}|#%{build_number}>) for <%{compare_url}|%{commit}>" - - "Execution time: *%{duration}*" - - "Message: %{message}" + - '%{branch} *%{result}* build (<%{build_url}|#%{build_number}>) for <%{compare_url}|%{commit}>' + - 'Execution time: *%{duration}*' + - 'Message: %{message}' rooms: - - secure: "Ot7Ryl4PW0/TUo4t4Y3J6AbmxqNUtFOI72vNabNX2IdEiU78q+M3esPEkT2I/z0S2Vda9ogRkRbKa5blE2ZEo74/9CUYRXX/syPSZL9tpHDd600wmiObee469Au8dSO48n8G9U+Dm1q60O6oiEGsrrAR6fNE386QEfDhVqKKwBKHk9RcUocUO2b+0WKI7MJk+j5G4+sxv/5ax8prGx0sD6bRoGRuNpyW/MZ9uylBV2WOdmHfEY9D8GYpzVs2JqTB7xr/OL9d+puZPQSdqGfa7xtc+APFiKK//aW/ffOsNzGa4kygC94nfV4oJceMUO3v0bDpB5aXM1YG02EyQzSwpGCbtnbP9Ei/ANcGqiFjPm1/ZVAiwPzT8XZLWkFjy+sOfmF+xmszUCoRiJBVxfL0tx0d1o/JIvgA5m+/iIpro70ep0nBHTiDt2AoxaGGE9GnIT20uVXJJIdXIwTWhVx4HnkptYsFel9l2/oc24S+CnitRaCtGQCiAMNNCESL1AcHCRot/4gm3uuZLdYEA1juHUvgEEH6jG5T2XWaq4uEbDZKdu8y7YMW105FytEsyNU3Tzem4c024EIAhBshSfg5N/iwVeic47E1QAz/5RtfBNLQaEPY4TGJYJvTOaCevjYC7mKlYBEoZmsfT0uNaWqEXUxUwLg5Ih8JoLQKvH6H4fA=" + - secure: 'Ot7Ryl4PW0/TUo4t4Y3J6AbmxqNUtFOI72vNabNX2IdEiU78q+M3esPEkT2I/z0S2Vda9ogRkRbKa5blE2ZEo74/9CUYRXX/syPSZL9tpHDd600wmiObee469Au8dSO48n8G9U+Dm1q60O6oiEGsrrAR6fNE386QEfDhVqKKwBKHk9RcUocUO2b+0WKI7MJk+j5G4+sxv/5ax8prGx0sD6bRoGRuNpyW/MZ9uylBV2WOdmHfEY9D8GYpzVs2JqTB7xr/OL9d+puZPQSdqGfa7xtc+APFiKK//aW/ffOsNzGa4kygC94nfV4oJceMUO3v0bDpB5aXM1YG02EyQzSwpGCbtnbP9Ei/ANcGqiFjPm1/ZVAiwPzT8XZLWkFjy+sOfmF+xmszUCoRiJBVxfL0tx0d1o/JIvgA5m+/iIpro70ep0nBHTiDt2AoxaGGE9GnIT20uVXJJIdXIwTWhVx4HnkptYsFel9l2/oc24S+CnitRaCtGQCiAMNNCESL1AcHCRot/4gm3uuZLdYEA1juHUvgEEH6jG5T2XWaq4uEbDZKdu8y7YMW105FytEsyNU3Tzem4c024EIAhBshSfg5N/iwVeic47E1QAz/5RtfBNLQaEPY4TGJYJvTOaCevjYC7mKlYBEoZmsfT0uNaWqEXUxUwLg5Ih8JoLQKvH6H4fA=' diff --git a/content/posts/2012-07-16-using-kbd-for-fun-and-profit/post-kbd.css b/content/posts/2012-07-16-using-kbd-for-fun-and-profit/post-kbd.css index e507d319..eb1964f7 100644 --- a/content/posts/2012-07-16-using-kbd-for-fun-and-profit/post-kbd.css +++ b/content/posts/2012-07-16-using-kbd-for-fun-and-profit/post-kbd.css @@ -1,88 +1,85 @@ kbd { - font-size: 18px; - color: #444; - font-family: 'Lucida Grande', Lucida, Verdana, sans-serif; - font-weight: normal; - font-style: normal; - text-align: center; - line-height: 1em; - text-shadow: 0 1px 0 #fff; - display: inline; - padding: .3em .55em; - border-radius: 6px; - background-clip: padding-box; - border: 1px solid #bbb; - background-color: #f7f7f7; - background-image: linear-gradient( - to bottom, - rgba(0, 0, 0, .1), - rgba(0, 0, 0, 0) - ); - background-repeat: repeat-x; - box-shadow: 0 2px 0 #bbb, 0 3px 1px #999, 0 3px 0 #bbb, inset 0 1px 1px #fff, - inset 0 -1px 3px #ccc; + font-size: 18px; + color: #444; + font-family: 'Lucida Grande', Lucida, Verdana, sans-serif; + font-weight: normal; + font-style: normal; + text-align: center; + line-height: 1em; + text-shadow: 0 1px 0 #fff; + display: inline; + padding: 0.3em 0.55em; + border-radius: 6px; + background-clip: padding-box; + border: 1px solid #bbb; + background-color: #f7f7f7; + background-image: linear-gradient( + to bottom, + rgba(0, 0, 0, 0.1), + rgba(0, 0, 0, 0) + ); + background-repeat: repeat-x; + box-shadow: 0 2px 0 #bbb, 0 3px 1px #999, 0 3px 0 #bbb, inset 0 1px 1px #fff, + inset 0 -1px 3px #ccc; } kbd.dark { - color: #eee; - text-shadow: 0 -1px 0 #000; - border-color: #000; - background-color: #4d4c4c; - background-image: linear-gradient( - rgba(0, 0, 0, .5), - rgba(0, 0, 0, 0) 80%, - rgba(0, 0, 0, 0) - ); - background-repeat: no-repeat; - box-shadow: 0 2px 0 #000, 0 3px 1px #999, inset 0 1px 1px #aaa, - inset 0 -1px 3px #272727; + color: #eee; + text-shadow: 0 -1px 0 #000; + border-color: #000; + background-color: #4d4c4c; + background-image: linear-gradient( + rgba(0, 0, 0, 0.5), + rgba(0, 0, 0, 0) 80%, + rgba(0, 0, 0, 0) + ); + background-repeat: no-repeat; + box-shadow: 0 2px 0 #000, 0 3px 1px #999, inset 0 1px 1px #aaa, + inset 0 -1px 3px #272727; } kbd.ios { - font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif; - color: #000; - border-color: rgba(0, 0, 0, .6); - border-top-color: rgba(0, 0, 0, .4); - background-color: #b7b7bc; - background-image: linear-gradient(to bottom, #efeff0, #b7b7bc); - background-repeat: repeat-x; - box-shadow: 0 1px 2px rgba(0, 0, 0, .6), 0 2px 3px rgba(0, 0, 0, .1), - inset 0 1px 0 #fff; + font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif; + color: #000; + border-color: rgba(0, 0, 0, 0.6); + border-top-color: rgba(0, 0, 0, 0.4); + background-color: #b7b7bc; + background-image: linear-gradient(to bottom, #efeff0, #b7b7bc); + background-repeat: repeat-x; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 2px 3px rgba(0, 0, 0, 0.1), + inset 0 1px 0 #fff; } kbd.android { - font-family: 'RobotoRegular', 'Helvetica Neue', Helvetica, Arial, sans-serif; - color: #fff; - text-shadow: none; - padding: .3em; - border: 1px solid rgba(0, 0, 0, .05); - border-radius: 3px; - background-clip: padding-box; - background: #5e5e5e; - box-shadow: 0 2px 2px rgba(0, 0, 0, .3), 0 1px 0 #444, - inset 0 1px 0 #868686; + font-family: 'RobotoRegular', 'Helvetica Neue', Helvetica, Arial, sans-serif; + color: #fff; + text-shadow: none; + padding: 0.3em; + border: 1px solid rgba(0, 0, 0, 0.05); + border-radius: 3px; + background-clip: padding-box; + background: #5e5e5e; + box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3), 0 1px 0 #444, inset 0 1px 0 #868686; } kbd.android.dark { - background: #222; - box-shadow: 0 2px 2px rgba(0, 0, 0, .7), 0 1px 0 #444, - inset 0 1px 0 #505050; + background: #222; + box-shadow: 0 2px 2px rgba(0, 0, 0, 0.7), 0 1px 0 #444, inset 0 1px 0 #505050; } kbd.android.color { - background: #083c5b; - box-shadow: 0 2px 2px rgba(0, 0, 0, .7), 0 1px 0 #444, - inset 0 1px 0 #36647b; + background: #083c5b; + box-shadow: 0 2px 2px rgba(0, 0, 0, 0.7), 0 1px 0 #444, inset 0 1px 0 #36647b; } @font-face { - font-family: 'RobotoRegular'; - src: url('/media/Roboto-Regular-webfont.eot'); - src: url('/media/Roboto-Regular-webfont.eot?#iefix') - format('embedded-opentype'), - url('/media/Roboto-Regular-webfont.woff') format('woff'), - url('/media/Roboto-Regular-webfont.ttf') format('truetype'), - url('/media/Roboto-Regular-webfont.svg#RobotoRegular') format('svg'); - font-weight: normal; - font-style: normal; + font-family: 'RobotoRegular'; + src: url('/media/Roboto-Regular-webfont.eot'); + src: url('/media/Roboto-Regular-webfont.eot?#iefix') + format('embedded-opentype'), + url('/media/Roboto-Regular-webfont.woff') format('woff'), + url('/media/Roboto-Regular-webfont.ttf') format('truetype'), + url('/media/Roboto-Regular-webfont.svg#RobotoRegular') format('svg'); + font-weight: normal; + font-style: normal; } diff --git a/gatsby-config.js b/gatsby-config.js index b77688ad..d979253d 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -212,6 +212,7 @@ module.exports = { 'gatsby-plugin-catch-links', 'gatsby-redirect-from', 'gatsby-plugin-meta-redirect', - 'gatsby-plugin-offline' + 'gatsby-plugin-offline', + 'gatsby-plugin-typescript' ] } diff --git a/gatsby/createMarkdownFields.js b/gatsby/createMarkdownFields.js index 561d01b1..cec54da9 100644 --- a/gatsby/createMarkdownFields.js +++ b/gatsby/createMarkdownFields.js @@ -2,13 +2,7 @@ const path = require('path') const { createFilePath } = require('gatsby-source-filesystem') const { repoContentPath } = require('../config') -// Create slug, date & github file link for posts from file path values -exports.createMarkdownFields = (node, createNodeField, getNode) => { - const fileNode = getNode(node.parent) - const parsedFilePath = path.parse(fileNode.relativePath) - const slugOriginal = createFilePath({ node, getNode }) - - // slug +function createSlug(node, createNodeField, slugOriginal, parsedFilePath) { let slug if (parsedFilePath.name === 'index') { @@ -22,8 +16,9 @@ exports.createMarkdownFields = (node, createNodeField, getNode) => { name: 'slug', value: slug }) +} - // date +function createDate(node, createNodeField, slugOriginal) { // grab date from file path let date = new Date(slugOriginal.substring(1, 11)).toISOString() // grab date from file path @@ -36,6 +31,16 @@ exports.createMarkdownFields = (node, createNodeField, getNode) => { name: 'date', value: date }) +} + +// Create slug, date & github file link for posts from file path values +exports.createMarkdownFields = (node, createNodeField, getNode) => { + const fileNode = getNode(node.parent) + const parsedFilePath = path.parse(fileNode.relativePath) + const slugOriginal = createFilePath({ node, getNode }) + + createSlug(node, createNodeField, slugOriginal, parsedFilePath) + createDate(node, createNodeField, slugOriginal) // github file link const type = fileNode.sourceInstanceName diff --git a/gatsby/createPages.js b/gatsby/createPages.js index 9d38296b..d1567926 100644 --- a/gatsby/createPages.js +++ b/gatsby/createPages.js @@ -1,5 +1,5 @@ const path = require('path') -const postsTemplate = path.resolve('src/templates/Posts.jsx') +const postsTemplate = path.resolve('src/templates/Posts.tsx') const redirects = [ { f: '/feed', t: '/feed.xml' }, @@ -7,7 +7,7 @@ const redirects = [ ] exports.generatePostPages = (createPage, posts, numPages) => { - const postTemplate = path.resolve('src/templates/Post.jsx') + const postTemplate = path.resolve('src/templates/Post.tsx') // Create Post pages posts.forEach(post => { diff --git a/jest.config.js b/jest.config.js index 4c3eabea..ec1c65f2 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,6 +1,6 @@ module.exports = { transform: { - '^.+\\.jsx?$': '/jest/jest-preprocess.js' + '^.+\\.tsx?$': '/jest/jest-preprocess.js' }, moduleNameMapper: { '.+\\.(css|styl|less|sass|scss)$': 'identity-obj-proxy', @@ -15,5 +15,6 @@ module.exports = { }, testURL: 'http://localhost', setupFiles: ['/jest/loadershim.js'], - setupFilesAfterEnv: ['/jest/setup-test-env.js'] + setupFilesAfterEnv: ['/jest/setup-test-env.js'], + collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/@types/**/*'] } diff --git a/jest/jest-preprocess.js b/jest/jest-preprocess.js index 95114e53..c53f5172 100644 --- a/jest/jest-preprocess.js +++ b/jest/jest-preprocess.js @@ -1,5 +1,7 @@ +const { createTransformer } = require('babel-jest') + const babelOptions = { - presets: ['babel-preset-gatsby'] + presets: ['babel-preset-gatsby', '@babel/preset-typescript'] } -module.exports = require('babel-jest').createTransformer(babelOptions) +module.exports = createTransformer(babelOptions) diff --git a/jest/setup-test-env.js b/jest/setup-test-env.js index 264828a9..5df3c44b 100644 --- a/jest/setup-test-env.js +++ b/jest/setup-test-env.js @@ -1 +1 @@ -import '@testing-library/jest-dom/extend-expect' +require('@testing-library/jest-dom/extend-expect') diff --git a/jest/testRender.js b/jest/testRender.ts similarity index 71% rename from jest/testRender.js rename to jest/testRender.ts index fe5a21fe..ad7c7a71 100644 --- a/jest/testRender.js +++ b/jest/testRender.ts @@ -1,6 +1,7 @@ import { render } from '@testing-library/react' +import { ReactElement } from 'react' -const testRender = component => { +const testRender = (component: ReactElement) => { it('renders without crashing', () => { const { container } = render(component) diff --git a/package.json b/package.json index 85d9b7aa..adbd13f7 100644 --- a/package.json +++ b/package.json @@ -10,17 +10,15 @@ "start": "gatsby develop", "build": "gatsby build && npm run copy", "ssr": "npm run build && serve -s public/", - "rename:scrypt": "sed -i -e 's|./build/Release/scrypt|scrypt|g' node_modules/scrypt/index.js", - "copy": "cp -R content/media/ public", - "format": "run-p 'prettier -- --write' format:css", - "format:css": "prettier-stylelint --write --quiet 'src/**/*.{css,scss}'", - "lint": "run-p --continue-on-error lint:js lint:css lint:md", - "lint:js": "eslint --ignore-path .gitignore --ignore-path .prettierignore --ext .js,.jsx .", - "lint:css": "prettier-stylelint --quiet 'src/**/*.{css,scss}'", - "lint:md": "markdownlint './**/*.{md,markdown}' --ignore './{node_modules,public,.cache,.git}/**/*'", - "prettier": "prettier '**/*.{js,jsx,yml,yaml,md}'", "test": "npm run lint && jest --coverage", "test:watch": "npm run lint && jest --coverage --watch", + "rename:scrypt": "sed -i -e 's|./build/Release/scrypt|scrypt|g' node_modules/scrypt/index.js", + "copy": "cp -R content/media/ public", + "lint": "run-p --continue-on-error lint:js lint:css lint:md", + "lint:js": "eslint --ignore-path .gitignore --ignore-path .prettierignore --ext .js,.jsx,.ts,.tsx .", + "lint:css": "stylelint 'src/**/*.{css,scss}'", + "lint:md": "markdownlint './**/*.{md,markdown}' --ignore './{node_modules,public,.cache,.git,coverage}/**/*'", + "format": "npm run lint:js -- --fix && npm run lint:css -- --fix", "deploy": "./scripts/deploy.sh", "new": "babel-node ./scripts/new.js" }, @@ -31,41 +29,42 @@ "dms2dec": "^1.1.0", "fast-exif": "^1.0.1", "fraction.js": "^4.0.12", - "gatsby": "^2.15.18", - "gatsby-image": "^2.2.19", - "gatsby-plugin-catch-links": "^2.1.8", - "gatsby-plugin-feed": "^2.3.11", + "gatsby": "^2.15.28", + "gatsby-image": "^2.2.23", + "gatsby-plugin-catch-links": "^2.1.12", + "gatsby-plugin-feed": "^2.3.15", "gatsby-plugin-lunr": "^1.5.2", - "gatsby-plugin-manifest": "^2.2.17", + "gatsby-plugin-manifest": "^2.2.20", "gatsby-plugin-matomo": "^0.7.2", "gatsby-plugin-meta-redirect": "^1.1.1", "gatsby-plugin-offline": "^2.2.10", - "gatsby-plugin-react-helmet": "^3.1.6", - "gatsby-plugin-sass": "^2.1.13", - "gatsby-plugin-sharp": "^2.2.24", - "gatsby-plugin-sitemap": "^2.2.13", + "gatsby-plugin-react-helmet": "^3.1.10", + "gatsby-plugin-sass": "^2.1.17", + "gatsby-plugin-sharp": "^2.2.27", + "gatsby-plugin-sitemap": "^2.2.16", "gatsby-plugin-svgr": "^2.0.2", + "gatsby-plugin-typescript": "^2.1.11", "gatsby-plugin-webpack-size": "^1.0.0", "gatsby-redirect-from": "^0.2.1", - "gatsby-remark-autolink-headers": "^2.1.9", - "gatsby-remark-copy-linked-files": "^2.1.17", - "gatsby-remark-images": "^3.1.22", - "gatsby-remark-smartypants": "^2.1.7", + "gatsby-remark-autolink-headers": "^2.1.13", + "gatsby-remark-copy-linked-files": "^2.1.23", + "gatsby-remark-images": "^3.1.25", + "gatsby-remark-smartypants": "^2.1.11", "gatsby-remark-vscode": "^1.2.0", - "gatsby-source-filesystem": "^2.1.24", - "gatsby-source-graphql": "^2.1.12", - "gatsby-transformer-remark": "^2.6.23", - "gatsby-transformer-sharp": "^2.2.15", - "graphql": "^14.5.6", + "gatsby-source-filesystem": "^2.1.28", + "gatsby-source-graphql": "^2.1.17", + "gatsby-transformer-remark": "^2.6.26", + "gatsby-transformer-sharp": "^2.2.19", + "graphql": "^14.5.8", "intersection-observer": "^0.7.0", "js-scrypt": "^0.2.0", "load-script": "^1.0.0", "pigeon-maps": "^0.14.0", "pigeon-marker": "^0.3.4", - "react": "^16.9.0", + "react": "^16.10.1", "react-blockies": "^1.4.1", "react-clipboard.js": "^2.0.13", - "react-dom": "^16.9.0", + "react-dom": "^16.10.1", "react-helmet": "^5.2.1", "react-modal": "^3.10.1", "react-pose": "^4.0.8", @@ -78,20 +77,31 @@ "web3": "^1.2.1" }, "devDependencies": { - "@babel/node": "^7.6.0", - "@babel/preset-env": "^7.6.0", - "@svgr/webpack": "^4.3.1", + "@babel/node": "^7.6.2", + "@babel/preset-env": "^7.6.2", + "@babel/preset-typescript": "^7.6.0", + "@svgr/webpack": "^4.3.3", "@testing-library/jest-dom": "^4.1.0", - "@testing-library/react": "^9.1.4", + "@testing-library/react": "^9.2.0", + "@types/jest": "^24.0.18", + "@types/node": "^12.7.8", + "@types/react": "^16.9.4", + "@types/react-dom": "^16.9.1", + "@types/react-helmet": "^5.0.11", + "@types/react-modal": "^3.8.3", + "@types/react-transition-group": "^4.2.2", + "@types/web3": "^1.0.20", + "@typescript-eslint/eslint-plugin": "^2.3.2", + "@typescript-eslint/parser": "^2.3.2", "babel-eslint": "^10.0.3", "babel-jest": "^24.9.0", - "eslint": "^6.4.0", - "eslint-config-prettier": "^6.2.0", - "eslint-loader": "^3.0.0", - "eslint-plugin-graphql": "^3.0.3", + "eslint": "^6.5.1", + "eslint-config-prettier": "^6.3.0", + "eslint-loader": "^3.0.2", + "eslint-plugin-graphql": "^3.1.0", "eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-prettier": "^3.1.1", - "eslint-plugin-react": "^7.14.3", + "eslint-plugin-react": "^7.15.0", "fs-extra": "^8.1.0", "identity-obj-proxy": "^3.0.0", "jest": "^24.9.0", @@ -104,8 +114,10 @@ "prettier-stylelint": "^0.4.2", "stylelint": "^11.0.0", "stylelint-config-css-modules": "^1.5.0", + "stylelint-config-prettier": "^6.0.0", "stylelint-config-standard": "^19.0.0", - "stylelint-scss": "^3.11.0", + "stylelint-prettier": "^1.1.1", + "typescript": "^3.6.3", "why-did-you-update": "^1.0.6" }, "engines": { diff --git a/src/@types/declarations.d.ts b/src/@types/declarations.d.ts new file mode 100644 index 00000000..31eab8bc --- /dev/null +++ b/src/@types/declarations.d.ts @@ -0,0 +1,13 @@ +declare module '*.scss' { + const content: { [className: string]: string } + export = content +} + +/* eslint-disable-next-line @typescript-eslint/no-empty-interface */ +interface SvgrComponent + extends React.StatelessComponent> {} + +declare module '*.svg' { + const value: SvgrComponent + export default value +} diff --git a/src/@types/pigeon-maps.d.ts b/src/@types/pigeon-maps.d.ts new file mode 100644 index 00000000..dd469466 --- /dev/null +++ b/src/@types/pigeon-maps.d.ts @@ -0,0 +1 @@ +declare module 'pigeon-maps' diff --git a/src/@types/pigeon-marker.d.ts b/src/@types/pigeon-marker.d.ts new file mode 100644 index 00000000..77862d53 --- /dev/null +++ b/src/@types/pigeon-marker.d.ts @@ -0,0 +1 @@ +declare module 'pigeon-marker' diff --git a/src/@types/react-blockies.d.ts b/src/@types/react-blockies.d.ts new file mode 100644 index 00000000..04fd4afe --- /dev/null +++ b/src/@types/react-blockies.d.ts @@ -0,0 +1 @@ +declare module 'react-blockies' diff --git a/src/@types/react-time.d.ts b/src/@types/react-time.d.ts new file mode 100644 index 00000000..3681ee34 --- /dev/null +++ b/src/@types/react-time.d.ts @@ -0,0 +1 @@ +declare module 'react-time' diff --git a/src/@types/remark-react.d.ts b/src/@types/remark-react.d.ts new file mode 100644 index 00000000..63b20dd7 --- /dev/null +++ b/src/@types/remark-react.d.ts @@ -0,0 +1 @@ +declare module 'remark-react' diff --git a/src/components/Layout.jsx b/src/components/Layout.jsx deleted file mode 100644 index 09f1a4fa..00000000 --- a/src/components/Layout.jsx +++ /dev/null @@ -1,33 +0,0 @@ -import React from 'react' -import PropTypes from 'prop-types' -import Container from './atoms/Container' -import Typekit from './atoms/Typekit' -import Header from './organisms/Header' -import Footer from './organisms/Footer' -import styles from './Layout.module.scss' - -// if (process.env.NODE_ENV !== 'production') { -// const { whyDidYouUpdate } = require('why-did-you-update') -// whyDidYouUpdate(React) -// } - -const Layout = ({ children }) => ( - <> - -
- -
-
- {children} -
-
- -