Skip to content

Commit

Permalink
chore(deps): update eslint related packages
Browse files Browse the repository at this point in the history
During this process i encountered an issue about conflicts between
eslint core rules and typescript-eslint rules. For this to work the
extension rules from typescript-eslint must be turned off in eslint
core (TIL).
typescript-eslint/typescript-eslint#2540
  • Loading branch information
Samuel Hobl committed Feb 23, 2021
1 parent 96fa28f commit 2254984
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 18 deletions.
7 changes: 5 additions & 2 deletions .eslintrc.js
Expand Up @@ -22,9 +22,12 @@ module.exports = {

// Custom preferences
'import/prefer-default-export': 'off',
'no-use-before-define': ['error', { functions: false }],
'no-underscore-dangle': ['error', { allow: ['_css'] }],

// adjustments for ts extension rules
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],

'no-underscore-dangle': ['error', { allow: ['_css'] }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/naming-convention': 'off',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -36,8 +36,8 @@
"@commitlint/config-conventional": "^11.0.0",
"@types/jest": "^25.2.3",
"@types/react-test-renderer": "^17.0.0",
"@typescript-eslint/eslint-plugin": "^3.4.0",
"@typescript-eslint/parser": "^3.4.0",
"@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",
Expand Down
5 changes: 3 additions & 2 deletions packages/interpolate/src/interpolate.ts
Expand Up @@ -4,7 +4,8 @@ import { ThemeOrAny } from '@gumption-ui/interpolate/theme';
import {
get,
isFunction,
FirstParameters,
FirstParameter,
ParameterTypes,
LiteralUnion,
ValueOf,
ResponsiveStyleValue,
Expand All @@ -13,7 +14,7 @@ import { Shorthands, Aliases, Matchers, CSSProperties } from './types';

export type Theme = Partial<ThemeOrAny>;

type ScopedCSSRules = FirstParameters<typeof otionCss>;
type ScopedCSSRules = FirstParameter<typeof otionCss>;
type ScopedCSSProperties = Omit<CSSProperties, 'all'>;

type ResolveShorthand<T extends Shorthands> = ValueOf<
Expand Down
3 changes: 2 additions & 1 deletion packages/quark/src/Slots.tsx
Expand Up @@ -47,7 +47,8 @@ export function SlotProvider({
slots: Slots;
children: React.ReactNode;
}) {
const parentSlots = React.useContext(SlotContext) || {};
// 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))
Expand Down
2 changes: 1 addition & 1 deletion packages/quark/src/test/index.test.tsx
Expand Up @@ -23,7 +23,7 @@ const theme = {

const customRender = (element: React.ReactElement, options?: RenderOptions) =>
render(element, {
wrapper: ({ children }: { children?: React.ReactNode }) => (
wrapper: ({ children }) => (
<ThemeProvider theme={theme}>{children}</ThemeProvider>
),
...options,
Expand Down
2 changes: 1 addition & 1 deletion packages/quark/src/utils.ts
Expand Up @@ -87,7 +87,7 @@ export const domElements = [
export type DOMElements = UnionStringArray<typeof domElements>;

export function runIfFn<T, U>(
valueOrFn: T | ((...args: U[]) => T),
valueOrFn: T | ((..._args: U[]) => T),
...args: U[]
): T {
return isFunction(valueOrFn) ? valueOrFn(...args) : valueOrFn;
Expand Down
4 changes: 3 additions & 1 deletion packages/utils/src/types.ts
Expand Up @@ -4,7 +4,9 @@ import { LiteralUnion, ValueOf } from 'type-fest';

export type Dict<T = any> = Record<string, T>;

export type FirstParameters<T> = T extends (arg: infer T) => any ? T : never;
export type FirstParameter<F> = F extends (arg: infer T) => any ? T : never;

export type ParameterTypes<F> = F extends (...args: infer A) => any ? A : never;

export type UnionStringArray<T extends Readonly<string[]>> = T[number];

Expand Down
1 change: 1 addition & 0 deletions playground/package.json
Expand Up @@ -21,6 +21,7 @@
},
"dependencies": {
"destyle.css": "^1.0.13",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "^4.0.2"
},
Expand Down
86 changes: 78 additions & 8 deletions yarn.lock
Expand Up @@ -937,14 +937,16 @@
dependencies:
"@types/yargs-parser" "*"

"@typescript-eslint/eslint-plugin@^3.4.0":
version "3.10.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.10.1.tgz#7e061338a1383f59edc204c605899f93dc2e2c8f"
integrity sha512-PQg0emRtzZFWq6PxBcdxRH3QIQiyFO3WCVpRL3fgj5oQS3CDs3AeAKfv4DxNhzn8ITdNJGJ4D3Qw8eAJf3lXeQ==
"@typescript-eslint/eslint-plugin@^4.15.2":
version "4.15.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.15.2.tgz#981b26b4076c62a5a55873fbef3fe98f83360c61"
integrity sha512-uiQQeu9tWl3f1+oK0yoAv9lt/KXO24iafxgQTkIYO/kitruILGx3uH+QtIAHqxFV+yIsdnJH+alel9KuE3J15Q==
dependencies:
"@typescript-eslint/experimental-utils" "3.10.1"
"@typescript-eslint/experimental-utils" "4.15.2"
"@typescript-eslint/scope-manager" "4.15.2"
debug "^4.1.1"
functional-red-black-tree "^1.0.1"
lodash "^4.17.15"
regexpp "^3.0.0"
semver "^7.3.2"
tsutils "^3.17.1"
Expand All @@ -960,7 +962,19 @@
eslint-scope "^5.0.0"
eslint-utils "^2.0.0"

"@typescript-eslint/parser@^3.1.0", "@typescript-eslint/parser@^3.4.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"
integrity sha512-Fxoshw8+R5X3/Vmqwsjc8nRO/7iTysRtDqx6rlfLZ7HbT8TZhPeQqbPjTyk2RheH3L8afumecTQnUc9EeXxohQ==
dependencies:
"@types/json-schema" "^7.0.3"
"@typescript-eslint/scope-manager" "4.15.2"
"@typescript-eslint/types" "4.15.2"
"@typescript-eslint/typescript-estree" "4.15.2"
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==
Expand All @@ -971,11 +985,34 @@
"@typescript-eslint/typescript-estree" "3.10.1"
eslint-visitor-keys "^1.1.0"

"@typescript-eslint/parser@^4.15.2":
version "4.15.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.15.2.tgz#c804474321ef76a3955aec03664808f0d6e7872e"
integrity sha512-SHeF8xbsC6z2FKXsaTb1tBCf0QZsjJ94H6Bo51Y1aVEZ4XAefaw5ZAilMoDPlGghe+qtq7XdTiDlGfVTOmvA+Q==
dependencies:
"@typescript-eslint/scope-manager" "4.15.2"
"@typescript-eslint/types" "4.15.2"
"@typescript-eslint/typescript-estree" "4.15.2"
debug "^4.1.1"

"@typescript-eslint/scope-manager@4.15.2":
version "4.15.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.15.2.tgz#5725bda656995960ae1d004bfd1cd70320f37f4f"
integrity sha512-Zm0tf/MSKuX6aeJmuXexgdVyxT9/oJJhaCkijv0DvJVT3ui4zY6XYd6iwIo/8GEZGy43cd7w1rFMiCLHbRzAPQ==
dependencies:
"@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"
Expand All @@ -990,13 +1027,34 @@
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"
integrity sha512-cGR8C2g5SPtHTQvAymEODeqx90pJHadWsgTtx6GbnTWKqsg7yp6Eaya9nFzUd4KrKhxdYTTFBiYeTPQaz/l8bw==
dependencies:
"@typescript-eslint/types" "4.15.2"
"@typescript-eslint/visitor-keys" "4.15.2"
debug "^4.1.1"
globby "^11.0.1"
is-glob "^4.0.1"
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"
integrity sha512-TME1VgSb7wTwgENN5KVj4Nqg25hP8DisXxNBojM4Nn31rYaNDIocNm5cmjOFfh42n7NVERxWrDFoETO/76ePyg==
dependencies:
"@typescript-eslint/types" "4.15.2"
eslint-visitor-keys "^2.0.0"

JSONStream@^1.0.4:
version "1.3.5"
resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0"
Expand Down Expand Up @@ -2483,7 +2541,7 @@ fast-deep-equal@^3.1.1:
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==

fast-glob@^3.0.3:
fast-glob@^3.0.3, fast-glob@^3.1.1:
version "3.2.5"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661"
integrity sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==
Expand Down Expand Up @@ -2787,6 +2845,18 @@ globby@10.0.0:
merge2 "^1.2.3"
slash "^3.0.0"

globby@^11.0.1:
version "11.0.2"
resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.2.tgz#1af538b766a3b540ebfb58a32b2e2d5897321d83"
integrity sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==
dependencies:
array-union "^2.1.0"
dir-glob "^3.0.1"
fast-glob "^3.1.1"
ignore "^5.1.4"
merge2 "^1.3.0"
slash "^3.0.0"

got@^9.6.0:
version "9.6.0"
resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85"
Expand Down Expand Up @@ -2962,7 +3032,7 @@ ignore@^4.0.6:
resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc"
integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==

ignore@^5.1.1:
ignore@^5.1.1, ignore@^5.1.4:
version "5.1.8"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57"
integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==
Expand Down

0 comments on commit 2254984

Please sign in to comment.