Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linting] Eslint v9 dependency upgrades #3248

Merged
merged 6 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
* - We should add "plugin:react/jsx-runtime", but not sure if this will cause problems for projects not using the new JSX transform
* - Consider adding the rule "id-length"
*/

/**
* V9 migration WIP
* - eslint-plugin-storybook does not support v9 yet: https://github.com/storybookjs/eslint-plugin-storybook/issues/157
* - 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
* - @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
* - 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
*/
module.exports = {
env: {
browser: true,
Expand Down
10 changes: 5 additions & 5 deletions @navikt/core/react/src/util/hooks/descendants/useDescendant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function createDescendantContext<
K extends Record<string, any> = object,
>() {
const [DescendantsContextProvider, useDescendantsContext] = createContext<
ReturnType<typeof _useDescendants>
ReturnType<typeof UseDescendants>
>({
name: "DescendantsProvider",
errorMessage:
Expand All @@ -38,7 +38,7 @@ export function createDescendantContext<
* - ref callback to register the descendant
* - Its enabled index compared to other enabled descendants
*/
function _useDescendant(options?: DescendantOptions<K>) {
function UseDescendant(options?: DescendantOptions<K>) {
KenAJoh marked this conversation as resolved.
Show resolved Hide resolved
const descendants = useDescendantsContext();
const [index, setIndex] = useState(-1);
const ref = useRef<T>(null);
Expand Down Expand Up @@ -74,7 +74,7 @@ export function createDescendantContext<
* @internal
* Initializing DescendantsManager
*/
function _useDescendants() {
function UseDescendants() {
const descendants = useRef(new DescendantsManager<T, K>()).current;

return descendants;
Expand All @@ -86,8 +86,8 @@ export function createDescendantContext<
// call this when you need to read from context
useDescendantsContext,
// descendants state information, to be called and passed to `ContextProvider`
_useDescendants,
UseDescendants,
// descendant index information
_useDescendant,
UseDescendant,
] as const;
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@
"cross-env": "^7.0.0",
"eslint": "^8.50.0",
"eslint-plugin-aksel-local": "*",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-react": "^7.37.1",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-storybook": "^0.9.0",
"eslint-plugin-testing-library": "^6.0.2",
"eslint-plugin-testing-library": "^6.3.2",
"fast-glob": "3.2.11",
"husky": "^8.0.0",
"lint-staged": "13.0.3",
Expand Down
59 changes: 30 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8346,12 +8346,12 @@ __metadata:
cross-env: "npm:^7.0.0"
eslint: "npm:^8.50.0"
eslint-plugin-aksel-local: "npm:*"
eslint-plugin-import: "npm:^2.28.1"
eslint-plugin-jsx-a11y: "npm:^6.7.1"
eslint-plugin-react: "npm:^7.33.2"
eslint-plugin-react-hooks: "npm:^4.6.0"
eslint-plugin-import: "npm:^2.31.0"
eslint-plugin-jsx-a11y: "npm:^6.10.0"
eslint-plugin-react: "npm:^7.37.1"
eslint-plugin-react-hooks: "npm:^5.0.0"
eslint-plugin-storybook: "npm:^0.9.0"
eslint-plugin-testing-library: "npm:^6.0.2"
eslint-plugin-testing-library: "npm:^6.3.2"
fast-glob: "npm:3.2.11"
husky: "npm:^8.0.0"
lint-staged: "npm:13.0.3"
Expand Down Expand Up @@ -12316,15 +12316,15 @@ __metadata:
languageName: node
linkType: hard

"eslint-module-utils@npm:^2.9.0":
version: 2.11.0
resolution: "eslint-module-utils@npm:2.11.0"
"eslint-module-utils@npm:^2.12.0":
version: 2.12.0
resolution: "eslint-module-utils@npm:2.12.0"
dependencies:
debug: "npm:^3.2.7"
peerDependenciesMeta:
eslint:
optional: true
checksum: 10/1ba42cf48c5f9ec3b76dfa42c16f1c24c10508313689425c05ccb1d0eaa34bdc5c5b9c0c033cd402e9c429666bd3eb8c6d0c66565b0c00949fae743ad3643c95
checksum: 10/dd27791147eca17366afcb83f47d6825b6ce164abb256681e5de4ec1d7e87d8605641eb869298a0dbc70665e2446dbcc2f40d3e1631a9475dd64dd23d4ca5dee
languageName: node
linkType: hard

Expand All @@ -12334,9 +12334,9 @@ __metadata:
languageName: unknown
linkType: soft

"eslint-plugin-import@npm:^2.28.1":
version: 2.30.0
resolution: "eslint-plugin-import@npm:2.30.0"
"eslint-plugin-import@npm:^2.31.0":
version: 2.31.0
resolution: "eslint-plugin-import@npm:2.31.0"
dependencies:
"@rtsao/scc": "npm:^1.1.0"
array-includes: "npm:^3.1.8"
Expand All @@ -12346,7 +12346,7 @@ __metadata:
debug: "npm:^3.2.7"
doctrine: "npm:^2.1.0"
eslint-import-resolver-node: "npm:^0.3.9"
eslint-module-utils: "npm:^2.9.0"
eslint-module-utils: "npm:^2.12.0"
hasown: "npm:^2.0.2"
is-core-module: "npm:^2.15.1"
is-glob: "npm:^4.0.3"
Expand All @@ -12355,14 +12355,15 @@ __metadata:
object.groupby: "npm:^1.0.3"
object.values: "npm:^1.2.0"
semver: "npm:^6.3.1"
string.prototype.trimend: "npm:^1.0.8"
tsconfig-paths: "npm:^3.15.0"
peerDependencies:
eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8
checksum: 10/a5f85dfe76e27286c28a01d137769726ce3f758bcc03aa6b6f9e18700a40a08f57239f82e07efcab763c4b03a02d425edcc29fbecf40aad0124286978c6bc63c
eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9
checksum: 10/6b76bd009ac2db0615d9019699d18e2a51a86cb8c1d0855a35fb1b418be23b40239e6debdc6e8c92c59f1468ed0ea8d7b85c817117a113d5cc225be8a02ad31c
languageName: node
linkType: hard

"eslint-plugin-jsx-a11y@npm:^6.7.1":
"eslint-plugin-jsx-a11y@npm:^6.10.0":
version: 6.10.0
resolution: "eslint-plugin-jsx-a11y@npm:6.10.0"
dependencies:
Expand All @@ -12388,18 +12389,18 @@ __metadata:
languageName: node
linkType: hard

"eslint-plugin-react-hooks@npm:^4.6.0":
version: 4.6.2
resolution: "eslint-plugin-react-hooks@npm:4.6.2"
"eslint-plugin-react-hooks@npm:^5.0.0":
version: 5.0.0
resolution: "eslint-plugin-react-hooks@npm:5.0.0"
peerDependencies:
eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0
checksum: 10/5a0680941f34e70cf505bcb6082df31a3e445d193ee95a88ff3483041eb944f4cefdaf7e81b0eb1feb4eeceee8c7c6ddb8a2a6e8c4c0388514a42e16ac7b7a69
eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0
checksum: 10/b762789832806b6981e2d910994e72aa7a85136fe0880572334b26cf1274ba37bd3b1365e77d2c2f92465337c4a65c84ef647bc499d33b86fc1110f2df7ef1bb
languageName: node
linkType: hard

"eslint-plugin-react@npm:^7.33.2":
version: 7.36.1
resolution: "eslint-plugin-react@npm:7.36.1"
"eslint-plugin-react@npm:^7.37.1":
version: 7.37.1
resolution: "eslint-plugin-react@npm:7.37.1"
dependencies:
array-includes: "npm:^3.1.8"
array.prototype.findlast: "npm:^1.2.5"
Expand All @@ -12421,7 +12422,7 @@ __metadata:
string.prototype.repeat: "npm:^1.0.0"
peerDependencies:
eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7
checksum: 10/bca154b446c35af4859a92fd043dcfe5c74851eb27652234020548570bb81d37cc9f1eb1795b3c9e7514de6c9b48f42fcc00153062eca879dab45ab84e49d0b1
checksum: 10/a7b9cf2c43255844ad0c9d4e3758a8c2b687a2ce9a09f4161ab245581d5d2d91b37742e541c88aa9ce368ec6c860e23dc78c15117f3fc1cdc433847038e8346b
languageName: node
linkType: hard

Expand All @@ -12439,14 +12440,14 @@ __metadata:
languageName: node
linkType: hard

"eslint-plugin-testing-library@npm:^6.0.2":
version: 6.3.0
resolution: "eslint-plugin-testing-library@npm:6.3.0"
"eslint-plugin-testing-library@npm:^6.3.2":
version: 6.3.2
resolution: "eslint-plugin-testing-library@npm:6.3.2"
dependencies:
"@typescript-eslint/utils": "npm:^5.58.0"
peerDependencies:
eslint: ^7.5.0 || ^8.0.0
checksum: 10/192b112f84f90cc7eee28965b3e7792e8d4cda71aa29690d8180f1ae9cd0e8d6a8851ee992d37285a76750f8638c04e76f768e1885168f060ca169b72ac9ec6c
checksum: 10/43c0b611ec2133882df04f64029745b45786191250ab6dc21aab41495c95807c456069775427a41a60b55e369fa25fe12e6e7e3d68294f5791ba7fc7161a17a5
languageName: node
linkType: hard

Expand Down
Loading