mirror of
https://github.com/leon-ai/leon.git
synced 2024-08-16 21:50:33 +03:00
refactor: add ESLint rules about imports
This commit is contained in:
parent
f68da11f6b
commit
defc70128c
@ -2,8 +2,16 @@
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:import/recommended",
|
||||
"plugin:import/typescript",
|
||||
"prettier"
|
||||
],
|
||||
"settings": {
|
||||
"import/resolver": {
|
||||
"typescript": true,
|
||||
"node": true
|
||||
}
|
||||
},
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"env": {
|
||||
"node": true,
|
||||
@ -15,7 +23,7 @@
|
||||
"globals": {
|
||||
"io": true
|
||||
},
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"plugins": ["@typescript-eslint", "import"],
|
||||
"ignorePatterns": "*.spec.js",
|
||||
"rules": {
|
||||
"no-async-promise-executor": ["off"],
|
||||
@ -24,7 +32,23 @@
|
||||
"comma-dangle": ["error", "never"],
|
||||
"semi": ["error", "never"],
|
||||
"object-curly-spacing": ["error", "always"],
|
||||
"@typescript-eslint/explicit-function-return-type": "off"
|
||||
"@typescript-eslint/explicit-function-return-type": "off",
|
||||
"import/no-named-as-default": "off",
|
||||
"import/no-named-as-default-member": "off",
|
||||
"import/order": [
|
||||
"error",
|
||||
{
|
||||
"groups": [
|
||||
"builtin",
|
||||
"external",
|
||||
"internal",
|
||||
"parent",
|
||||
"sibling",
|
||||
"index"
|
||||
],
|
||||
"newlines-between": "always"
|
||||
}
|
||||
]
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
|
1446
package-lock.json
generated
1446
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -96,6 +96,8 @@
|
||||
"cli-spinner": "^0.2.10",
|
||||
"eslint": "8.22.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-import-resolver-typescript": "^3.5.1",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"git-changelog": "^2.0.0",
|
||||
"husky": "^7.0.0",
|
||||
"inquirer": "^8.1.0",
|
||||
|
@ -1,8 +1,9 @@
|
||||
import fs from 'node:fs'
|
||||
import os from 'node:os'
|
||||
|
||||
import dotenv from 'dotenv'
|
||||
import { command } from 'execa'
|
||||
import semver from 'semver'
|
||||
import fs from 'node:fs'
|
||||
import os from 'node:os'
|
||||
|
||||
import { version } from '@@/package.json'
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
|
@ -1,8 +1,9 @@
|
||||
import dotenv from 'dotenv'
|
||||
import crypto from 'crypto'
|
||||
import { prompt } from 'inquirer'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import crypto from 'node:crypto'
|
||||
|
||||
import dotenv from 'dotenv'
|
||||
import { prompt } from 'inquirer'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
import { StringHelper } from '@/helpers/string-helper'
|
||||
|
@ -1,10 +1,10 @@
|
||||
import dotenv from 'dotenv'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
import dotenv from 'dotenv'
|
||||
|
||||
import { langs } from '@@/core/langs.json'
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
import { SkillDomainHelper } from '@/helpers/skill-domain-helper'
|
||||
|
||||
dotenv.config()
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { command } from 'execa'
|
||||
import fs from 'node:fs'
|
||||
|
||||
import { command } from 'execa'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
|
||||
/**
|
||||
|
@ -4,6 +4,7 @@ import { LoaderHelper } from '@/helpers/loader-helper'
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
|
||||
import checkOs from '../check-os'
|
||||
|
||||
import setupHotword from './setup-hotword'
|
||||
import setupTts from './setup-tts'
|
||||
import setupStt from './setup-stt'
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { command } from 'execa'
|
||||
import fs from 'node:fs'
|
||||
|
||||
import { command } from 'execa'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
import { OSHelper } from '@/helpers/os-helper'
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { command } from 'execa'
|
||||
import fs from 'node:fs'
|
||||
|
||||
import { command } from 'execa'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
import { OSHelper } from '@/helpers/os-helper'
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { prompt } from 'inquirer'
|
||||
import fs from 'node:fs'
|
||||
|
||||
import { prompt } from 'inquirer'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { command } from 'execa'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
import { command } from 'execa'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { commandSync } from 'execa'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
import { commandSync } from 'execa'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
import { SkillDomainHelper } from '@/helpers/skill-domain-helper'
|
||||
|
||||
|
@ -3,6 +3,7 @@ import { LogHelper } from '@/helpers/log-helper'
|
||||
|
||||
import train from '../train/train'
|
||||
import generateHttpApiKey from '../generate/generate-http-api-key'
|
||||
|
||||
import setupDotenv from './setup-dotenv'
|
||||
import setupCore from './setup-core'
|
||||
import setupSkillsConfig from './setup-skills-config'
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { composeFromPattern } from '@nlpjs/utils'
|
||||
import path from 'node:path'
|
||||
import fs from 'node:fs'
|
||||
|
||||
import { composeFromPattern } from '@nlpjs/utils'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
import { StringHelper } from '@/helpers/string-helper'
|
||||
import { SkillDomainHelper } from '@/helpers/skill-domain-helper'
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { composeFromPattern } from '@nlpjs/utils'
|
||||
import path from 'node:path'
|
||||
import fs from 'node:fs'
|
||||
|
||||
import { composeFromPattern } from '@nlpjs/utils'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { composeFromPattern } from '@nlpjs/utils'
|
||||
import path from 'node:path'
|
||||
import fs from 'node:fs'
|
||||
|
||||
import { composeFromPattern } from '@nlpjs/utils'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
import { SkillDomainHelper } from '@/helpers/skill-domain-helper'
|
||||
|
||||
|
@ -5,6 +5,7 @@ import dotenv from 'dotenv'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
import { LangHelper } from '@/helpers/lang-helper'
|
||||
|
||||
import trainGlobalResolvers from './train-resolvers-model/train-global-resolvers'
|
||||
import trainSkillsResolvers from './train-resolvers-model/train-skills-resolvers'
|
||||
import trainGlobalEntities from './train-main-model/train-global-entities'
|
||||
|
@ -1,6 +1,7 @@
|
||||
import fs from 'node:fs'
|
||||
|
||||
import { path as ffmpegPath } from '@ffmpeg-installer/ffmpeg'
|
||||
import Ffmpeg from 'fluent-ffmpeg'
|
||||
import fs from 'node:fs'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
|
||||
|
@ -4,10 +4,10 @@ import { spawn } from 'node:child_process'
|
||||
|
||||
import { langs } from '@@/core/langs.json'
|
||||
import { HAS_TTS } from '@/constants'
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
import { StringHelper } from '@/helpers/string-helper'
|
||||
import { LangHelper } from '@/helpers/lang-helper'
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
import { SkillDomainHelper } from '@/helpers/skill-domain-helper'
|
||||
import { StringHelper } from '@/helpers/string-helper'
|
||||
import Synchronizer from '@/core/synchronizer'
|
||||
|
||||
class Brain {
|
||||
|
@ -1,5 +1,6 @@
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
import archiver from 'archiver'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { join } from 'node:path'
|
||||
|
||||
import Fastify from 'fastify'
|
||||
import fastifyStatic from '@fastify/static'
|
||||
import socketio from 'socket.io'
|
||||
import { join } from 'node:path'
|
||||
|
||||
import { version } from '@@/package.json'
|
||||
import { endpoints } from '@@/core/skills-endpoints.json'
|
||||
|
@ -1,12 +1,13 @@
|
||||
import fs from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { spawn } from 'node:child_process'
|
||||
|
||||
import { containerBootstrap } from '@nlpjs/core-loader'
|
||||
import { Nlp } from '@nlpjs/nlp'
|
||||
import { BuiltinMicrosoft } from '@nlpjs/builtin-microsoft'
|
||||
import { LangAll } from '@nlpjs/lang-all'
|
||||
import request from 'superagent'
|
||||
import kill from 'tree-kill'
|
||||
import fs from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { spawn } from 'node:child_process'
|
||||
|
||||
import { langs } from '@@/core/langs.json'
|
||||
import { version } from '@@/package.json'
|
||||
|
@ -1,8 +1,9 @@
|
||||
import { google } from 'googleapis'
|
||||
import { waterfall } from 'async'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
import { google } from 'googleapis'
|
||||
import { waterfall } from 'async'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
|
||||
class Synchronizer {
|
||||
|
@ -1,6 +1,7 @@
|
||||
import fs from 'node:fs'
|
||||
|
||||
import wav from 'node-wav'
|
||||
import { Model } from 'stt'
|
||||
import fs from 'node:fs'
|
||||
|
||||
import { IS_TESTING_ENV } from '@/constants'
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
|
@ -1,6 +1,7 @@
|
||||
import stt from '@google-cloud/speech'
|
||||
import path from 'node:path'
|
||||
|
||||
import stt from '@google-cloud/speech'
|
||||
|
||||
import { LANG } from '@/constants'
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
import Stt from 'ibm-watson/speech-to-text/v1'
|
||||
import { IamAuthenticator } from 'ibm-watson/auth'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import { Duplex } from 'node:stream'
|
||||
|
||||
import Stt from 'ibm-watson/speech-to-text/v1'
|
||||
import { IamAuthenticator } from 'ibm-watson/auth'
|
||||
|
||||
import { LANG } from '@/constants'
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
import { Polly, SynthesizeSpeechCommand } from '@aws-sdk/client-polly'
|
||||
import Ffmpeg from 'fluent-ffmpeg'
|
||||
import { path as ffmpegPath } from '@ffmpeg-installer/ffmpeg'
|
||||
import { path as ffprobePath } from '@ffprobe-installer/ffprobe'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
import { StringHelper } from '@/helpers/string-helper'
|
||||
|
@ -1,8 +1,9 @@
|
||||
import { spawn } from 'node:child_process'
|
||||
import fs from 'node:fs'
|
||||
|
||||
import Ffmpeg from 'fluent-ffmpeg'
|
||||
import { path as ffmpegPath } from '@ffmpeg-installer/ffmpeg'
|
||||
import { path as ffprobePath } from '@ffprobe-installer/ffprobe'
|
||||
import { spawn } from 'node:child_process'
|
||||
import fs from 'node:fs'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
import { StringHelper } from '@/helpers/string-helper'
|
||||
|
@ -1,9 +1,10 @@
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
import tts from '@google-cloud/text-to-speech'
|
||||
import Ffmpeg from 'fluent-ffmpeg'
|
||||
import { path as ffmpegPath } from '@ffmpeg-installer/ffmpeg'
|
||||
import { path as ffprobePath } from '@ffprobe-installer/ffprobe'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
import { StringHelper } from '@/helpers/string-helper'
|
||||
|
@ -1,10 +1,11 @@
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
import Tts from 'ibm-watson/text-to-speech/v1'
|
||||
import { IamAuthenticator } from 'ibm-watson/auth'
|
||||
import Ffmpeg from 'fluent-ffmpeg'
|
||||
import { path as ffmpegPath } from '@ffmpeg-installer/ffmpeg'
|
||||
import { path as ffprobePath } from '@ffprobe-installer/ffprobe'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
import { LogHelper } from '@/helpers/log-helper'
|
||||
import { StringHelper } from '@/helpers/string-helper'
|
||||
|
Loading…
Reference in New Issue
Block a user