Skip to content

Commit

Permalink
web-wallet: Add prettier config
Browse files Browse the repository at this point in the history
Resolves #1457
  • Loading branch information
kieranhall committed Feb 29, 2024
1 parent 1d5c42e commit 2b49021
Show file tree
Hide file tree
Showing 241 changed files with 15,894 additions and 15,668 deletions.
12 changes: 0 additions & 12 deletions web-wallet/.editorconfig

This file was deleted.

120 changes: 49 additions & 71 deletions web-wallet/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,73 +1,51 @@
module.exports = {
"env": {
"browser": true,
"es2022": true,
"node": true
},
"extends": [
"@dusk-network/eslint-config/js",
"@dusk-network/eslint-config/svelte"
],
"globals": {
"CONFIG": false
},
"overrides": [{
"files": ["*.svelte"],
"rules": {
"no-undef-init": 0,
"svelte/require-optimized-style-attribute": 0
}
}, {
"files": ["*.spec.js", "*.test.js"],
"rules": {
"brace-style": [
"error",
"1tbs",
{ "allowSingleLine": true }
],
"jsdoc/require-jsdoc": 0,
"max-len": [
"error", {
"code": 110,
"comments": 110,
"ignorePattern": "^\\s*it\\(",
"ignoreUrls": true
}
],
"max-nested-callbacks": [
"error",
5
],
"max-statements": 0,
"max-statements-per-line": [
"error", {
"max": 2
}
],
"object-curly-newline": 0,
"quote-props": [
"error",
"consistent"
],
"sort-keys": 0
}
}],
"root": true,
"settings": {
"import/resolver": {
"eslint-import-resolver-custom-alias": {
"alias": {
"$app": "node_modules/@sveltejs/kit/src/runtime/app",
"$config": "./src/config",
"$lib": "./src/lib",
"@sveltejs/kit": "node_modules/@sveltejs/kit/src/exports/index.js",
"@testing-library/svelte": "node_modules/@testing-library/svelte/src/index.js",
"svelte/motion": "node_modules/svelte/src/runtime/motion/index.js",
"svelte/store": "node_modules/svelte/src/runtime/store/index.js",
"svelte/transition": "node_modules/svelte/src/runtime/transition/index.js"
},
"extensions": [".cjs", ".js", ".json", ".svelte"]
}
}
}
env: {
browser: true,
es2022: true,
node: true,
},
extends: [
"@dusk-network/eslint-config/js",
"@dusk-network/eslint-config/svelte",
],
globals: {
CONFIG: false,
},
overrides: [
{
files: ["*.svelte"],
rules: {
"svelte/require-optimized-style-attribute": 0,
},
},
{
// Rules for conventional testing practises using Vitest.
files: ["*.spec.js", "*.test.js"],
rules: {
"brace-style": ["error", "1tbs", { allowSingleLine: true }],
"max-nested-callbacks": ["error", 5],
"max-statements": 0,
},
},
],
root: true,
settings: {
"import/resolver": {
"eslint-import-resolver-custom-alias": {
alias: {
$app: "node_modules/@sveltejs/kit/src/runtime/app",
$config: "./src/config",
$lib: "./src/lib",
"@sveltejs/kit": "node_modules/@sveltejs/kit/src/exports/index.js",
"@testing-library/svelte":
"node_modules/@testing-library/svelte/src/index.js",
"svelte/motion": "node_modules/svelte/src/runtime/motion/index.js",
"svelte/store": "node_modules/svelte/src/runtime/store/index.js",
"svelte/transition":
"node_modules/svelte/src/runtime/transition/index.js",
},
extensions: [".cjs", ".js", ".json", ".svelte"],
},
},
},
};
3 changes: 3 additions & 0 deletions web-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.3.0] - 2024-02-28

### Added

- Add Create Wallet flow tests [#1443]
- Add visible version, commit hash and build date [#1441]
- Add Address validation (Transfer flow) [#1377]
Expand Down Expand Up @@ -87,6 +88,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add initial commit

<!-- ISSUES -->

[#1359]: https://github.com/dusk-network/rusk/issues/1359
[#1311]: https://github.com/dusk-network/rusk/issues/1311
[#1323]: https://github.com/dusk-network/rusk/issues/1323
Expand Down Expand Up @@ -119,6 +121,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#1443]: https://github.com/dusk-network/rusk/issues/1443

<!-- VERSIONS -->

[Unreleased]: https://github.com/dusk-network/rusk/tree/master/web-wallet
[0.3.0]: https://github.com/dusk-network/rusk/tree/web-wallet-0.3.0
[0.2.1]: https://github.com/dusk-network/rusk/tree/web-wallet-0.2.1
Expand Down
11 changes: 6 additions & 5 deletions web-wallet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ Web Wallet website.
## TOC

- [Web Wallet](#web-wallet)
- [TOC](#toc)
- [Build system and dev environment](#build-system-and-dev-environment)
- [Environment variables](#environment-variables)
- [TOC](#toc)
- [Build system and dev environment](#build-system-and-dev-environment)
- [Environment variables](#environment-variables)
- [NPM scripts](#npm-scripts)
- [Running a local Rusk node](#running-a-local-rusk-node)
- [Running a local Rusk node](#running-a-local-rusk-node)

## Build system and dev environment

Expand All @@ -23,6 +23,7 @@ As the application uses the [Web Crypto API](https://developer.mozilla.org/en-US
The staging environment is at https://web-wallet-staging-oxs3z.ondigitalocean.app/

## Environment variables

The `dusk-wallet-js` library uses some [environment variables](https://github.com/dusk-network/dusk-wallet-js/blob/main/.env).

The application defines these variables by reading a local `.env` file containing the same variables used in the `dusk-wallet-js`, with the addition of the `VITE_` prefix.
Expand Down Expand Up @@ -68,4 +69,4 @@ To run a local node different steps are needed, so please read the [related sect

## Running a local Rusk node

To run a local node, follow the instructions outlined in the [Rusk's readme](https://github.com/dusk-network/rusk).
To run a local node, follow the instructions outlined in the [Rusk's readme](https://github.com/dusk-network/rusk).
42 changes: 21 additions & 21 deletions web-wallet/__mocks__/Wallet.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
class Wallet {
constructor (seed, gasLimit = 2900000000, gasPrice = 1) {
this.gasLimit = gasLimit;
this.gasPrice = gasPrice;
this.seed = seed;
this.wasm = {};
}
constructor(seed, gasLimit = 2900000000, gasPrice = 1) {
this.gasLimit = gasLimit;
this.gasPrice = gasPrice;
this.seed = seed;
this.wasm = {};
}

gasLimit;
gasPrice;
seed;
wasm;
gasLimit;
gasPrice;
seed;
wasm;

async history () {}
async getBalance () {}
async getPsks () {}
async stake () {}
async stakeAllow () {}
async stakeInfo () {}
async reset () {}
async sync () {}
async transfer () {}
async unstake () {}
async withdrawReward () {}
async history() {}
async getBalance() {}
async getPsks() {}
async stake() {}
async stakeAllow() {}
async stakeInfo() {}
async reset() {}
async sync() {}
async transfer() {}
async unstake() {}
async withdrawReward() {}
}

export default Wallet;
36 changes: 17 additions & 19 deletions web-wallet/jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
"resolveJsonModule": true,
"skipLibCheck": false,
"sourceMap": true,
"strict": true,
"paths": {
"$lib": ["./src/lib"],
"$lib/*": ["./src/lib/*"]
},
"types": [
"./node_modules/@testing-library/jest-dom/types/vitest.d.ts"
]
}
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
"resolveJsonModule": true,
"skipLibCheck": false,
"sourceMap": true,
"strict": true,
"paths": {
"$lib": ["./src/lib"],
"$lib/*": ["./src/lib/*"]
},
"types": ["./node_modules/@testing-library/jest-dom/types/vitest.d.ts"]
}
}
Loading

0 comments on commit 2b49021

Please sign in to comment.