Skip to content

Commit

Permalink
fix eslint core rules
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed May 15, 2023
1 parent 6be358d commit 09a1226
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 13 deletions.
7 changes: 0 additions & 7 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ rules:
'import/no-extraneous-dependencies':
[error, { devDependencies: ['**/*.config.{js,ts}', 'tests/**'] }]

# FIXME: remove below rules
'no-var': off
'prefer-const': off

overrides:
- files: '**/*.js'
env:
Expand All @@ -45,9 +41,6 @@ overrides:
[error, index-signature]

# FIXME: remove below rules
'no-empty': off
'no-var': off
'prefer-const': off
'react/jsx-no-target-blank': off
'import/no-duplicates': off
'import/no-extraneous-dependencies': off
Expand Down
2 changes: 1 addition & 1 deletion src/editor/custom.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare module '*.css' {
var content: any;
const content: any;
export = content;
}
8 changes: 5 additions & 3 deletions src/editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class FakeEditor extends React.Component<any, FakeEditorState> {
}

saveUserSDL = () => {
let { value, hasUnsavedChanges } = this.state;
const { value, hasUnsavedChanges } = this.state;
if (!hasUnsavedChanges) return;

if (!this.updateSDL(value)) return;
Expand Down Expand Up @@ -161,7 +161,9 @@ class FakeEditor extends React.Component<any, FakeEditorState> {
let unsavedSchema = null as GraphQLSchema | null;
try {
unsavedSchema = this.buildSchema(val, { skipValidation: true });
} catch (_) {}
} catch (_) {
// FIXME
}

this.setState((prevState) => ({
...prevState,
Expand All @@ -172,7 +174,7 @@ class FakeEditor extends React.Component<any, FakeEditorState> {
};

render() {
let { value, activeTab, schema, hasUnsavedChanges, unsavedSchema } = this.state;
const { value, activeTab, schema, hasUnsavedChanges, unsavedSchema } = this.state;
if (value == null || schema == null) {
return <div className="faker-editor-container">Loading...</div>;
}
Expand Down
2 changes: 1 addition & 1 deletion src/fake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ const fakeFunctions = {
};

Object.keys(fakeFunctions).forEach((key) => {
var value = fakeFunctions[key];
const value = fakeFunctions[key];
if (typeof fakeFunctions[key] === 'function')
fakeFunctions[key] = { args: [], func: value };
});
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function prettyPrintValidationErrors(validationErrors: ValidationErrors) {
);

for (const error of subErrors) {
let [message, ...otherLines] = error.toString().split('\n');
const [message, ...otherLines] = error.toString().split('\n');
log([chalk.yellow(message), ...otherLines].join('\n') + '\n\n');
}
}

0 comments on commit 09a1226

Please sign in to comment.