From f5b68672eb42b0de9e3de49db2472d2658df1c0b Mon Sep 17 00:00:00 2001 From: Timothy Date: Tue, 12 Jan 2021 23:35:36 +0800 Subject: [PATCH] lint and format --- .eslintignore | 1 + .eslintrc.js | 41 + components/Footer.js | 6 +- components/LayoutWrapper.js | 10 +- components/Link.js | 1 + components/MobileNav.js | 8 +- components/PageTitle.js | 2 +- components/SectionContainer.js | 2 +- components/Tag.js | 2 +- components/ThemeSwitch.js | 2 +- components/social-icons/index.js | 2 +- css/tailwind.css | 2 +- data/blog/code-sample.md | 10 +- jsconfig.json | 2 +- layouts/ListLayout.js | 12 +- layouts/PostLayout.js | 18 +- package-lock.json | 1607 ++++++++++++++++++++++- package.json | 21 + pages/404.js | 12 +- pages/_document.js | 2 +- pages/about.js | 11 +- pages/index.js | 12 +- pages/tags.js | 8 +- public/static/favicons/site.webmanifest | 24 +- 24 files changed, 1740 insertions(+), 78 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +node_modules diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..c8edd2b --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,41 @@ +module.exports = { + root: true, + parserOptions: { + ecmaVersion: 2020, + sourceType: 'module', + ecmaFeatures: { + jsx: true, + }, + }, + settings: { + react: { + version: 'detect', + }, + }, + env: { + browser: true, + amd: true, + node: true, + }, + extends: [ + 'eslint:recommended', + 'plugin:react/recommended', + 'plugin:jsx-a11y/recommended', + 'plugin:prettier/recommended', + ], + rules: { + 'prettier/prettier': 'error', + 'react/react-in-jsx-scope': 'off', + 'jsx-a11y/anchor-is-valid': [ + 'error', + { + components: ['Link'], + specialLink: ['hrefLeft', 'hrefRight'], + aspects: ['invalidHref', 'preferButton'], + }, + ], + 'react/prop-types': 0, + 'no-unused-vars': 0, + 'react/no-unescaped-entities': 0, + }, +} diff --git a/components/Footer.js b/components/Footer.js index 8a8468e..0b51f4f 100644 --- a/components/Footer.js +++ b/components/Footer.js @@ -5,7 +5,7 @@ import SocialIcon from '@/components/social-icons' export default function Footer() { return (