Skip to content

Commit 082663c

Browse files
authored
Merge 8ca1225 into 1730b2e
2 parents 1730b2e + 8ca1225 commit 082663c

4 files changed

Lines changed: 38 additions & 30 deletions

File tree

.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
* - We should add "plugin:react/jsx-runtime", but not sure if this will cause problems for projects not using the new JSX transform
77
* - Consider adding the rule "id-length"
88
*/
9+
10+
/**
11+
* V9 migration WIP
12+
* - eslint-plugin-storybook does not support v9 yet: https://github.com/storybookjs/eslint-plugin-storybook/issues/157
13+
* - eslint-plugin-testing-library does not support v9 yet: https://github.com/testing-library/eslint-plugin-testing-library/issues?q=is%3Aissue+is%3Aopen+v9
14+
* - @vitest/eslint-plugin supports v9, just need to replace @vitest/legacy-recommended: https://github.com/vitest-dev/eslint-plugin-vitest?tab=readme-ov-file#usage
15+
* - Looks like @typescript-eslint/eslint-plugin and @typescript-eslint/parser can both be replaced by just typescript-eslint in v9: https://typescript-eslint.io/getting-started#step-2-configuration
16+
*/
917
module.exports = {
1018
env: {
1119
browser: true,

@navikt/core/react/src/util/hooks/descendants/useDescendant.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function createDescendantContext<
1616
K extends Record<string, any> = object,
1717
>() {
1818
const [DescendantsContextProvider, useDescendantsContext] = createContext<
19-
ReturnType<typeof _useDescendants>
19+
ReturnType<typeof useDescendants>
2020
>({
2121
name: "DescendantsProvider",
2222
errorMessage:
@@ -38,7 +38,7 @@ export function createDescendantContext<
3838
* - ref callback to register the descendant
3939
* - Its enabled index compared to other enabled descendants
4040
*/
41-
function _useDescendant(options?: DescendantOptions<K>) {
41+
function useDescendant(options?: DescendantOptions<K>) {
4242
const descendants = useDescendantsContext();
4343
const [index, setIndex] = useState(-1);
4444
const ref = useRef<T>(null);
@@ -74,7 +74,7 @@ export function createDescendantContext<
7474
* @internal
7575
* Initializing DescendantsManager
7676
*/
77-
function _useDescendants() {
77+
function useDescendants() {
7878
const descendants = useRef(new DescendantsManager<T, K>()).current;
7979

8080
return descendants;
@@ -86,8 +86,8 @@ export function createDescendantContext<
8686
// call this when you need to read from context
8787
useDescendantsContext,
8888
// descendants state information, to be called and passed to `ContextProvider`
89-
_useDescendants,
89+
useDescendants,
9090
// descendant index information
91-
_useDescendant,
91+
useDescendant,
9292
] as const;
9393
}

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,12 @@
169169
"cross-env": "^7.0.0",
170170
"eslint": "^8.50.0",
171171
"eslint-plugin-aksel-local": "*",
172-
"eslint-plugin-import": "^2.28.1",
173-
"eslint-plugin-jsx-a11y": "^6.7.1",
174-
"eslint-plugin-react": "^7.33.2",
175-
"eslint-plugin-react-hooks": "^4.6.0",
172+
"eslint-plugin-import": "^2.31.0",
173+
"eslint-plugin-jsx-a11y": "^6.10.0",
174+
"eslint-plugin-react": "^7.37.1",
175+
"eslint-plugin-react-hooks": "^5.0.0",
176176
"eslint-plugin-storybook": "^0.9.0",
177-
"eslint-plugin-testing-library": "^6.0.2",
177+
"eslint-plugin-testing-library": "^6.3.2",
178178
"fast-glob": "3.2.11",
179179
"husky": "^8.0.0",
180180
"lint-staged": "13.0.3",

yarn.lock

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6928,7 +6928,7 @@ __metadata:
69286928
languageName: node
69296929
linkType: hard
69306930

6931-
"@typescript-eslint/utils@npm:^5.58.0, @typescript-eslint/utils@npm:^5.62.0":
6931+
"@typescript-eslint/utils@npm:^5.62.0":
69326932
version: 5.62.0
69336933
resolution: "@typescript-eslint/utils@npm:5.62.0"
69346934
dependencies:
@@ -7725,12 +7725,12 @@ __metadata:
77257725
cross-env: "npm:^7.0.0"
77267726
eslint: "npm:^8.50.0"
77277727
eslint-plugin-aksel-local: "npm:*"
7728-
eslint-plugin-import: "npm:^2.28.1"
7729-
eslint-plugin-jsx-a11y: "npm:^6.7.1"
7730-
eslint-plugin-react: "npm:^7.33.2"
7731-
eslint-plugin-react-hooks: "npm:^4.6.0"
7728+
eslint-plugin-import: "npm:^2.31.0"
7729+
eslint-plugin-jsx-a11y: "npm:^6.10.0"
7730+
eslint-plugin-react: "npm:^7.37.1"
7731+
eslint-plugin-react-hooks: "npm:^5.0.0"
77327732
eslint-plugin-storybook: "npm:^0.9.0"
7733-
eslint-plugin-testing-library: "npm:^6.0.2"
7733+
eslint-plugin-testing-library: "npm:^6.3.2"
77347734
fast-glob: "npm:3.2.11"
77357735
husky: "npm:^8.0.0"
77367736
lint-staged: "npm:13.0.3"
@@ -11684,7 +11684,7 @@ __metadata:
1168411684
languageName: unknown
1168511685
linkType: soft
1168611686

11687-
"eslint-plugin-import@npm:^2.28.1":
11687+
"eslint-plugin-import@npm:^2.31.0":
1168811688
version: 2.31.0
1168911689
resolution: "eslint-plugin-import@npm:2.31.0"
1169011690
dependencies:
@@ -11713,7 +11713,7 @@ __metadata:
1171311713
languageName: node
1171411714
linkType: hard
1171511715

11716-
"eslint-plugin-jsx-a11y@npm:^6.7.1":
11716+
"eslint-plugin-jsx-a11y@npm:^6.10.0":
1171711717
version: 6.10.0
1171811718
resolution: "eslint-plugin-jsx-a11y@npm:6.10.0"
1171911719
dependencies:
@@ -11739,16 +11739,16 @@ __metadata:
1173911739
languageName: node
1174011740
linkType: hard
1174111741

11742-
"eslint-plugin-react-hooks@npm:^4.6.0":
11743-
version: 4.6.2
11744-
resolution: "eslint-plugin-react-hooks@npm:4.6.2"
11742+
"eslint-plugin-react-hooks@npm:^5.0.0":
11743+
version: 5.0.0
11744+
resolution: "eslint-plugin-react-hooks@npm:5.0.0"
1174511745
peerDependencies:
11746-
eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0
11747-
checksum: 10/5a0680941f34e70cf505bcb6082df31a3e445d193ee95a88ff3483041eb944f4cefdaf7e81b0eb1feb4eeceee8c7c6ddb8a2a6e8c4c0388514a42e16ac7b7a69
11746+
eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0
11747+
checksum: 10/b762789832806b6981e2d910994e72aa7a85136fe0880572334b26cf1274ba37bd3b1365e77d2c2f92465337c4a65c84ef647bc499d33b86fc1110f2df7ef1bb
1174811748
languageName: node
1174911749
linkType: hard
1175011750

11751-
"eslint-plugin-react@npm:^7.33.2":
11751+
"eslint-plugin-react@npm:^7.37.1":
1175211752
version: 7.37.1
1175311753
resolution: "eslint-plugin-react@npm:7.37.1"
1175411754
dependencies:
@@ -11790,14 +11790,14 @@ __metadata:
1179011790
languageName: node
1179111791
linkType: hard
1179211792

11793-
"eslint-plugin-testing-library@npm:^6.0.2":
11794-
version: 6.3.0
11795-
resolution: "eslint-plugin-testing-library@npm:6.3.0"
11793+
"eslint-plugin-testing-library@npm:^6.3.2":
11794+
version: 6.4.0
11795+
resolution: "eslint-plugin-testing-library@npm:6.4.0"
1179611796
dependencies:
11797-
"@typescript-eslint/utils": "npm:^5.58.0"
11797+
"@typescript-eslint/utils": "npm:^5.62.0"
1179811798
peerDependencies:
11799-
eslint: ^7.5.0 || ^8.0.0
11800-
checksum: 10/192b112f84f90cc7eee28965b3e7792e8d4cda71aa29690d8180f1ae9cd0e8d6a8851ee992d37285a76750f8638c04e76f768e1885168f060ca169b72ac9ec6c
11799+
eslint: ^7.5.0 || ^8.0.0 || ^9.0.0
11800+
checksum: 10/b9461e6662542fbfb3c0b768e6038bbaa56e345cb0600c7f07e26ff8154166abb9f7dcdc08d565c314cd9ccf0416eca8c3ce3c235b375c5fbf3f152a81142969
1180111801
languageName: node
1180211802
linkType: hard
1180311803

0 commit comments

Comments
 (0)