Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Prettier for formatting and format all files #1458

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions web-wallet/.editorconfig

This file was deleted.

119 changes: 48 additions & 71 deletions web-wallet/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,73 +1,50 @@
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: [
nortonandreev marked this conversation as resolved.
Show resolved Hide resolved
{
files: ["*.svelte"],
rules: {
"svelte/require-optimized-style-attribute": 0,
},
},
{
// Rules for conventional testing practices using Vitest.
files: ["*.spec.js", "*.test.js"],
rules: {
"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"],
},
},
},
};
7 changes: 7 additions & 0 deletions web-wallet/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import duskJsPrettierConfig from "@dusk-network/prettier-config/js/index.js";
import duskSveltePrettierConfig from "@dusk-network/prettier-config/svelte/index.js";

export default {
...duskJsPrettierConfig,
...duskSveltePrettierConfig,
};
5 changes: 4 additions & 1 deletion web-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Refactor beta notice as constant [#1469]
- Refactor `settingsStore` and create readable `gasStore` to store `limitLower`, `limitUpper`, `priceLower` [#1308]
- Refactor add Prettier for formatting and format all files [#1458]

### Removed

Expand All @@ -26,7 +27,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Mismatch between param and JSDoc param's type definition (OperationResult.spec.js) [#1471]
- Fix gas limits update on ENV change [#1308]


## [0.3.0] - 2024-02-28

### Added
Expand Down Expand Up @@ -108,6 +108,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add initial commit

<!-- ISSUES -->

[#1458]: https://github.com/dusk-network/rusk/issues/1458
[#1308]: https://github.com/dusk-network/rusk/issues/1308
[#1359]: https://github.com/dusk-network/rusk/issues/1359
[#1311]: https://github.com/dusk-network/rusk/issues/1311
Expand Down Expand Up @@ -145,6 +147,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#1362]: https://github.com/dusk-network/rusk/issues/1362
nortonandreev marked this conversation as resolved.
Show resolved Hide resolved

<!-- 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
9 changes: 5 additions & 4 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
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
Loading