Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina committed Mar 31, 2023
1 parent 0ab7426 commit 9564a2a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ module.exports = {
'sonarjs/no-identical-functions': 'error',
'sonarjs/no-unused-collection': 'error',
'sonarjs/no-extra-arguments': 'error',

'unicorn/no-useless-undefined': 'error',
// Strict Mode (http://eslint.org/docs/rules/#strict-mode)
strict: 0,

Expand Down
12 changes: 4 additions & 8 deletions packages/cm6-graphql/src/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import { GraphQLSchema } from 'graphql';
import { GqlExtensionsOptions } from './interfaces';

const schemaEffect = StateEffect.define<GraphQLSchema | undefined>();
const schemaStateField = StateField.define<GraphQLSchema | undefined>({
create() {
return undefined;
},
const schemaStateField = StateField.define<GraphQLSchema | void>({
create() {},
update(schema, tr) {
for (const e of tr.effects) {
if (e.is(schemaEffect)) {
Expand All @@ -20,10 +18,8 @@ const schemaStateField = StateField.define<GraphQLSchema | undefined>({
});

const optionsEffect = StateEffect.define<GqlExtensionsOptions | undefined>();
const optionsStateField = StateField.define<GqlExtensionsOptions | undefined>({
create() {
return undefined;
},
const optionsStateField = StateField.define<GqlExtensionsOptions | void>({
create() {},
update(opts, tr) {
for (const e of tr.effects) {
if (e.is(optionsEffect)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-react/src/editor/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ export function EditorContextProvider(props: EditorContextProviderProps) {
[storage, tabState, headerEditor],
);

const lastShouldPersistHeadersProp = useRef<boolean | undefined>(undefined);
const lastShouldPersistHeadersProp = useRef<boolean | undefined>();
useEffect(() => {
const propValue = Boolean(props.shouldPersistHeaders);
if (lastShouldPersistHeadersProp.current !== propValue) {
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-react/src/execution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ function tryParseJsonObject({
errorMessageParse: string;
errorMessageType: string;
}) {
let parsed: Record<string, any> | undefined = undefined;
let parsed: Record<string, any> | undefined;
try {
parsed = json && json.trim() !== '' ? JSON.parse(json) : undefined;
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql/src/components/GraphiQL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export function GraphiQLInterface(props: GraphiQLInterfaceProps) {
props.defaultEditorToolsVisibility === 'variables' ||
props.defaultEditorToolsVisibility === 'headers'
) {
return undefined;
return;
}

if (typeof props.defaultEditorToolsVisibility === 'boolean') {
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-language-service-server/src/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class Logger implements VSCodeLogger {
}

_log(message: string, severityKey: SeverityEnum): void {
const timestamp = new Date().toLocaleString(undefined);
const timestamp = new Date().toLocaleString();
const severity = DIAGNOSTIC_SEVERITY[severityKey];
const { pid } = process;

Expand Down
2 changes: 1 addition & 1 deletion packages/vscode-graphql-execution/src/helpers/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class SourceHelper {
JSON.parse(value);
return null;
} catch {
return undefined;
return;
}
}
} catch {
Expand Down

0 comments on commit 9564a2a

Please sign in to comment.