Skip to content

Commit 9bfc5e6

Browse files
authored
chore: bump @rnx-kit/eslint-plugin to 0.6.0 (#1037)
1 parent 44f696c commit 9bfc5e6

File tree

13 files changed

+50
-38
lines changed

13 files changed

+50
-38
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
],
77
"packageManager": "[email protected]",
88
"devDependencies": {
9-
"@rnx-kit/eslint-plugin": "^0.5.0",
109
"eslint": "^8.54.0",
1110
"prettier": "^2.8.8",
1211
"typescript": "^5.3.0"

packages/api/example/ExampleExtension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { StorageExtension } from "../src";
1+
import type { StorageExtension } from "../src";
22

33
export interface MyExampleExtension extends StorageExtension {
44
double: (num: number) => Promise<number>;

packages/api/example/ExampleStorage.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
import { AsyncStorage, StorageKeys, StorageModel } from "../src";
2-
import { ExampleExtension, MyExampleExtension } from "./ExampleExtension";
1+
import type { AsyncStorage, StorageKeys, StorageModel } from "../src";
2+
import type { MyExampleExtension } from "./ExampleExtension";
3+
import { ExampleExtension } from "./ExampleExtension";
34

45
type MyModel = StorageModel<{
56
age: number;
67
name: string;
78
likes: boolean[];
89
}>;
910

10-
// @ts-ignore
11-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
12-
class ExampleStorage implements AsyncStorage<MyModel, MyExampleExtension> {
11+
export class ExampleStorage implements AsyncStorage<MyModel, MyExampleExtension> {
1312
private storage: MyModel = {
1413
age: null,
1514
name: null,

packages/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"scripts": {
1717
"prepack": "yarn build",
1818
"build": "bob build",
19-
"test:lint": "eslint src/**",
19+
"test:lint": "eslint $(git ls-files '*.js' '*.ts' '*.tsx')",
2020
"test:ts": "tsc --noEmit",
2121
"test:jest": "jest"
2222
},

packages/default-storage/example/examples/Basic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// @ts-ignore
1+
// @ts-expect-error cannot find module
22
import AsyncStorage from "@react-native-async-storage/async-storage";
33
import React from "react";
44
import {

packages/default-storage/example/examples/Functional.tsx

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// @ts-ignore
1+
// @ts-expect-error cannot find module
22
import AsyncStorage from "@react-native-async-storage/async-storage";
33
import React, { useEffect, useState } from "react";
44
import isEqual from "lodash/isEqual";
@@ -23,6 +23,18 @@ type TestResult =
2323
actual?: string | null;
2424
};
2525

26+
function isTestResult(result: unknown): result is TestResult {
27+
return (
28+
result === SKIP_TEST ||
29+
Boolean(
30+
result &&
31+
typeof result === "object" &&
32+
"step" in result &&
33+
"expected" in result
34+
)
35+
);
36+
}
37+
2638
function compare(expected: TestValue, actual: string): boolean {
2739
return typeof expected === "string"
2840
? expected === actual
@@ -105,7 +117,11 @@ function Functional(): JSX.Element {
105117
try {
106118
await execute(test);
107119
testResults.push([name, undefined]);
108-
} catch (e: any) {
120+
} catch (e: unknown) {
121+
if (!isTestResult(e)) {
122+
throw e;
123+
}
124+
109125
testResults.push([name, e]);
110126
}
111127
}
@@ -140,7 +156,11 @@ function Functional(): JSX.Element {
140156
try {
141157
await execute(test);
142158
testResults.push([name, undefined]);
143-
} catch (e: any) {
159+
} catch (e: unknown) {
160+
if (!isTestResult(e)) {
161+
throw e;
162+
}
163+
144164
testResults.push([name, e]);
145165
await new Promise((resolve) => {
146166
AsyncStorageTestSupport.test_unsetDelegate(resolve);

packages/default-storage/example/examples/GetSetClear.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
// @ts-ignore
8+
// @ts-expect-error cannot find module
99
import AsyncStorage from "@react-native-async-storage/async-storage";
1010
import React from "react";
1111
import { Button, StyleSheet, Text, View } from "react-native";

packages/default-storage/example/examples/MergeItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
// @ts-ignore
8+
// @ts-expect-error cannot find module
99
import AsyncStorage from "@react-native-async-storage/async-storage";
1010
import React, { useCallback, useState } from "react";
1111
import {

packages/default-storage/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"bundle:ios": "scripts/ios_e2e.sh 'bundle'",
5656
"bundle:macos": "react-native bundle --entry-file index.ts --platform macos --dev false --bundle-output example/index.macos.jsbundle",
5757
"test": "concurrently -n lint,ts yarn:test:lint yarn:test:ts",
58-
"test:lint": "eslint src/**/*.ts example/**/*.ts jest/*.js",
58+
"test:lint": "eslint $(git ls-files '*.js' '*.ts' '*.tsx')",
5959
"test:ts": "tsc",
6060
"test:e2e:android": "scripts/android_e2e.sh 'test'",
6161
"test:e2e:ios": "scripts/ios_e2e.sh 'test'",

packages/eslint-config/index.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
const { FlatCompat } = require("@eslint/eslintrc");
2-
const js = require("@eslint/js");
3-
4-
const compat = new FlatCompat({
5-
baseDirectory: __dirname,
6-
recommendedConfig: js.configs.recommended,
7-
});
8-
9-
module.exports = compat.extends("plugin:@rnx-kit/recommended");
1+
module.exports = require("@rnx-kit/eslint-plugin/recommended");

packages/eslint-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"dependencies": {
2020
"@eslint/eslintrc": "^2.1.3",
2121
"@eslint/js": "^8.33.0",
22-
"@rnx-kit/eslint-plugin": "^0.5.0",
22+
"@rnx-kit/eslint-plugin": "^0.6.0",
2323
"eslint-plugin-wdio": "^8.20.0"
2424
},
2525
"peerDependencies": {

packages/eslint-config/recommended-wdio.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ const compat = new FlatCompat({
77
});
88

99
module.exports = [
10+
...require("./index"),
1011
{
1112
plugins: {
1213
wdio: require("eslint-plugin-wdio"),
1314
},
1415
},
15-
...compat.extends("plugin:@rnx-kit/recommended", "plugin:wdio/recommended"),
16+
...compat.extends("plugin:wdio/recommended"),
1617
];

yarn.lock

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2813,7 +2813,7 @@ __metadata:
28132813
languageName: node
28142814
linkType: hard
28152815

2816-
"@eslint/eslintrc@npm:^2.1.3":
2816+
"@eslint/eslintrc@npm:^2.1.2, @eslint/eslintrc@npm:^2.1.3":
28172817
version: 2.1.3
28182818
resolution: "@eslint/eslintrc@npm:2.1.3"
28192819
dependencies:
@@ -4215,7 +4215,7 @@ __metadata:
42154215
dependencies:
42164216
"@eslint/eslintrc": ^2.1.3
42174217
"@eslint/js": ^8.33.0
4218-
"@rnx-kit/eslint-plugin": ^0.5.0
4218+
"@rnx-kit/eslint-plugin": ^0.6.0
42194219
eslint-plugin-wdio: ^8.20.0
42204220
prettier: ^2.8.8
42214221
peerDependencies:
@@ -4227,7 +4227,6 @@ __metadata:
42274227
version: 0.0.0-use.local
42284228
resolution: "@react-native-async-storage/root@workspace:."
42294229
dependencies:
4230-
"@rnx-kit/eslint-plugin": ^0.5.0
42314230
eslint: ^8.54.0
42324231
prettier: ^2.8.8
42334232
typescript: ^5.3.0
@@ -4546,19 +4545,21 @@ __metadata:
45464545
languageName: node
45474546
linkType: hard
45484547

4549-
"@rnx-kit/eslint-plugin@npm:^0.5.0":
4550-
version: 0.5.3
4551-
resolution: "@rnx-kit/eslint-plugin@npm:0.5.3"
4548+
"@rnx-kit/eslint-plugin@npm:^0.6.0":
4549+
version: 0.6.0
4550+
resolution: "@rnx-kit/eslint-plugin@npm:0.6.0"
45524551
dependencies:
4552+
"@eslint/eslintrc": ^2.1.2
4553+
"@eslint/js": ^8.33.0
45534554
"@react-native/eslint-plugin": ^0.74.0
45544555
"@typescript-eslint/eslint-plugin": ^6.0.0
45554556
"@typescript-eslint/parser": ^6.0.0
45564557
enhanced-resolve: ^5.8.3
4557-
eslint-plugin-react: ^7.26.0
4558-
eslint-plugin-react-hooks: ^4.3.0
4558+
eslint-plugin-react: ^7.33.0
4559+
eslint-plugin-react-hooks: ^4.6.0
45594560
peerDependencies:
4560-
eslint: ">=6.0.0"
4561-
checksum: 2fd02a3ca53d932d5017693c1c76215bd9fc31caf6447582f8d88cbdd1c9e1eef3d5748c2ec23316c6539287e8f0c1a68d3e8cf6da1ed189d99eb4026d58c1c8
4561+
eslint: ">=8.23.0"
4562+
checksum: c351ee139b70af610e93186c0372505b674c55bceae04f19c9a0fd57ba7951cb8235374618cfd0134cd1588f8f36cb8dfdf3c6fd8c384b4a62a60b75454813c9
45624563
languageName: node
45634564
linkType: hard
45644565

@@ -10993,7 +10994,7 @@ __metadata:
1099310994
languageName: node
1099410995
linkType: hard
1099510996

10996-
"eslint-plugin-react-hooks@npm:^4.3.0":
10997+
"eslint-plugin-react-hooks@npm:^4.6.0":
1099710998
version: 4.6.0
1099810999
resolution: "eslint-plugin-react-hooks@npm:4.6.0"
1099911000
peerDependencies:
@@ -11002,7 +11003,7 @@ __metadata:
1100211003
languageName: node
1100311004
linkType: hard
1100411005

11005-
"eslint-plugin-react@npm:^7.26.0":
11006+
"eslint-plugin-react@npm:^7.33.0":
1100611007
version: 7.33.2
1100711008
resolution: "eslint-plugin-react@npm:7.33.2"
1100811009
dependencies:

0 commit comments

Comments
 (0)