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

ESlint errors #23

Closed
Drarig29 opened this issue Jan 26, 2022 · 0 comments · Fixed by #24
Closed

ESlint errors #23

Drarig29 opened this issue Jan 26, 2022 · 0 comments · Fixed by #24

Comments

@Drarig29
Copy link
Contributor

You have some eslint errors:

error: Unnecessary escape character: \- (no-useless-escape) at src/lib/sign/sign.js:5:130:
  3 |
  4 | function isDomain(val) {
> 5 |   const domain_regex = /^(?!(https:\/\/|http:\/\/|www\.|mailto:|smtp:|ftp:\/\/|ftps:\/\/))(((([a-zA-Z0-9])|([a-zA-Z0-9][a-zA-Z0-9\-]{0,86}[a-zA-Z0-9]))\.(([a-zA-Z0-9])|([a-zA-Z0-9][a-zA-Z0-9\-]{0,73}[a-zA-Z0-9]))\.(([a-zA-Z0-9]{2,12}\.[a-zA-Z0-9]{2,12})|([a-zA-Z0-9]{2,25})))|((([a-zA-Z0-9])|([a-zA-Z0-9][a-zA-Z0-9\-]{0,162}[a-zA-Z0-9]))\.(([a-zA-Z0-9]{2,12}\.[a-zA-Z0-9]{2,12})|([a-zA-Z0-9]{2,25}))))$/g;
    |                                                                                                                                  ^
  6 |   return domain_regex.test(val);
  7 | }
  8 |


error: Unnecessary escape character: \- (no-useless-escape) at src/lib/sign/sign.js:5:191:
  3 |
  4 | function isDomain(val) {
> 5 |   const domain_regex = /^(?!(https:\/\/|http:\/\/|www\.|mailto:|smtp:|ftp:\/\/|ftps:\/\/))(((([a-zA-Z0-9])|([a-zA-Z0-9][a-zA-Z0-9\-]{0,86}[a-zA-Z0-9]))\.(([a-zA-Z0-9])|([a-zA-Z0-9][a-zA-Z0-9\-]{0,73}[a-zA-Z0-9]))\.(([a-zA-Z0-9]{2,12}\.[a-zA-Z0-9]{2,12})|([a-zA-Z0-9]{2,25})))|((([a-zA-Z0-9])|([a-zA-Z0-9][a-zA-Z0-9\-]{0,162}[a-zA-Z0-9]))\.(([a-zA-Z0-9]{2,12}\.[a-zA-Z0-9]{2,12})|([a-zA-Z0-9]{2,25}))))$/g;
    |                                                                                                                                                                                               ^
  6 |   return domain_regex.test(val);
  7 | }
  8 |


error: Unnecessary escape character: \- (no-useless-escape) at src/lib/sign/sign.js:5:315:
  3 |
  4 | function isDomain(val) {
> 5 |   const domain_regex = /^(?!(https:\/\/|http:\/\/|www\.|mailto:|smtp:|ftp:\/\/|ftps:\/\/))(((([a-zA-Z0-9])|([a-zA-Z0-9][a-zA-Z0-9\-]{0,86}[a-zA-Z0-9]))\.(([a-zA-Z0-9])|([a-zA-Z0-9][a-zA-Z0-9\-]{0,73}[a-zA-Z0-9]))\.(([a-zA-Z0-9]{2,12}\.[a-zA-Z0-9]{2,12})|([a-zA-Z0-9]{2,25})))|((([a-zA-Z0-9])|([a-zA-Z0-9][a-zA-Z0-9\-]{0,162}[a-zA-Z0-9]))\.(([a-zA-Z0-9]{2,12}\.[a-zA-Z0-9]{2,12})|([a-zA-Z0-9]{2,25}))))$/g;
    |                                                                                                                                                                                                                                                                                                                           ^
  6 |   return domain_regex.test(val);
  7 | }
  8 |


error: Unexpected negating the left operand of 'instanceof' operator (no-unsafe-negation) at src/lib/sign/sign.js:72:32:
  70 |   }
  71 |
> 72 |   if(params.expiration_time && !params.expiration_time instanceof Date) {
     |                                ^
  73 |     throw new Error('expiration_time must be an instance of Date');
  74 |   }
  75 |


error: Unexpected negating the left operand of 'instanceof' operator (no-unsafe-negation) at src/lib/sign/sign.js:76:27:
  74 |   }
  75 |
> 76 |   if(params.not_before && !params.expiration_time instanceof Date) {
     |                           ^
  77 |     throw new Error('expiration_time must be an instance of Date');
  78 |   }
  79 | };


error: 'signature' is assigned a value but never used (no-unused-vars) at src/lib/verify/verify.js:69:35:
  67 | export const verify = (token, params = {}) => {
  68 |
> 69 |   const { version, address, body, signature } = decrypt(token);
     |                                   ^
  70 |
  71 |   if(version === 1) {
  72 |     throw new Error('Tokens version 1 are not supported by the current version of module')


error: 'Web3' is not defined (no-undef) at src/main.js:6:20:
  4 |
  5 |   // Connection to MetaMask wallet
> 6 |   const web3 = new Web3(ethereum);
    |                    ^
  7 |   await ethereum.request({ method: 'eth_requestAccounts'});
  8 |
  9 |   // getting address from which we will sign message


error: 'ethereum' is not defined (no-undef) at src/main.js:6:25:
  4 |
  5 |   // Connection to MetaMask wallet
> 6 |   const web3 = new Web3(ethereum);
    |                         ^
  7 |   await ethereum.request({ method: 'eth_requestAccounts'});
  8 |
  9 |   // getting address from which we will sign message


error: 'ethereum' is not defined (no-undef) at src/main.js:7:9:
   5 |   // Connection to MetaMask wallet
   6 |   const web3 = new Web3(ethereum);
>  7 |   await ethereum.request({ method: 'eth_requestAccounts'});
     |         ^
   8 |
   9 |   // getting address from which we will sign message
  10 |   const your_address = (await web3.eth.getAccounts())[0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant