updated lint rules

pull/280/head
Vladimir Mandic 2021-02-13 09:16:41 -05:00
parent 36058ac875
commit 17c9aa6583
10 changed files with 32 additions and 15 deletions

View File

@ -8,8 +8,11 @@
"jquery": true,
"es2020": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": { "ecmaVersion": 2020 },
"plugins": [ ],
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:import/errors",
@ -17,6 +20,8 @@
"plugin:node/recommended",
"plugin:promise/recommended",
"plugin:json/recommended-with-comments",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"airbnb-base"
],
"ignorePatterns": [ "dist", "assets", "media", "models", "node_modules" ],
@ -29,6 +34,7 @@
"import/no-absolute-path": "off",
"import/no-extraneous-dependencies": "off",
"import/prefer-default-export": "off",
"import/no-unresolved": "off",
"max-len": [1, 275, 3],
"newline-per-chained-call": "off",
"no-async-promise-executor": "off",
@ -48,6 +54,10 @@
"node/no-unpublished-import": "off",
"node/no-unpublished-require": "off",
"node/no-unsupported-features/es-syntax": "off",
"node/no-missing-import": ["error", {
"allowModules": [],
"tryExtensions": [".js", ".json", ".ts"]
}],
"node/shebang": "off",
"object-curly-newline": "off",
"prefer-destructuring": "off",
@ -55,6 +65,11 @@
"promise/always-return": "off",
"promise/catch-or-return": "off",
"promise/no-nesting": "off",
"radix": "off"
"radix": "off",
"lines-between-class-members": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off"
}
}

View File

@ -44,7 +44,9 @@ class GLBench {
constructor(gl, settings = {}) {
this.css = UICSS;
this.svg = UISVG;
// eslint-disable-next-line @typescript-eslint/no-empty-function
this.paramLogger = () => {};
// eslint-disable-next-line @typescript-eslint/no-empty-function
this.chartLogger = () => {};
this.chartLen = 20;
this.chartHz = 20;

View File

@ -32,25 +32,28 @@
"@tensorflow/tfjs-layers": "^3.0.0",
"@tensorflow/tfjs-node": "^3.0.0",
"@tensorflow/tfjs-node-gpu": "^3.0.0",
"@types/node": "^14.14.27",
"@typescript-eslint/eslint-plugin": "^4.15.0",
"@typescript-eslint/parser": "^4.15.0",
"@vladmandic/pilogger": "^0.2.14",
"chokidar": "^3.5.1",
"dayjs": "^1.10.4",
"esbuild": "^0.8.43",
"eslint": "^7.19.0",
"esbuild": "^0.8.45",
"eslint": "^7.20.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-json": "^2.1.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-promise": "^4.3.1",
"rimraf": "^3.0.2",
"seedrandom": "^3.0.5",
"simple-git": "^2.34.2",
"tslib": "^2.1.0",
"typescript": "^4.2.0-dev.20210208"
"typescript": "^4.3.0-dev.20210213"
},
"scripts": {
"start": "node --trace-warnings --unhandled-rejections=strict --trace-uncaught --no-deprecation src/node.js",
"lint": "eslint src/*.js demo/*.js",
"lint": "eslint src demo server",
"dev": "npm install && node server/serve.js",
"build": "rimraf dist/* && rimraf types/* && node server/build.js && node server/changelog.js",
"update": "npm update --depth 20 --force && npm dedupe && npm prune && npm audit"

View File

@ -1,6 +1,6 @@
import { log } from '../log';
import * as tf from '../../dist/tfjs.esm.js';
import * as profile from '../profile.js';
import * as profile from '../profile';
let model;
let last = { age: 0 };

View File

@ -1,6 +1,6 @@
import { log } from '../log';
import * as tf from '../../dist/tfjs.esm.js';
import * as profile from '../profile.js';
import * as profile from '../profile';
const annotations = ['angry', 'disgust', 'fear', 'happy', 'sad', 'surprise', 'neutral'];
let model;

View File

@ -1,6 +1,6 @@
import { log } from '../log';
import * as tf from '../../dist/tfjs.esm.js';
import * as profile from '../profile.js';
import * as profile from '../profile';
let model;
let last = { gender: '' };

View File

@ -62,7 +62,7 @@ export const hand = (res) => {
if (!res) return [];
const gestures: Array<{ hand: number, gesture: string }> = [];
for (let i = 0; i < res.length; i++) {
const fingers: Array<{ name: string, position: number }> = [];
const fingers: Array<{ name: string, position: number }> = [];
for (const [finger, pos] of Object.entries(res[i]['annotations'])) {
// @ts-ignore
if (finger !== 'palmBase') fingers.push({ name: finger.toLowerCase(), position: pos[0] }); // get tip of each finger

View File

@ -1,8 +1,6 @@
import * as tf from '../../dist/tfjs.esm.js';
import * as box from './box';
import * as util from './util';
// eslint-disable-next-line no-unused-vars
import { log } from '../log';
// const PALM_BOX_SHIFT_VECTOR = [0, -0.4];
const PALM_BOX_ENLARGE_FACTOR = 5; // default 3

View File

@ -15,7 +15,6 @@ import * as profile from './profile';
import * as config from '../config';
import * as sample from './sample';
import * as app from '../package.json';
import { NodeFileSystem } from '@tensorflow/tfjs-node/dist/io/file_system';
// helper function: gets elapsed time on both browser and nodejs
const now = () => {

View File

@ -2,7 +2,7 @@ import { log } from './log';
export const data = {};
export function run(name, raw) {
export function run(name: string, raw: any) {
if (!raw || !raw.kernels) return;
const maxResults = 5;
const time = raw.kernels