diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 0213154..0000000 --- a/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -dist -examples/**/* -lib -docs -website -__tests__ -coverage diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index d69ea17..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "parser": "@typescript-eslint/parser", - "parserOptions": { - "useJSXTextNode": true, - "ecmaVersion": 6, - "sourceType": "module", - "ecmaFeatures": { - "modules": true, - "jsx": true - } - }, - "extends": [ - "plugin:@typescript-eslint/recommended", - "plugin:react/recommended", - "prettier", - "prettier/@typescript-eslint" - ], - "rules": { - "@typescript-eslint/ban-ts-ignore": "off", - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/member-ordering": "off", - "@typescript-eslint/explicit-member-accessibility": "off", - "@typescript-eslint/no-object-literal-type-assertion": "off", - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/interface-name-prefix": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/array-type": "off", - "react/prop-types": "off", - "react/no-children-prop": "off", - "sort-keys": "off", - "no-console": ["error", { "allow": ["warn", "error"] }], - "prefer-arrow/prefer-arrow-functions": "off" - }, - "settings": { - "react": { - "version": "detect" - } - } -} diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..a5a29d9 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +pnpm lint-staged diff --git a/package.json b/package.json index a091131..94bf720 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "test": "jest", "test:watch": "cross-env NODE_ENV=test pnpm test -- --watch", "prepublishOnly": "pnpm test && pnpm lint && pnpm build", - "lint": "eslint . --ext .ts,.tsx" + "prepare": "husky install" }, "repository": { "type": "git", @@ -66,29 +66,24 @@ "@testing-library/react": "^14.0.0", "@types/jest": "24.0.23", "@types/node": "^18.16.1", - "@types/react": "16.9.16", - "@types/react-dom": "16.9.4", - "@typescript-eslint/eslint-plugin": "2.11.0", - "@typescript-eslint/parser": "2.11.0", + "@types/react": "^18.0.0", + "@types/react-dom": "^18.0.0", "codecov": "3.7.1", - "cross-env": "^7.0.2", + "cross-env": "^7.0.3", "dotenv": "^16.0.3", - "eslint": "6.7.2", - "eslint-config-prettier": "6.7.0", - "eslint-plugin-react": "7.17.0", - "husky": "3.1.0", + "husky": "^8.0.3", "jest": "^26.6.3", "jest-cli": "^26.6.3", - "lint-staged": "9.5.0", - "microbundle": "0.12.4", + "lint-staged": "^13.2.0", + "microbundle": "0.15.1", "preact": "^10.13.2", - "prettier": "^2.0.2", + "prettier": "^2.8.0", "react": "^18.0.0", "react-dom": "^18.0.0", - "rimraf": "^3.0.2", + "rimraf": "^5.0.0", "ts-jest": "^26.4.4", - "tslib": "^1.11.1", - "typescript": "^3.8.3" + "tslib": "^2.5.0", + "typescript": "^4.0.0" }, "peerDependencies": { "react": ">= 16.8.0" @@ -101,15 +96,11 @@ }, "prettier": { "singleQuote": true, + "arrowParens": "avoid", "trailingComma": "es5" }, "lint-staged": { - "*.{json,md}": [ - "prettier --write", - "git add" - ], - "*.{ts,tsx}": [ - "eslint --fix", + "*.{json,md,ts,tsx}": [ "prettier --write", "git add" ] diff --git a/packages/gatsby-plugin-hoofd/CHANGELOG.md b/packages/gatsby-plugin-hoofd/CHANGELOG.md deleted file mode 100644 index f52d67f..0000000 --- a/packages/gatsby-plugin-hoofd/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -# 0.1.1 - -Fix syntax error - -# 0.1.0 - -Initial release diff --git a/packages/gatsby-plugin-hoofd/README.md b/packages/gatsby-plugin-hoofd/README.md deleted file mode 100644 index 664c9f1..0000000 --- a/packages/gatsby-plugin-hoofd/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# gatsby-plugin-hoofd - -A [Gatsby](https://github.com/gatsbyjs/gatsby) plugin for [hoofd](https://github.com/JoviDeCroock/hoofd) with ssr-support. - -## Install - -```sh -npm i --save hoofd gatsby-plugin-hoofd -## OR -yarn add hoofd gatsby-plugin-hoofd -``` - -## How to use - -Edit `gatsby-config.js` - -```js -module.exports = { - plugins: [`gatsby-plugin-hoofd`], -}; -``` diff --git a/packages/gatsby-plugin-hoofd/gatsby-ssr.js b/packages/gatsby-plugin-hoofd/gatsby-ssr.js deleted file mode 100644 index 9b64148..0000000 --- a/packages/gatsby-plugin-hoofd/gatsby-ssr.js +++ /dev/null @@ -1,26 +0,0 @@ -import React, { createElement } from 'react'; -import { toStatic } from 'hoofd'; - -export const onRenderBody = ({ setHeadComponents, setHtmlAttributes }) => { - const { title, metas, lang, links, scripts } = toStatic(); - - if (lang) { - setHtmlAttributes({ lang }); - } - - setHeadComponents( - [ - title && createElement('title', null, title), - ...metas.map((meta) => createElement('meta', meta, null)), - ...links.map((link) => createElement('link', link, null)), - ...scripts.map(({ module, text, type, ...script }) => ( -