Skip to content

Commit

Permalink
chore: Minor improvements in tests and configuration (#7)
Browse files Browse the repository at this point in the history
* test: Remove unused variables and redundant lines

* chore: Replace Prettier => ESLint Stylistic to use with the linter

* style: Fix linter warnings in tests and config

* test: Fix logic for the "YieldStreamer.assignAccountGroup()" function

* test: Check the argument of the "BlocklistedAccount" error in tests

* chore: Update dependencies

* test: Fix checking the reverting conditions for a function
  • Loading branch information
EvgeniiZaitsevCW authored Apr 17, 2024
1 parent 87d2729 commit 236dbcb
Show file tree
Hide file tree
Showing 7 changed files with 634 additions and 346 deletions.
89 changes: 84 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,99 @@
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
"plugin:@stylistic/recommended-extends"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"plugins": ["@typescript-eslint", "@stylistic"],
"rules": {
"prettier/prettier": [
"@stylistic/array-bracket-newline": ["warn", "consistent"],
"@stylistic/array-element-newline": ["warn", "consistent"],
"@stylistic/arrow-parens": ["warn", "as-needed"],
"@stylistic/brace-style": ["warn", "1tbs", {"allowSingleLine": true}],
"@stylistic/comma-dangle": ["warn", "never"],
"@stylistic/dot-location": ["warn", "property"],
"@stylistic/eol-last": ["warn", "always"],
"@stylistic/function-call-argument-newline": ["warn", "consistent"],
"@stylistic/function-paren-newline": ["warn", "multiline-arguments"],
"@stylistic/indent": ["warn", 2],
"@stylistic/indent-binary-ops": ["warn", 2],
"@stylistic/linebreak-style": ["warn", "unix"],
"@stylistic/lines-around-comment": ["warn", {"beforeBlockComment": false}],
"@stylistic/max-len": ["warn", {"code": 120, "tabWidth": 2}],
"@stylistic/member-delimiter-style": [
"warn",
{
"endOfLine": "lf"
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
]
],
"@stylistic/newline-per-chained-call": ["warn", {"ignoreChainWithDepth": 5}],
"@stylistic/object-property-newline": ["warn", {"allowAllPropertiesOnSameLine": true}],
"@stylistic/operator-linebreak": ["warn", "after", {"overrides": {"?": "before", ":": "before"}}],
"@stylistic/quotes": ["warn", "double", {"avoidEscape": true, "allowTemplateLiterals": true}],
"@stylistic/semi": ["warn", "always"],
"@stylistic/spaced-comment": ["warn", "always"],

"@stylistic/array-bracket-spacing": "warn",
"@stylistic/arrow-spacing": "warn",
"@stylistic/block-spacing": "warn",
"@stylistic/comma-spacing": "warn",
"@stylistic/comma-style": "warn",
"@stylistic/computed-property-spacing": "warn",
"@stylistic/func-call-spacing": "warn",
"@stylistic/function-call-spacing": "warn",
"@stylistic/generator-star-spacing": "warn",
"@stylistic/implicit-arrow-linebreak": "warn",
"@stylistic/key-spacing": "warn",
"@stylistic/keyword-spacing": "warn",
"@stylistic/lines-between-class-members": "warn",
"@stylistic/max-statements-per-line": "warn",
"@stylistic/multiline-ternary": "warn",
"@stylistic/new-parens": "warn",
"@stylistic/no-confusing-arrow": "warn",
"@stylistic/no-extra-parens": "warn",
"@stylistic/no-extra-semi": "warn",
"@stylistic/no-floating-decimal": "warn",
"@stylistic/no-mixed-operators": "warn",
"@stylistic/no-mixed-spaces-and-tabs": "warn",
"@stylistic/no-multi-spaces": "warn",
"@stylistic/no-multiple-empty-lines": "warn",
"@stylistic/no-tabs": "warn",
"@stylistic/no-trailing-spaces": "warn",
"@stylistic/no-whitespace-before-property": "warn",
"@stylistic/nonblock-statement-body-position": "warn",
"@stylistic/object-curly-newline": "warn",
"@stylistic/object-curly-spacing": "warn",
"@stylistic/one-var-declaration-per-line": "warn",
"@stylistic/padded-blocks": "warn",
"@stylistic/padding-line-between-statements": "warn",
"@stylistic/quote-props": "warn",
"@stylistic/rest-spread-spacing": "warn",
"@stylistic/semi-spacing": "warn",
"@stylistic/semi-style": "warn",
"@stylistic/space-before-blocks": "warn",
"@stylistic/space-before-function-paren": "warn",
"@stylistic/space-in-parens": "warn",
"@stylistic/space-infix-ops": "warn",
"@stylistic/space-unary-ops": "warn",
"@stylistic/switch-colon-spacing": "warn",
"@stylistic/template-curly-spacing": "warn",
"@stylistic/template-tag-spacing": "warn",
"@stylistic/type-annotation-spacing": "warn",
"@stylistic/type-generic-spacing": "warn",
"@stylistic/type-named-tuple-spacing": "warn",
"@stylistic/wrap-iife": "warn",
"@stylistic/wrap-regex": "warn",
"@stylistic/yield-star-spacing": "warn"
}
}
8 changes: 4 additions & 4 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ const config: HardhatUserConfig = {
accounts: process.env.CW_TESTNET_PK
? [process.env.CW_TESTNET_PK]
: {
mnemonic: process.env.CW_TESTNET_MNEMONIC || ""
}
mnemonic: process.env.CW_TESTNET_MNEMONIC ?? ""
}
},
cw_mainnet: {
url: process.env.CW_MAINNET_RPC,
accounts: process.env.CW_MAINNET_PK
? [process.env.CW_MAINNET_PK]
: {
mnemonic: process.env.CW_MAINNET_MNEMONIC || ""
}
mnemonic: process.env.CW_MAINNET_MNEMONIC ?? ""
}
}
},
gasReporter: {
Expand Down
Loading

0 comments on commit 236dbcb

Please sign in to comment.