Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit 7489b4c

Browse files
authored
Update eslint to latest version and fix issues reported (#1352)
* Whitespace fixes in gulpfile.js * Eslint: fix no-extra-semi * Eslint: fix no-useless-escape * Eslint: fix no-constant-condition * Eslint: fix no-extra-boolean-cast Also consistent with existing style in LibraryManager.tsx * Eslint: fix no-prototype-builtins * Eslint: fix prefer-const * Eslint: fix no-var * Eslint: fix no-case-declarations * Remove unused selectedBoard in reducer Added in commit 8895ade but never used at any time. * Eslint: fix no-unused-vars * Eslint: fix no-control-regex * Eslint: fix react/no-deprecated https://reactjs.org/docs/react-component.html#unsafe_componentwillmount * Eslint: fix react/no-direct-mutation-state * Add eslint configuration Created with npx eslint --init and added a couple of rule configurations manually. Synchronize gulp.src between tslint and eslint. * Update esllint to latest version * npm install --save-dev @types/glob * npm install --save-dev @types/uuid * npm install --save-dev @types/express * Remove unecessary await * Update to latest @types/node Some of the CI builds failed with .../vscode-arduino/vscode-arduino/node_modules/@types/connect/index.d.ts(20,42): error TS2689: Cannot extend an interface 'http.IncomingMessage'. Did you mean 'implements'? TypeScript: 1 semantic error and apparently this is caused by old @types/node version (previously version 6.14.9 in this project). DefinitelyTyped/DefinitelyTyped#41828 (comment) https://stackoverflow.com/a/59988564/23118 DefinitelyTyped/DefinitelyTyped#41092
1 parent 5e142af commit 7489b4c

36 files changed

+2632
-483
lines changed

.eslintrc.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
env:
2+
browser: true
3+
es6: true
4+
extends:
5+
- 'eslint:recommended'
6+
- 'plugin:react/recommended'
7+
- 'plugin:@typescript-eslint/eslint-recommended'
8+
globals:
9+
Atomics: readonly
10+
SharedArrayBuffer: readonly
11+
parser: '@typescript-eslint/parser'
12+
parserOptions:
13+
ecmaFeatures:
14+
jsx: true
15+
ecmaVersion: 2018
16+
sourceType: module
17+
plugins:
18+
- react
19+
- '@typescript-eslint'
20+
rules: {
21+
"no-empty": ["error", { "allowEmptyCatch": true }],
22+
"no-unused-vars": ["error", { "args": "none" }]
23+
}
24+

gulpfile.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const gulp = require("gulp");
22
const eslint = require("gulp-eslint");
33
const tslint = require("gulp-tslint");
4-
const PluginError = require("plugin-error");
5-
const log = require("fancy-log");
4+
const PluginError = require("plugin-error");
5+
const log = require("fancy-log");
66
const ts = require("gulp-typescript");
77
const sourcemaps = require("gulp-sourcemaps");
88
const webpack = require("webpack");
@@ -21,7 +21,7 @@ gulp.task("tslint", () => {
2121
});
2222

2323
gulp.task("eslint", () => {
24-
return gulp.src(["!**/node_modules/**"])
24+
return gulp.src(["**/*.ts", "**/*.tsx", "!**/*.d.ts", "!./vendor/**", "!node_modules/**", "!./src/views/node_modules/**", "!out/**"])
2525
.pipe(eslint())
2626
.pipe(eslint.format())
2727
.pipe(eslint.failAfterError());

0 commit comments

Comments
 (0)