@maplibre/maplibre-react-native 10.0.0-alpha.8 → 10.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/docs/Camera.md +1 -1
- package/docs/MapView.md +9 -9
- package/docs/MarkerView.md +1 -1
- package/docs/NativeUserLocation.md +1 -1
- package/docs/PointAnnotation.md +2 -2
- package/docs/UserLocation.md +2 -2
- package/docs/docs.json +12 -12
- package/javascript/@types/assets.d.ts +1 -1
- package/javascript/MLNModule.ts +2 -2
- package/javascript/Maplibre.ts +37 -42
- package/javascript/components/BackgroundLayer.tsx +9 -9
- package/javascript/components/Callout.tsx +19 -19
- package/javascript/components/Camera.tsx +29 -29
- package/javascript/components/CircleLayer.tsx +9 -9
- package/javascript/components/FillExtrusionLayer.tsx +9 -9
- package/javascript/components/FillLayer.tsx +9 -9
- package/javascript/components/HeadingIndicator.tsx +7 -8
- package/javascript/components/HeatmapLayer.tsx +10 -10
- package/javascript/components/ImageSource.tsx +8 -8
- package/javascript/components/Images.tsx +19 -20
- package/javascript/components/Light.tsx +15 -15
- package/javascript/components/LineLayer.tsx +9 -9
- package/javascript/components/MapView.tsx +74 -70
- package/javascript/components/MarkerView.tsx +9 -10
- package/javascript/components/NativeUserLocation.tsx +4 -4
- package/javascript/components/PointAnnotation.tsx +17 -17
- package/javascript/components/RasterLayer.tsx +9 -9
- package/javascript/components/RasterSource.tsx +10 -10
- package/javascript/components/ShapeSource.tsx +63 -61
- package/javascript/components/Style.tsx +69 -59
- package/javascript/components/SymbolLayer.tsx +10 -10
- package/javascript/components/UserLocation.tsx +23 -23
- package/javascript/components/VectorSource.tsx +19 -19
- package/javascript/components/annotations/Annotation.tsx +16 -15
- package/javascript/hooks/useAbstractLayer.ts +15 -12
- package/javascript/hooks/useAbstractSource.ts +2 -2
- package/javascript/hooks/useNativeBridge.ts +7 -7
- package/javascript/hooks/useNativeRef.ts +2 -2
- package/javascript/hooks/useOnce.ts +1 -1
- package/javascript/index.ts +2 -2
- package/javascript/modules/location/locationManager.ts +4 -4
- package/javascript/modules/offline/OfflineCreatePackOptions.ts +5 -5
- package/javascript/modules/offline/OfflinePack.ts +3 -3
- package/javascript/modules/offline/offlineManager.ts +11 -12
- package/javascript/modules/snapshot/SnapshotOptions.ts +4 -4
- package/javascript/modules/snapshot/snapshotManager.ts +2 -2
- package/javascript/requestAndroidLocationPermissions.ts +3 -3
- package/javascript/types/OnPressEvent.ts +1 -1
- package/javascript/types/index.ts +6 -2
- package/javascript/utils/BridgeValue.ts +20 -20
- package/javascript/utils/Logger.ts +14 -14
- package/javascript/utils/MaplibreStyles.d.ts +359 -359
- package/javascript/utils/StyleValue.ts +12 -12
- package/javascript/utils/animated/AbstractAnimatedCoordinates.ts +6 -6
- package/javascript/utils/animated/Animated.ts +38 -16
- package/javascript/utils/animated/AnimatedCoordinatesArray.ts +7 -11
- package/javascript/utils/animated/AnimatedExtractCoordinateFromArray.ts +3 -3
- package/javascript/utils/animated/AnimatedPoint.ts +7 -7
- package/javascript/utils/animated/AnimatedRouteCoordinatesArray.ts +16 -20
- package/javascript/utils/animated/AnimatedShape.ts +15 -15
- package/javascript/utils/deprecation.ts +6 -3
- package/javascript/utils/filterUtils.ts +1 -1
- package/javascript/utils/geoUtils.ts +8 -8
- package/javascript/utils/index.ts +14 -14
- package/javascript/utils/styleMap.ts +18 -18
- package/package.json +28 -15
- package/plugin/build/withMapLibre.d.ts +2 -2
- package/plugin/build/withMapLibre.js +24 -24
- package/scripts/autogenerate.js +1 -1
- package/.eslintignore +0 -3
- package/.eslintrc.js +0 -169
- package/.prettierrc.js +0 -7
- package/.yarn/sdks/eslint/bin/eslint.js +0 -27
- package/.yarn/sdks/eslint/lib/api.js +0 -27
- package/.yarn/sdks/eslint/lib/unsupported-api.js +0 -27
- package/.yarn/sdks/eslint/package.json +0 -14
- package/.yarn/sdks/integrations.yml +0 -5
- package/.yarn/sdks/prettier/bin/prettier.cjs +0 -27
- package/.yarn/sdks/prettier/index.cjs +0 -27
- package/.yarn/sdks/prettier/package.json +0 -7
- package/.yarn/sdks/typescript/bin/tsc +0 -27
- package/.yarn/sdks/typescript/bin/tsserver +0 -27
- package/.yarn/sdks/typescript/lib/tsc.js +0 -27
- package/.yarn/sdks/typescript/lib/tsserver.js +0 -239
- package/.yarn/sdks/typescript/lib/tsserverlibrary.js +0 -239
- package/.yarn/sdks/typescript/lib/typescript.js +0 -27
- package/.yarn/sdks/typescript/package.json +0 -10
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
// DO NOT MODIFY
|
|
3
3
|
// THIS FILE IS AUTOGENERATED
|
|
4
4
|
|
|
5
|
-
import {isAndroid} from
|
|
5
|
+
import { isAndroid } from "./index";
|
|
6
6
|
|
|
7
7
|
export const StyleTypes = {
|
|
8
|
-
Constant:
|
|
9
|
-
Color:
|
|
10
|
-
Transition:
|
|
11
|
-
Translation:
|
|
12
|
-
Function:
|
|
13
|
-
Image:
|
|
14
|
-
Enum:
|
|
8
|
+
Constant: "constant",
|
|
9
|
+
Color: "color",
|
|
10
|
+
Transition: "transition",
|
|
11
|
+
Translation: "translation",
|
|
12
|
+
Function: "function",
|
|
13
|
+
Image: "image",
|
|
14
|
+
Enum: "enum",
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export function getStyleType(styleProp: keyof typeof styleExtras): string {
|
|
@@ -226,38 +226,38 @@ const styleMap = {
|
|
|
226
226
|
export const styleExtras = {
|
|
227
227
|
// padding
|
|
228
228
|
iconTextFitPadding: {
|
|
229
|
-
iosType:
|
|
229
|
+
iosType: "edgeinsets",
|
|
230
230
|
},
|
|
231
231
|
|
|
232
232
|
// offsets
|
|
233
233
|
iconOffset: {
|
|
234
|
-
iosType:
|
|
234
|
+
iosType: "vector",
|
|
235
235
|
},
|
|
236
236
|
textOffset: {
|
|
237
|
-
iosType:
|
|
237
|
+
iosType: "vector",
|
|
238
238
|
},
|
|
239
239
|
lineOffset: {
|
|
240
|
-
iosType:
|
|
240
|
+
iosType: "vector",
|
|
241
241
|
},
|
|
242
242
|
|
|
243
243
|
// translates
|
|
244
244
|
fillTranslate: {
|
|
245
|
-
iosType:
|
|
245
|
+
iosType: "vector",
|
|
246
246
|
},
|
|
247
247
|
lineTranslate: {
|
|
248
|
-
iosType:
|
|
248
|
+
iosType: "vector",
|
|
249
249
|
},
|
|
250
250
|
iconTranslate: {
|
|
251
|
-
iosType:
|
|
251
|
+
iosType: "vector",
|
|
252
252
|
},
|
|
253
253
|
textTranslate: {
|
|
254
|
-
iosType:
|
|
254
|
+
iosType: "vector",
|
|
255
255
|
},
|
|
256
256
|
circleTranslate: {
|
|
257
|
-
iosType:
|
|
257
|
+
iosType: "vector",
|
|
258
258
|
},
|
|
259
259
|
fillExtrusionTranslate: {
|
|
260
|
-
iosType:
|
|
260
|
+
iosType: "vector",
|
|
261
261
|
},
|
|
262
262
|
};
|
|
263
263
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maplibre/maplibre-react-native",
|
|
3
3
|
"description": "A MapLibre GL Native plugin for creating maps in React Native",
|
|
4
|
-
"version": "10.0.0-alpha.
|
|
4
|
+
"version": "10.0.0-alpha.9",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"test:plugin": "jest plugin",
|
|
34
34
|
"build:plugin": "tsc --build plugin",
|
|
35
35
|
"lint:plugin": "eslint plugin/src/*",
|
|
36
|
-
"postpack": "pinst --enable"
|
|
36
|
+
"postpack": "pinst --enable",
|
|
37
|
+
"typescript:check": "tsc -p ./tsconfig.json --noEmit"
|
|
37
38
|
},
|
|
38
39
|
"peerDependenciesMeta": {
|
|
39
40
|
"@expo/config-plugins": {
|
|
@@ -73,23 +74,17 @@
|
|
|
73
74
|
"@types/mapbox__geo-viewport": "^0.4.1",
|
|
74
75
|
"@types/node": "^18.11.18",
|
|
75
76
|
"@types/react": "^18.2.15",
|
|
76
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
77
|
-
"@typescript-eslint/parser": "^7.
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "^7.16.0",
|
|
78
|
+
"@typescript-eslint/parser": "^7.16.0",
|
|
78
79
|
"babel-jest": "^29.6.0",
|
|
79
80
|
"documentation": "^14.0.0",
|
|
80
81
|
"ejs": "^3.1.3",
|
|
81
82
|
"ejs-lint": "^2.0.0",
|
|
82
|
-
"eslint": "^8.
|
|
83
|
+
"eslint": "^8.57.0",
|
|
83
84
|
"eslint-config-prettier": "^9.1.0",
|
|
84
|
-
"eslint-
|
|
85
|
-
"eslint-plugin-
|
|
86
|
-
"eslint-plugin-ft-flow": "^3.0.3",
|
|
87
|
-
"eslint-plugin-import": "2.29.1",
|
|
88
|
-
"eslint-plugin-jest": "^27.6.3",
|
|
85
|
+
"eslint-config-universe": "13.0.0",
|
|
86
|
+
"eslint-plugin-import": "^2.29.1",
|
|
89
87
|
"eslint-plugin-prettier": "^5.1.3",
|
|
90
|
-
"eslint-plugin-react": "^7.33.2",
|
|
91
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
92
|
-
"eslint-plugin-react-native": "^4.1.0",
|
|
93
88
|
"expo-module-scripts": "^3.1.0",
|
|
94
89
|
"husky": "^9.0.10",
|
|
95
90
|
"jest": "^29.7.0",
|
|
@@ -98,12 +93,11 @@
|
|
|
98
93
|
"metro-react-native-babel-preset": "^0.76.7",
|
|
99
94
|
"node-dir": "0.1.17",
|
|
100
95
|
"pinst": "^3.0.0",
|
|
101
|
-
"prettier": "^3.
|
|
96
|
+
"prettier": "^3.3.3",
|
|
102
97
|
"react": "^18.2.0",
|
|
103
98
|
"react-docgen": "rnmapbox/react-docgen#rnmapbox-dist",
|
|
104
99
|
"react-native": "0.72.1",
|
|
105
100
|
"react-test-renderer": "^18.2.0",
|
|
106
|
-
"standard": "*",
|
|
107
101
|
"typescript": "^5.3.3"
|
|
108
102
|
},
|
|
109
103
|
"jest": {
|
|
@@ -124,5 +118,24 @@
|
|
|
124
118
|
"lint-staged": {
|
|
125
119
|
"*.{js,jsx,ts,tsx}": "yarn lint"
|
|
126
120
|
},
|
|
121
|
+
"eslintConfig": {
|
|
122
|
+
"root": true,
|
|
123
|
+
"extends": [
|
|
124
|
+
"prettier",
|
|
125
|
+
"universe/native"
|
|
126
|
+
],
|
|
127
|
+
"ignorePatterns": [
|
|
128
|
+
"node_modules/*",
|
|
129
|
+
"*.js",
|
|
130
|
+
"**/dist/*.js",
|
|
131
|
+
"/plugin/build"
|
|
132
|
+
],
|
|
133
|
+
"plugins": [
|
|
134
|
+
"prettier"
|
|
135
|
+
],
|
|
136
|
+
"rules": {
|
|
137
|
+
"prettier/prettier": "error"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
127
140
|
"packageManager": "yarn@4.1.0"
|
|
128
141
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConfigPlugin, XcodeProject } from
|
|
2
|
-
type InstallerBlockName =
|
|
1
|
+
import { ConfigPlugin, XcodeProject } from "@expo/config-plugins";
|
|
2
|
+
type InstallerBlockName = "pre" | "post";
|
|
3
3
|
export declare function applyCocoaPodsModifications(contents: string): string;
|
|
4
4
|
export declare function addInstallerBlock(src: string, blockName: InstallerBlockName): string;
|
|
5
5
|
export declare function addMapLibreInstallerBlock(src: string, blockName: InstallerBlockName): string;
|
|
@@ -4,15 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.setExcludedArchitectures = exports.addMapLibreInstallerBlock = exports.addInstallerBlock = exports.applyCocoaPodsModifications = void 0;
|
|
7
|
-
const fs_1 = require("fs");
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
7
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
10
8
|
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
|
9
|
+
const fs_1 = require("fs");
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
11
|
let pkg = {
|
|
12
|
-
name:
|
|
12
|
+
name: "@maplibre/maplibre-react-native",
|
|
13
13
|
};
|
|
14
14
|
try {
|
|
15
|
-
pkg = require(
|
|
15
|
+
pkg = require("@maplibre/maplibre-react-native/package.json");
|
|
16
16
|
}
|
|
17
17
|
catch {
|
|
18
18
|
// empty catch block
|
|
@@ -25,14 +25,14 @@ catch {
|
|
|
25
25
|
* @param config
|
|
26
26
|
* @returns
|
|
27
27
|
*/
|
|
28
|
-
const withCocoaPodsInstallerBlocks = c => {
|
|
28
|
+
const withCocoaPodsInstallerBlocks = (c) => {
|
|
29
29
|
return (0, config_plugins_1.withDangerousMod)(c, [
|
|
30
|
-
|
|
30
|
+
"ios",
|
|
31
31
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
32
32
|
async (config) => {
|
|
33
|
-
const file = path_1.default.join(config.modRequest.platformProjectRoot,
|
|
34
|
-
const contents = await fs_1.promises.readFile(file,
|
|
35
|
-
await fs_1.promises.writeFile(file, applyCocoaPodsModifications(contents),
|
|
33
|
+
const file = path_1.default.join(config.modRequest.platformProjectRoot, "Podfile");
|
|
34
|
+
const contents = await fs_1.promises.readFile(file, "utf8");
|
|
35
|
+
await fs_1.promises.writeFile(file, applyCocoaPodsModifications(contents), "utf-8");
|
|
36
36
|
return config;
|
|
37
37
|
},
|
|
38
38
|
]);
|
|
@@ -42,19 +42,19 @@ const withCocoaPodsInstallerBlocks = c => {
|
|
|
42
42
|
function applyCocoaPodsModifications(contents) {
|
|
43
43
|
// Ensure installer blocks exist
|
|
44
44
|
// let src = addInstallerBlock(contents, 'pre');
|
|
45
|
-
let src = addInstallerBlock(contents,
|
|
45
|
+
let src = addInstallerBlock(contents, "post");
|
|
46
46
|
// src = addMapLibreInstallerBlock(src, 'pre');
|
|
47
|
-
src = addMapLibreInstallerBlock(src,
|
|
47
|
+
src = addMapLibreInstallerBlock(src, "post");
|
|
48
48
|
return src;
|
|
49
49
|
}
|
|
50
50
|
exports.applyCocoaPodsModifications = applyCocoaPodsModifications;
|
|
51
51
|
function addInstallerBlock(src, blockName) {
|
|
52
52
|
const matchBlock = new RegExp(`${blockName}_install do \\|installer\\|`);
|
|
53
53
|
const tag = `${blockName}_installer`;
|
|
54
|
-
for (const line of src.split(
|
|
54
|
+
for (const line of src.split("\n")) {
|
|
55
55
|
const contents = line.trim();
|
|
56
56
|
// Ignore comments
|
|
57
|
-
if (!contents.startsWith(
|
|
57
|
+
if (!contents.startsWith("#")) {
|
|
58
58
|
// Prevent adding the block if it exists outside of comments.
|
|
59
59
|
if (contents.match(matchBlock)) {
|
|
60
60
|
// This helps to still allow revisions, since we enabled the block previously.
|
|
@@ -69,11 +69,11 @@ function addInstallerBlock(src, blockName) {
|
|
|
69
69
|
return (0, generateCode_1.mergeContents)({
|
|
70
70
|
tag,
|
|
71
71
|
src,
|
|
72
|
-
newSrc: [` ${blockName}_install do |installer|`,
|
|
72
|
+
newSrc: [` ${blockName}_install do |installer|`, " end"].join("\n"),
|
|
73
73
|
anchor: /use_react_native/,
|
|
74
74
|
// We can't go after the use_react_native block because it might have parameters, causing it to be multi-line (see react-native template).
|
|
75
75
|
offset: 0,
|
|
76
|
-
comment:
|
|
76
|
+
comment: "#",
|
|
77
77
|
}).contents;
|
|
78
78
|
}
|
|
79
79
|
exports.addInstallerBlock = addInstallerBlock;
|
|
@@ -84,7 +84,7 @@ function addMapLibreInstallerBlock(src, blockName) {
|
|
|
84
84
|
newSrc: ` $RCTMLN.${blockName}_install(installer)`,
|
|
85
85
|
anchor: new RegExp(`${blockName}_install do \\|installer\\|`),
|
|
86
86
|
offset: 1,
|
|
87
|
-
comment:
|
|
87
|
+
comment: "#",
|
|
88
88
|
}).contents;
|
|
89
89
|
}
|
|
90
90
|
exports.addMapLibreInstallerBlock = addMapLibreInstallerBlock;
|
|
@@ -99,35 +99,35 @@ function setExcludedArchitectures(project) {
|
|
|
99
99
|
for (const { name, buildSettings } of Object.values(configurations || {})) {
|
|
100
100
|
// Guessing that this is the best way to emulate Xcode.
|
|
101
101
|
// Using `project.addToBuildSettings` modifies too many targets.
|
|
102
|
-
if (name ===
|
|
103
|
-
typeof buildSettings?.PRODUCT_NAME !==
|
|
102
|
+
if (name === "Release" &&
|
|
103
|
+
typeof buildSettings?.PRODUCT_NAME !== "undefined") {
|
|
104
104
|
buildSettings['"EXCLUDED_ARCHS[sdk=iphonesimulator*]"'] = '"arm64"';
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
return project;
|
|
108
108
|
}
|
|
109
109
|
exports.setExcludedArchitectures = setExcludedArchitectures;
|
|
110
|
-
const withoutSignatures = config => {
|
|
110
|
+
const withoutSignatures = (config) => {
|
|
111
111
|
const shellScript = `if [ "$XCODE_VERSION_MAJOR" = "1500" ]; then
|
|
112
112
|
echo "Remove signature files (Xcode 15 workaround)";
|
|
113
113
|
rm -rf "$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature";
|
|
114
114
|
fi`;
|
|
115
115
|
return (0, config_plugins_1.withXcodeProject)(config, async (config) => {
|
|
116
116
|
const xcodeProject = config.modResults;
|
|
117
|
-
xcodeProject.addBuildPhase([],
|
|
118
|
-
shellPath:
|
|
117
|
+
xcodeProject.addBuildPhase([], "PBXShellScriptBuildPhase", "Remove signature files (Xcode 15 workaround)", null, {
|
|
118
|
+
shellPath: "/bin/sh",
|
|
119
119
|
shellScript,
|
|
120
120
|
});
|
|
121
121
|
return config;
|
|
122
122
|
});
|
|
123
123
|
};
|
|
124
|
-
const withExcludedSimulatorArchitectures = c => {
|
|
125
|
-
return (0, config_plugins_1.withXcodeProject)(c, config => {
|
|
124
|
+
const withExcludedSimulatorArchitectures = (c) => {
|
|
125
|
+
return (0, config_plugins_1.withXcodeProject)(c, (config) => {
|
|
126
126
|
config.modResults = setExcludedArchitectures(config.modResults);
|
|
127
127
|
return config;
|
|
128
128
|
});
|
|
129
129
|
};
|
|
130
|
-
const withMapLibre = config => {
|
|
130
|
+
const withMapLibre = (config) => {
|
|
131
131
|
config = withoutSignatures(withExcludedSimulatorArchitectures(config));
|
|
132
132
|
return withCocoaPodsInstallerBlocks(config);
|
|
133
133
|
};
|
package/scripts/autogenerate.js
CHANGED
|
@@ -8,7 +8,7 @@ const ejs = require('ejs');
|
|
|
8
8
|
const {execSync} = require('child_process');
|
|
9
9
|
|
|
10
10
|
const prettier = require('prettier');
|
|
11
|
-
const prettierrc = require('
|
|
11
|
+
const prettierrc = require('eslint-config-universe');
|
|
12
12
|
|
|
13
13
|
const styleSpecJSON = require('../style-spec/v8.json');
|
|
14
14
|
|
package/.eslintignore
DELETED
package/.eslintrc.js
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
parser: '@babel/eslint-parser',
|
|
4
|
-
plugins: ['react', 'react-native', 'fp', 'import', 'prettier', 'jest'],
|
|
5
|
-
env: {
|
|
6
|
-
jest: true,
|
|
7
|
-
},
|
|
8
|
-
settings: {
|
|
9
|
-
react: {
|
|
10
|
-
version: require('./package.json').dependencies.react,
|
|
11
|
-
pragma: 'React',
|
|
12
|
-
},
|
|
13
|
-
'import/resolver': {
|
|
14
|
-
node: {
|
|
15
|
-
extensions: ['.js', '.jsx'],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
'import/ignore': ['react-native'],
|
|
19
|
-
parserOptions: {
|
|
20
|
-
ecmaFeatures: {
|
|
21
|
-
jsx: true,
|
|
22
|
-
modules: true,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
globals: {
|
|
27
|
-
fetch: true,
|
|
28
|
-
FormData: true,
|
|
29
|
-
GeoJSON: true,
|
|
30
|
-
requestAnimationFrame: true,
|
|
31
|
-
cancelAnimationFrame: true,
|
|
32
|
-
WebSocket: true,
|
|
33
|
-
__DEV__: true,
|
|
34
|
-
window: true,
|
|
35
|
-
document: true,
|
|
36
|
-
navigator: true,
|
|
37
|
-
XMLSerializer: true,
|
|
38
|
-
},
|
|
39
|
-
extends: [
|
|
40
|
-
'eslint:recommended',
|
|
41
|
-
'plugin:react/recommended',
|
|
42
|
-
'plugin:jest/recommended',
|
|
43
|
-
'prettier',
|
|
44
|
-
'@react-native',
|
|
45
|
-
],
|
|
46
|
-
rules: {
|
|
47
|
-
'react/no-deprecated': 'warn',
|
|
48
|
-
'react/no-string-refs': 'warn',
|
|
49
|
-
'import/named': [2],
|
|
50
|
-
'import/no-named-default': [0],
|
|
51
|
-
'import/order': [
|
|
52
|
-
'error',
|
|
53
|
-
{
|
|
54
|
-
groups: ['builtin', 'external', 'parent', 'sibling', 'index'],
|
|
55
|
-
'newlines-between': 'always',
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
'import/exports-last': [0],
|
|
59
|
-
'import/no-useless-path-segments': [2],
|
|
60
|
-
camelcase: [0],
|
|
61
|
-
'no-console': [0],
|
|
62
|
-
'import/prefer-default-export': 'off',
|
|
63
|
-
'jsx-a11y/href-no-hash': 'off',
|
|
64
|
-
'react/prop-types': [2],
|
|
65
|
-
quotes: [2, 'single'],
|
|
66
|
-
'eol-last': [0],
|
|
67
|
-
'no-continue': [1],
|
|
68
|
-
'class-methods-use-this': [0],
|
|
69
|
-
'no-bitwise': [1],
|
|
70
|
-
'prefer-destructuring': [1],
|
|
71
|
-
'consistent-return': [0],
|
|
72
|
-
'no-warning-comments': [1],
|
|
73
|
-
'no-mixed-requires': [0],
|
|
74
|
-
'no-return-assign': 0,
|
|
75
|
-
'no-underscore-dangle': [0],
|
|
76
|
-
'no-await-in-loop': 0,
|
|
77
|
-
'no-restricted-syntax': 0,
|
|
78
|
-
'no-use-before-define': ['error', {functions: false}],
|
|
79
|
-
'no-unused-expressions': ['error', {allowTaggedTemplates: true}],
|
|
80
|
-
'no-plusplus': ['error', {allowForLoopAfterthoughts: true}],
|
|
81
|
-
'prettier/prettier': [
|
|
82
|
-
'error',
|
|
83
|
-
{
|
|
84
|
-
singleQuote: true,
|
|
85
|
-
trailingComma: 'all',
|
|
86
|
-
bracketSpacing: false,
|
|
87
|
-
},
|
|
88
|
-
],
|
|
89
|
-
'fp/no-mutating-methods': 'warn',
|
|
90
|
-
},
|
|
91
|
-
overrides: [
|
|
92
|
-
// Match TypeScript Files
|
|
93
|
-
// =================================
|
|
94
|
-
{
|
|
95
|
-
files: ['**/*.{ts,tsx}'],
|
|
96
|
-
|
|
97
|
-
// Global ESLint Settings
|
|
98
|
-
// =================================
|
|
99
|
-
env: {
|
|
100
|
-
jest: true,
|
|
101
|
-
es6: true,
|
|
102
|
-
browser: true,
|
|
103
|
-
node: true,
|
|
104
|
-
},
|
|
105
|
-
globals: {
|
|
106
|
-
__DEV__: true,
|
|
107
|
-
element: true,
|
|
108
|
-
by: true,
|
|
109
|
-
waitFor: true, // detox e2e
|
|
110
|
-
},
|
|
111
|
-
settings: {
|
|
112
|
-
'import/resolver': {
|
|
113
|
-
node: {
|
|
114
|
-
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
react: {
|
|
118
|
-
version: 'detect', // React version. "detect" automatically picks the version you have installed.
|
|
119
|
-
// You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
|
|
120
|
-
// default to latest and warns if missing
|
|
121
|
-
// It will default to "detect" in the future
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
// Parser Settings
|
|
126
|
-
parser: '@typescript-eslint/parser',
|
|
127
|
-
parserOptions: {
|
|
128
|
-
project: [
|
|
129
|
-
'./tsconfig.json',
|
|
130
|
-
'./example/tsconfig.json',
|
|
131
|
-
'./plugin/src/__tests__/tsconfig.eslint.json',
|
|
132
|
-
],
|
|
133
|
-
// Lint with Type Information
|
|
134
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/TYPED_LINTING.md
|
|
135
|
-
tsconfigRootDir: __dirname,
|
|
136
|
-
ecmaFeatures: {
|
|
137
|
-
experimentalObjectRestSpread: true,
|
|
138
|
-
jsx: true,
|
|
139
|
-
},
|
|
140
|
-
sourceType: 'module',
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
// Extend Other Configs
|
|
144
|
-
// =================================
|
|
145
|
-
extends: [
|
|
146
|
-
'plugin:@typescript-eslint/recommended',
|
|
147
|
-
'@react-native',
|
|
148
|
-
'eslint:recommended',
|
|
149
|
-
'plugin:react/recommended',
|
|
150
|
-
'prettier',
|
|
151
|
-
],
|
|
152
|
-
plugins: ['react', 'react-hooks', '@typescript-eslint', 'prettier'],
|
|
153
|
-
rules: {
|
|
154
|
-
// turn these one to check where all the return types are missing
|
|
155
|
-
// and where arguments of functions are not typed
|
|
156
|
-
'@typescript-eslint/explicit-function-return-type': ['error'],
|
|
157
|
-
'@typescript-eslint/explicit-module-boundary-types': ['error'],
|
|
158
|
-
'@typescript-eslint/no-unused-vars': ['error'],
|
|
159
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
160
|
-
'no-unused-vars': 'off',
|
|
161
|
-
'no-use-before-define': 'off',
|
|
162
|
-
'@typescript-eslint/no-use-before-define': 'off',
|
|
163
|
-
'react/prop-types': 'off',
|
|
164
|
-
'react-hooks/rules-of-hooks': 'error',
|
|
165
|
-
'react-hooks/exhaustive-deps': 'warn',
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
],
|
|
169
|
-
};
|
package/.prettierrc.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const {existsSync} = require(`fs`);
|
|
4
|
-
const {createRequire, register} = require(`module`);
|
|
5
|
-
const {resolve} = require(`path`);
|
|
6
|
-
const {pathToFileURL} = require(`url`);
|
|
7
|
-
|
|
8
|
-
const relPnpApiPath = "../../../../.pnp.cjs";
|
|
9
|
-
|
|
10
|
-
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
11
|
-
const absRequire = createRequire(absPnpApiPath);
|
|
12
|
-
|
|
13
|
-
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
|
14
|
-
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
|
15
|
-
|
|
16
|
-
if (existsSync(absPnpApiPath)) {
|
|
17
|
-
if (!process.versions.pnp) {
|
|
18
|
-
// Setup the environment to be able to require eslint/bin/eslint.js
|
|
19
|
-
require(absPnpApiPath).setup();
|
|
20
|
-
if (isPnpLoaderEnabled && register) {
|
|
21
|
-
register(pathToFileURL(absPnpLoaderPath));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Defer to the real eslint/bin/eslint.js your application uses
|
|
27
|
-
module.exports = absRequire(`eslint/bin/eslint.js`);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const {existsSync} = require(`fs`);
|
|
4
|
-
const {createRequire, register} = require(`module`);
|
|
5
|
-
const {resolve} = require(`path`);
|
|
6
|
-
const {pathToFileURL} = require(`url`);
|
|
7
|
-
|
|
8
|
-
const relPnpApiPath = "../../../../.pnp.cjs";
|
|
9
|
-
|
|
10
|
-
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
11
|
-
const absRequire = createRequire(absPnpApiPath);
|
|
12
|
-
|
|
13
|
-
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
|
14
|
-
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
|
15
|
-
|
|
16
|
-
if (existsSync(absPnpApiPath)) {
|
|
17
|
-
if (!process.versions.pnp) {
|
|
18
|
-
// Setup the environment to be able to require eslint
|
|
19
|
-
require(absPnpApiPath).setup();
|
|
20
|
-
if (isPnpLoaderEnabled && register) {
|
|
21
|
-
register(pathToFileURL(absPnpLoaderPath));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Defer to the real eslint your application uses
|
|
27
|
-
module.exports = absRequire(`eslint`);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const {existsSync} = require(`fs`);
|
|
4
|
-
const {createRequire, register} = require(`module`);
|
|
5
|
-
const {resolve} = require(`path`);
|
|
6
|
-
const {pathToFileURL} = require(`url`);
|
|
7
|
-
|
|
8
|
-
const relPnpApiPath = "../../../../.pnp.cjs";
|
|
9
|
-
|
|
10
|
-
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
11
|
-
const absRequire = createRequire(absPnpApiPath);
|
|
12
|
-
|
|
13
|
-
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
|
14
|
-
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
|
15
|
-
|
|
16
|
-
if (existsSync(absPnpApiPath)) {
|
|
17
|
-
if (!process.versions.pnp) {
|
|
18
|
-
// Setup the environment to be able to require eslint/use-at-your-own-risk
|
|
19
|
-
require(absPnpApiPath).setup();
|
|
20
|
-
if (isPnpLoaderEnabled && register) {
|
|
21
|
-
register(pathToFileURL(absPnpLoaderPath));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Defer to the real eslint/use-at-your-own-risk your application uses
|
|
27
|
-
module.exports = absRequire(`eslint/use-at-your-own-risk`);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "eslint",
|
|
3
|
-
"version": "8.56.0-sdk",
|
|
4
|
-
"main": "./lib/api.js",
|
|
5
|
-
"type": "commonjs",
|
|
6
|
-
"bin": {
|
|
7
|
-
"eslint": "./bin/eslint.js"
|
|
8
|
-
},
|
|
9
|
-
"exports": {
|
|
10
|
-
"./package.json": "./package.json",
|
|
11
|
-
".": "./lib/api.js",
|
|
12
|
-
"./use-at-your-own-risk": "./lib/unsupported-api.js"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const {existsSync} = require(`fs`);
|
|
4
|
-
const {createRequire, register} = require(`module`);
|
|
5
|
-
const {resolve} = require(`path`);
|
|
6
|
-
const {pathToFileURL} = require(`url`);
|
|
7
|
-
|
|
8
|
-
const relPnpApiPath = "../../../../.pnp.cjs";
|
|
9
|
-
|
|
10
|
-
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
11
|
-
const absRequire = createRequire(absPnpApiPath);
|
|
12
|
-
|
|
13
|
-
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
|
14
|
-
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
|
15
|
-
|
|
16
|
-
if (existsSync(absPnpApiPath)) {
|
|
17
|
-
if (!process.versions.pnp) {
|
|
18
|
-
// Setup the environment to be able to require prettier/bin/prettier.cjs
|
|
19
|
-
require(absPnpApiPath).setup();
|
|
20
|
-
if (isPnpLoaderEnabled && register) {
|
|
21
|
-
register(pathToFileURL(absPnpLoaderPath));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Defer to the real prettier/bin/prettier.cjs your application uses
|
|
27
|
-
module.exports = absRequire(`prettier/bin/prettier.cjs`);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const {existsSync} = require(`fs`);
|
|
4
|
-
const {createRequire, register} = require(`module`);
|
|
5
|
-
const {resolve} = require(`path`);
|
|
6
|
-
const {pathToFileURL} = require(`url`);
|
|
7
|
-
|
|
8
|
-
const relPnpApiPath = "../../../.pnp.cjs";
|
|
9
|
-
|
|
10
|
-
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
11
|
-
const absRequire = createRequire(absPnpApiPath);
|
|
12
|
-
|
|
13
|
-
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
|
14
|
-
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
|
15
|
-
|
|
16
|
-
if (existsSync(absPnpApiPath)) {
|
|
17
|
-
if (!process.versions.pnp) {
|
|
18
|
-
// Setup the environment to be able to require prettier
|
|
19
|
-
require(absPnpApiPath).setup();
|
|
20
|
-
if (isPnpLoaderEnabled && register) {
|
|
21
|
-
register(pathToFileURL(absPnpLoaderPath));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Defer to the real prettier your application uses
|
|
27
|
-
module.exports = absRequire(`prettier`);
|