diff --git a/.eslintrc.js b/.eslintrc.js index 6751b75..c70ab37 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -12,8 +12,6 @@ module.exports = { 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', 'prettier', - 'prettier/@typescript-eslint', - 'prettier/react', ], ignorePatterns: ['.eslintrc.js'], rules: { diff --git a/package.json b/package.json index 86cf4d7..dfdcf18 100644 --- a/package.json +++ b/package.json @@ -39,8 +39,8 @@ "@typescript-eslint/eslint-plugin": "^4.15.2", "@typescript-eslint/parser": "^4.15.2", "eslint": "^7.0.0", - "eslint-config-airbnb-typescript": "^8.0.2", - "eslint-config-prettier": "^6.11.0", + "eslint-config-airbnb-typescript": "^12.3.1", + "eslint-config-prettier": "^8.0.0", "eslint-plugin-import": "^2.20.2", "eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-react": "^7.19.0", diff --git a/packages/interpolate/package.json b/packages/interpolate/package.json index a67abc4..a8172e5 100644 --- a/packages/interpolate/package.json +++ b/packages/interpolate/package.json @@ -28,9 +28,7 @@ }, "dependencies": { "@gumption-ui/utils": "0.0.1", + "csstype": "^3.0.6", "otion": "^0.3.2" - }, - "devDependencies": { - "csstype": "^3.0.6" } } diff --git a/packages/interpolate/src/interpolate.ts b/packages/interpolate/src/interpolate.ts index 4956016..1f4c345 100644 --- a/packages/interpolate/src/interpolate.ts +++ b/packages/interpolate/src/interpolate.ts @@ -1,6 +1,6 @@ import * as CSS from 'csstype'; import { css as otionCss } from 'otion'; // TODO remove -import { ThemeOrAny } from '@gumption-ui/interpolate/theme'; +import type { ThemeOrAny } from '@gumption-ui/interpolate/theme'; import { get, isFunction, diff --git a/packages/interpolate/src/types.ts b/packages/interpolate/src/types.ts index edd57e0..694c9d8 100644 --- a/packages/interpolate/src/types.ts +++ b/packages/interpolate/src/types.ts @@ -1,5 +1,5 @@ import * as CSS from 'csstype'; -import { ThemeOrAny } from '@gumption-ui/interpolate/theme'; +import type { ThemeOrAny } from '@gumption-ui/interpolate/theme'; export type CSSProperties = CSS.Properties; diff --git a/packages/jsx/src/index.ts b/packages/jsx/src/index.ts index 06230b8..53edb09 100644 --- a/packages/jsx/src/index.ts +++ b/packages/jsx/src/index.ts @@ -5,8 +5,6 @@ export const jsx = ( type: T, props: Record, ...children: React.ReactNode[] -): JSX.Element => { - return React.createElement(type, props, ...children); -}; +): JSX.Element => React.createElement(type, props, ...children); // export const Fragment = React.Fragment; diff --git a/packages/quark/src/Slots.tsx b/packages/quark/src/Slots.tsx index 7cf84d1..cee03b8 100644 --- a/packages/quark/src/Slots.tsx +++ b/packages/quark/src/Slots.tsx @@ -49,19 +49,22 @@ export function SlotProvider({ }) { // parentSlots is always the memoized `value`, therefore won't trigger unnecessary re-renders. const parentSlots = React.useContext(SlotContext) || {}; // eslint-disable-line react-hooks/exhaustive-deps - const value = React.useMemo(() => { - return Object.keys(parentSlots) - .concat(Object.keys(slots)) - .reduce((accumulator, current) => { - return { - ...accumulator, - [current]: mergeProps( - parentSlots[current] || {}, - slots[current] || {}, - ), - }; - }, {}); - }, [parentSlots, slots]); + const value = React.useMemo( + () => + Object.keys(parentSlots) + .concat(Object.keys(slots)) + .reduce( + (accumulator, current) => ({ + ...accumulator, + [current]: mergeProps( + parentSlots[current] || {}, + slots[current] || {}, + ), + }), + {}, + ), + [parentSlots, slots], + ); return {children}; } diff --git a/playground/src/examples/scratchpad/jsx-pragma.tsx b/playground/src/examples/scratchpad/jsx-pragma.tsx index 2d3773a..4ef5749 100644 --- a/playground/src/examples/scratchpad/jsx-pragma.tsx +++ b/playground/src/examples/scratchpad/jsx-pragma.tsx @@ -9,20 +9,18 @@ import { quark } from '@gumption-ui/quark'; const Quark = quark('div'); -export const WithPragma = () => { - return ( - -
- ein div ein span in einem div -
- -
- with pragma and a quark -
-
+export const WithPragma = () => ( + +
+ ein div ein span in einem div +
+
with pragma and a quark
-
- ); -}; + +
+ with pragma and a quark +
+
+); diff --git a/yarn.lock b/yarn.lock index c8abcd2..85d2d4a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -775,11 +775,6 @@ dependencies: "@babel/types" "^7.3.0" -"@types/eslint-visitor-keys@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" - integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== - "@types/glob@^7.1.1": version "7.1.3" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183" @@ -951,17 +946,6 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@3.10.1": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.1.tgz#e179ffc81a80ebcae2ea04e0332f8b251345a686" - integrity sha512-DewqIgscDzmAfd5nOGe4zm6Bl7PKtMG2Ad0KG8CUZAHlXfAKTF9Ol5PXhiMh39yRL2ChRH1cuuUGOcVyyrhQIw== - dependencies: - "@types/json-schema" "^7.0.3" - "@typescript-eslint/types" "3.10.1" - "@typescript-eslint/typescript-estree" "3.10.1" - eslint-scope "^5.0.0" - eslint-utils "^2.0.0" - "@typescript-eslint/experimental-utils@4.15.2": version "4.15.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.15.2.tgz#5efd12355bd5b535e1831282e6cf465b9a71cf36" @@ -974,18 +958,7 @@ eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/parser@^3.1.0": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.10.1.tgz#1883858e83e8b442627e1ac6f408925211155467" - integrity sha512-Ug1RcWcrJP02hmtaXVS3axPPTTPnZjupqhgj+NnZ6BCkwSImWk/283347+x9wN+lqOdK9Eo3vsyiyDHgsmiEJw== - dependencies: - "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "3.10.1" - "@typescript-eslint/types" "3.10.1" - "@typescript-eslint/typescript-estree" "3.10.1" - eslint-visitor-keys "^1.1.0" - -"@typescript-eslint/parser@^4.15.2": +"@typescript-eslint/parser@^4.15.2", "@typescript-eslint/parser@^4.4.1": version "4.15.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.15.2.tgz#c804474321ef76a3955aec03664808f0d6e7872e" integrity sha512-SHeF8xbsC6z2FKXsaTb1tBCf0QZsjJ94H6Bo51Y1aVEZ4XAefaw5ZAilMoDPlGghe+qtq7XdTiDlGfVTOmvA+Q== @@ -1003,30 +976,11 @@ "@typescript-eslint/types" "4.15.2" "@typescript-eslint/visitor-keys" "4.15.2" -"@typescript-eslint/types@3.10.1": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.10.1.tgz#1d7463fa7c32d8a23ab508a803ca2fe26e758727" - integrity sha512-+3+FCUJIahE9q0lDi1WleYzjCwJs5hIsbugIgnbB+dSCYUxl8L6PwmsyOPFZde2hc1DlTo/xnkOgiTLSyAbHiQ== - "@typescript-eslint/types@4.15.2": version "4.15.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.15.2.tgz#04acf3a2dc8001a88985291744241e732ef22c60" integrity sha512-r7lW7HFkAarfUylJ2tKndyO9njwSyoy6cpfDKWPX6/ctZA+QyaYscAHXVAfJqtnY6aaTwDYrOhp+ginlbc7HfQ== -"@typescript-eslint/typescript-estree@3.10.1": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.10.1.tgz#fd0061cc38add4fad45136d654408569f365b853" - integrity sha512-QbcXOuq6WYvnB3XPsZpIwztBoquEYLXh2MtwVU+kO8jgYCiv4G5xrSP/1wg4tkvrEE+esZVquIPX/dxPlePk1w== - dependencies: - "@typescript-eslint/types" "3.10.1" - "@typescript-eslint/visitor-keys" "3.10.1" - debug "^4.1.1" - glob "^7.1.6" - is-glob "^4.0.1" - lodash "^4.17.15" - semver "^7.3.2" - tsutils "^3.17.1" - "@typescript-eslint/typescript-estree@4.15.2": version "4.15.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.15.2.tgz#c2f7a1e94f3428d229d5ecff3ead6581ee9b62fa" @@ -1040,13 +994,6 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/visitor-keys@3.10.1": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.10.1.tgz#cd4274773e3eb63b2e870ac602274487ecd1e931" - integrity sha512-9JgC82AaQeglebjZMgYR5wgmfUdUc+EitGUUMW8u2nDckaeimzW+VsoLV6FoimPv2id3VQzfjwBxEMVz08ameQ== - dependencies: - eslint-visitor-keys "^1.1.0" - "@typescript-eslint/visitor-keys@4.15.2": version "4.15.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.15.2.tgz#3d1c7979ce75bf6acf9691109bd0d6b5706192b9" @@ -2210,7 +2157,7 @@ escodegen@^1.14.1: optionalDependencies: source-map "~0.6.1" -eslint-config-airbnb-base@^14.1.0, eslint-config-airbnb-base@^14.2.1: +eslint-config-airbnb-base@^14.2.0, eslint-config-airbnb-base@^14.2.1: version "14.2.1" resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz#8a2eb38455dc5a312550193b319cdaeef042cd1e" integrity sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA== @@ -2219,16 +2166,16 @@ eslint-config-airbnb-base@^14.1.0, eslint-config-airbnb-base@^14.2.1: object.assign "^4.1.2" object.entries "^1.1.2" -eslint-config-airbnb-typescript@^8.0.2: - version "8.0.2" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-8.0.2.tgz#465b17b0b1facdcca4fe23a5426bc27ab7b2b2f2" - integrity sha512-TCOftyCoIogJzzLGSg0Qlxd27qvf+1a3MHyN/PqynTqINS4iFy+SlXy/CrAN+6xkleGMSrvmPbm3pyFEku2+IQ== +eslint-config-airbnb-typescript@^12.3.1: + version "12.3.1" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-12.3.1.tgz#83ab40d76402c208eb08516260d1d6fac8f8acbc" + integrity sha512-ql/Pe6/hppYuRp4m3iPaHJqkBB7dgeEmGPQ6X0UNmrQOfTF+dXw29/ZjU2kQ6RDoLxaxOA+Xqv07Vbef6oVTWw== dependencies: - "@typescript-eslint/parser" "^3.1.0" - eslint-config-airbnb "^18.1.0" - eslint-config-airbnb-base "^14.1.0" + "@typescript-eslint/parser" "^4.4.1" + eslint-config-airbnb "^18.2.0" + eslint-config-airbnb-base "^14.2.0" -eslint-config-airbnb@^18.1.0: +eslint-config-airbnb@^18.2.0: version "18.2.1" resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-18.2.1.tgz#b7fe2b42f9f8173e825b73c8014b592e449c98d9" integrity sha512-glZNDEZ36VdlZWoxn/bUR1r/sdFKPd1mHPbqUtkctgNG4yT2DLLtJ3D+yCV+jzZCc2V1nBVkmdknOJBZ5Hc0fg== @@ -2237,12 +2184,10 @@ eslint-config-airbnb@^18.1.0: object.assign "^4.1.2" object.entries "^1.1.2" -eslint-config-prettier@^6.11.0: - version "6.15.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz#7f93f6cb7d45a92f1537a70ecc06366e1ac6fed9" - integrity sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw== - dependencies: - get-stdin "^6.0.0" +eslint-config-prettier@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.0.0.tgz#024d661444319686c588c8849c8da33815dbdb1c" + integrity sha512-5EaAVPsIHu+grmm5WKjxUia4yHgRrbkd8I0ffqUSwixCPMVBrbS97UnzlEY/Q7OWo584vgixefM0kJnUfo/VjA== eslint-import-resolver-node@^0.3.4: version "0.3.4" @@ -2739,11 +2684,6 @@ get-stdin@8.0.0: resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53" integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg== -get-stdin@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" - integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== - get-stream@^4.0.0, get-stream@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -2793,7 +2733,7 @@ glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0: dependencies: is-glob "^4.0.1" -glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: +glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==