Skip to content

Commit

Permalink
Add eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
arhtudormorar committed May 1, 2024
1 parent 78295a0 commit bcff059
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 17 deletions.
78 changes: 78 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"env": {
"es2021": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2021,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
},
"project": "./tsconfig.json"
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"],
"moduleDirectory": ["node_modules", "src/"]
},
"typescript": {
"alwaysTryTypes": true
}
}
},
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:prettier/recommended"
],
"plugins": ["prettier", "import"],
"rules": {
"import/order": [
"warn",
{
"groups": ["builtin", "external", "internal"],
"pathGroups": [
{
"pattern": "react",
"group": "external",
"position": "before"
}
],
"newlines-between": "ignore",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"prettier/prettier": [
"error",
{
"endOfLine": "lf"
}
],
"@typescript-eslint/indent": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"object-curly-newline": "off",
"arrow-body-style": "off",
"implicit-arrow-linebreak": "off",
"func-names": "off",
"curly": ["error", "all"],
"operator-linebreak": "off",
"function-paren-newline": "off",
"no-shadow": "off",
"@typescript-eslint/no-shadow": "off"
}
}
27 changes: 12 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,22 @@
"dependencies": {
"@multiversx/sdk-core": "^12.19.1",
"@multiversx/sdk-dapp-ui": "*",
"@multiversx/sdk-web-wallet-cross-window-provider": "0.0.37",
"immer": "^10.0.4",
"@multiversx/sdk-web-wallet-cross-window-provider": "0.1.3",
"zustand": "^4.4.7"
},
"devDependencies": {
"@types/react": "^18.2.65",
"eslint": "^8.57.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-standard": "^17.0.0",
"eslint-import-resolver-typescript": "^2.4.0",
"eslint-plugin-import": "^2.26.0",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"eslint": "^9.1.1",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "^17.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-vitest": "^0.4.0",
"prettier": "^3.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-vitest": "^0.5.4",
"prettier": "^3.2.5",
"typescript": "^5.4.2"
}
}
4 changes: 2 additions & 2 deletions src/store/slices/network/network.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { storage } from 'constants/storage';
import { NetworkType } from 'types/network.types';
import { devtools, persist } from 'zustand/middleware';
import { immer } from 'zustand/middleware/immer';
import { createStore } from 'zustand/vanilla';
import { NetworkType } from 'types/network.types';
import { getKeys } from '../helpers/getKeys';
import { getReactStore } from '../helpers/getReactStore';
import { GetSetType } from '../helpers/types';
import { listenToLogout } from '../shared/listenToLogout';
import { defaultNetwork, getRandomAddressFromNetwork } from './helpers';
import { storage } from 'constants/storage';

const initialState = {
['network']: defaultNetwork,
Expand Down

0 comments on commit bcff059

Please sign in to comment.