txnbot - rewrite and lint (#53)
resolves #46 Co-authored-by: johba <johba@harb.eth> Reviewed-on: https://codeberg.org/johba/harb/pulls/53
This commit is contained in:
parent
dc61771dfc
commit
514be62cbb
19 changed files with 736 additions and 429 deletions
65
services/txnBot/eslint.config.js
Normal file
65
services/txnBot/eslint.config.js
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
import eslint from '@eslint/js';
|
||||
import tseslint from '@typescript-eslint/eslint-plugin';
|
||||
import tsparser from '@typescript-eslint/parser';
|
||||
import eslintConfigPrettier from 'eslint-config-prettier';
|
||||
|
||||
export default [
|
||||
eslint.configs.recommended,
|
||||
{
|
||||
files: ['src/**/*.ts'],
|
||||
languageOptions: {
|
||||
parser: tsparser,
|
||||
parserOptions: {
|
||||
ecmaVersion: 2022,
|
||||
sourceType: 'module',
|
||||
project: './tsconfig.json',
|
||||
},
|
||||
globals: {
|
||||
process: 'readonly',
|
||||
fetch: 'readonly',
|
||||
setInterval: 'readonly',
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
'@typescript-eslint': tseslint,
|
||||
},
|
||||
rules: {
|
||||
indent: ['error', 2, { SwitchCase: 1 }],
|
||||
'max-len': ['error', { code: 140, ignoreUrls: true, ignoreStrings: true }],
|
||||
'no-unused-vars': 'off',
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{
|
||||
argsIgnorePattern: '^_',
|
||||
varsIgnorePattern: '^_',
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/no-explicit-any': 'error',
|
||||
'@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }],
|
||||
'@typescript-eslint/naming-convention': [
|
||||
'error',
|
||||
{
|
||||
selector: 'variable',
|
||||
format: ['camelCase', 'UPPER_CASE'],
|
||||
filter: {
|
||||
regex: '^__',
|
||||
match: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
selector: 'function',
|
||||
format: ['camelCase'],
|
||||
},
|
||||
{
|
||||
selector: 'typeLike',
|
||||
format: ['PascalCase'],
|
||||
},
|
||||
],
|
||||
'no-console': 'error',
|
||||
complexity: 'off',
|
||||
'max-lines': 'off',
|
||||
'max-statements': 'off',
|
||||
},
|
||||
},
|
||||
eslintConfigPrettier,
|
||||
];
|
||||
Loading…
Add table
Add a link
Reference in a new issue