Skip to content

Commit 09a1226

Browse files
committed
fix eslint core rules
1 parent 6be358d commit 09a1226

File tree

5 files changed

+8
-13
lines changed

5 files changed

+8
-13
lines changed

.eslintrc.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ rules:
1919
'import/no-extraneous-dependencies':
2020
[error, { devDependencies: ['**/*.config.{js,ts}', 'tests/**'] }]
2121

22-
# FIXME: remove below rules
23-
'no-var': off
24-
'prefer-const': off
25-
2622
overrides:
2723
- files: '**/*.js'
2824
env:
@@ -45,9 +41,6 @@ overrides:
4541
[error, index-signature]
4642

4743
# FIXME: remove below rules
48-
'no-empty': off
49-
'no-var': off
50-
'prefer-const': off
5144
'react/jsx-no-target-blank': off
5245
'import/no-duplicates': off
5346
'import/no-extraneous-dependencies': off

src/editor/custom.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
declare module '*.css' {
2-
var content: any;
2+
const content: any;
33
export = content;
44
}

src/editor/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class FakeEditor extends React.Component<any, FakeEditorState> {
126126
}
127127

128128
saveUserSDL = () => {
129-
let { value, hasUnsavedChanges } = this.state;
129+
const { value, hasUnsavedChanges } = this.state;
130130
if (!hasUnsavedChanges) return;
131131

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

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

174176
render() {
175-
let { value, activeTab, schema, hasUnsavedChanges, unsavedSchema } = this.state;
177+
const { value, activeTab, schema, hasUnsavedChanges, unsavedSchema } = this.state;
176178
if (value == null || schema == null) {
177179
return <div className="faker-editor-container">Loading...</div>;
178180
}

src/fake.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ const fakeFunctions = {
196196
};
197197

198198
Object.keys(fakeFunctions).forEach((key) => {
199-
var value = fakeFunctions[key];
199+
const value = fakeFunctions[key];
200200
if (typeof fakeFunctions[key] === 'function')
201201
fakeFunctions[key] = { args: [], func: value };
202202
});

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ function prettyPrintValidationErrors(validationErrors: ValidationErrors) {
193193
);
194194

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

0 commit comments

Comments
 (0)