diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..579d73e7 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,71 @@ +import Vue from 'eslint-plugin-vue'; + +import { FlatCompat } from '@eslint/eslintrc'; +import js from '@eslint/js'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const compat = new FlatCompat({ + baseDirectory: __dirname, +}); + +export default [ + ...Vue.configs['flat/recommended'], + js.configs.recommended, + ...compat.extends('@vue/eslint-config-typescript/recommended'), + ...compat.extends('@vue/eslint-config-prettier'), + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + }, + }, + }, + { + files: ['**/*.{js,mjs,cjs,ts,mts,cts,tsx,vue}'], + + rules: { + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'class-methods-use-this': 0, + // disable eslint no-shadow as it's causing false positives on typescript enums + 'no-shadow': 'off', + 'prettier/prettier': ['error'], + '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], + // '@typescript-eslint/naming-convention': [ + // 'error', + // { + // selector: 'default', + // format: ['camelCase'], + // }, + // { + // selector: 'variable', + // format: ['camelCase', 'UPPER_CASE'], + // }, + // { + // selector: 'parameter', + // format: ['camelCase'], + // leadingUnderscore: 'allow', + // }, + // { + // selector: 'memberLike', + // modifiers: ['private'], + // format: ['camelCase'], + // leadingUnderscore: 'require', + // }, + // { + // selector: 'typeLike', + // format: ['PascalCase'], + // }, + // { + // selector: 'class', + // format: ['PascalCase'], + // }, + // ], + }, + }, +]; diff --git a/src/views/ChartsView.vue b/src/views/ChartsView.vue index 1d9ee16c..fd01e2e7 100644 --- a/src/views/ChartsView.vue +++ b/src/views/ChartsView.vue @@ -52,7 +52,7 @@ const availablePairs = computed(() => { if (finalTimeframe.value && finalTimeframe.value !== '') { const tf = finalTimeframe.value; return botStore.activeBot.pairlistWithTimeframe - .filter(([pair, timeframe]) => { + .filter(([_, timeframe]) => { // console.log(pair, timeframe, tf); return timeframe === tf; })