Skip to content

Commit eda68ad

Browse files
committed
lint
1 parent 0be4827 commit eda68ad

File tree

5 files changed

+22
-23
lines changed

5 files changed

+22
-23
lines changed

modules/json/src/helpers/convert-functions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import {parseExpressionString} from './parse-expression-string';
66

77
import {FUNCTION_IDENTIFIER} from '../syntactic-sugar';
8-
import {type JSONConfiguration } from '../json-configuration';
8+
import {type JSONConfiguration} from '../json-configuration';
99

1010
function hasFunctionIdentifier(value) {
1111
return typeof value === 'string' && value.startsWith(FUNCTION_IDENTIFIER);
@@ -18,7 +18,7 @@ function trimFunctionIdentifier(value) {
1818
/**
1919
* Tries to determine if any props are "function valued"
2020
* and if so convert their string values to functions
21-
*/
21+
*/
2222
export function convertFunctions(props, configuration: JSONConfiguration) {
2323
// Use deck.gl prop types if available.
2424
const replacedProps = {};

modules/json/src/helpers/execute-function.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// SPDX-License-Identifier: MIT
33
// Copyright (c) vis.gl contributors
44

5-
import {type JSONConfiguration } from "../json-configuration";
5+
import {type JSONConfiguration} from '../json-configuration';
66

7-
/**
7+
/**
88
* Attempt to execute a function
99
*/
1010
export function executeFunction(targetFunction, props, configuration: JSONConfiguration) {

modules/json/src/helpers/instantiate-class.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// SPDX-License-Identifier: MIT
33
// Copyright (c) vis.gl contributors
44

5-
import { JSONConfiguration } from '../json-configuration';
6-
import{ convertFunctions } from './convert-functions';
5+
import {JSONConfiguration} from '../json-configuration';
6+
import {convertFunctions} from './convert-functions';
77

88
/**
99
* Attempt to instantiate a class, either as a class or as a React component

modules/json/src/json-configuration.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
// SPDX-License-Identifier: MIT
33
// Copyright (c) vis.gl contributors
44

5-
6-
import { TYPE_KEY, FUNCTION_KEY } from './syntactic-sugar';
5+
import {TYPE_KEY, FUNCTION_KEY} from './syntactic-sugar';
76
// TODO - default parsing code should not be part of the configuration.
8-
import { parseExpressionString } from './helpers/parse-expression-string';
7+
import {parseExpressionString} from './helpers/parse-expression-string';
98

109
const isObject = value => value && typeof value === 'object';
1110

@@ -31,7 +30,7 @@ export class JSONConfiguration {
3130
enumerations: {},
3231
constants: {},
3332
functions: {},
34-
React: undefined!,
33+
React: undefined!
3534
};
3635

3736
config: Required<JSONConfigurationProps> = {...JSONConfiguration.defaultProps};

modules/json/src/json-converter.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
// SPDX-License-Identifier: MIT
33
// Copyright (c) vis.gl contributors
44

5-
import { JSONConfiguration } from './json-configuration';
6-
import { FUNCTION_IDENTIFIER, CONSTANT_IDENTIFIER, FUNCTION_KEY } from './syntactic-sugar';
7-
import { instantiateClass } from './helpers/instantiate-class';
8-
import { executeFunction } from './helpers/execute-function';
5+
import {JSONConfiguration} from './json-configuration';
6+
import {FUNCTION_IDENTIFIER, CONSTANT_IDENTIFIER, FUNCTION_KEY} from './syntactic-sugar';
7+
import {instantiateClass} from './helpers/instantiate-class';
8+
import {executeFunction} from './helpers/execute-function';
99
import {assert} from './utils/assert';
1010
import {parseJSON} from './helpers/parse-json';
1111

@@ -15,9 +15,9 @@ export type JSONConverterProps = JSONConfiguration & {
1515
onJSONChange: () => void;
1616
};
1717

18-
/**
18+
/**
1919
* Converts JSON to "props" by "hydrating" classes, resolving enums and functions etc.
20-
*
20+
*
2121
* Lightly processes `json` props, transform string values, and extract `views` and `layers`
2222
* @see https://github.com/visgl/deck.gl/blob/master/dev-docs/RFCs/v6.1/json-layers-rfc.md
2323
*
@@ -30,7 +30,7 @@ export type JSONConverterProps = JSONConfiguration & {
3030
export class JSONConverter {
3131
log = console; // eslint-disable-line
3232
configuration!: JSONConfiguration;
33-
onJSONChange = () => { };
33+
onJSONChange = () => {};
3434
json = null;
3535
convertedJson = null;
3636

@@ -39,7 +39,7 @@ export class JSONConverter {
3939
}
4040

4141
// eslint-disable-next-line @typescript-eslint/no-empty-function
42-
finalize() { }
42+
finalize() {}
4343

4444
setProps(props: JSONConverterProps) {
4545
// HANDLE CONFIGURATION PROPS
@@ -122,18 +122,18 @@ function convertJSONRecursively(json, key, configuration) {
122122

123123
/** Returns true if an object has a `type` field */
124124
function isClassInstance(json, configuration) {
125-
const { typeKey } = configuration;
125+
const {typeKey} = configuration;
126126
const isClass = isObject(json) && Boolean(json[typeKey]);
127127
return isClass;
128128
}
129129

130130
function convertClassInstance(json, configuration) {
131131
// Extract the class type field
132-
const { typeKey } = configuration;
132+
const {typeKey} = configuration;
133133
const type = json[typeKey];
134134

135135
// Prepare a props object and ensure all values have been converted
136-
let props = { ...json };
136+
let props = {...json};
137137
delete props[typeKey];
138138

139139
props = convertPlainObject(props, configuration);
@@ -144,11 +144,11 @@ function convertClassInstance(json, configuration) {
144144
/** Plain JS object, embed functions. */
145145
function convertFunctionObject(json, configuration) {
146146
// Extract the target function field
147-
const { functionKey } = configuration;
147+
const {functionKey} = configuration;
148148
const targetFunction = json[functionKey];
149149

150150
// Prepare a props object and ensure all values have been converted
151-
let props = { ...json };
151+
let props = {...json};
152152
delete props[functionKey];
153153

154154
props = convertPlainObject(props, configuration);

0 commit comments

Comments
 (0)