Skip to content

Commit 25df6ba

Browse files
committed
frontend/formatting: move eslint formatting rules to prettier
Eslint formatting rules are deprecated (see https://eslint.org/blog/2023/10/deprecating-formatting-rules/ ). This commit configures the prettier plugin and moves the formatting rules in the new .prettierrc file.
1 parent 367bb1b commit 25df6ba

File tree

4 files changed

+120
-27
lines changed

4 files changed

+120
-27
lines changed

frontends/web/.eslintrc.json

+5-26
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,12 @@
1212
}
1313
},
1414
"rules": {
15-
"brace-style": ["error", "1tbs"],
16-
"comma-spacing": ["error", { "before": false, "after": true }],
15+
"prettier/prettier": "error",
1716
"curly": "error",
18-
"indent": ["error", 2, { "SwitchCase": 0 }],
1917
"jsx-a11y/anchor-is-valid": 0,
20-
"jsx-a11y/alt-text" : 0,
21-
"jsx-quotes": ["error", "prefer-double"],
22-
"keyword-spacing": "error",
18+
"jsx-a11y/alt-text": 0,
2319
"eqeqeq": "error",
24-
"no-multi-spaces": "error",
25-
"no-trailing-spaces": "error",
26-
"object-curly-spacing": ["error", "always"],
27-
"quotes": ["error", "single"],
28-
"semi": "error",
29-
"space-before-blocks": ["error", "always"],
30-
"space-in-parens": ["error", "never"],
31-
"no-extra-semi": "error",
32-
"@typescript-eslint/type-annotation-spacing": "error",
33-
"arrow-spacing": "error",
34-
"space-infix-ops": "error",
3520
"react/no-unused-prop-types": "error",
36-
"react/jsx-equals-spacing": ["error", "never"],
3721
"react/react-in-jsx-scope": "off",
3822
"@typescript-eslint/no-explicit-any": "off",
3923
"no-case-declarations": "off",
@@ -48,14 +32,9 @@
4832
"react/display-name": "off",
4933
"react-hooks/exhaustive-deps": "error",
5034
"@typescript-eslint/ban-ts-comment": "off",
51-
"no-async-promise-executor": "off",
52-
"react/jsx-wrap-multilines": ["error", {
53-
"arrow": "parens-new-line",
54-
"assignment": "parens-new-line",
55-
"condition": "parens-new-line",
56-
"logical": "parens-new-line"
57-
}]
35+
"no-async-promise-executor": "off"
5836
},
37+
"plugins": ["prettier"],
5938
"overrides": [
6039
{
6140
"files": ["**/*.ts?(x)"],
@@ -74,7 +53,7 @@
7453
{
7554
"files": ["**/*.test.ts?(x)"],
7655
"rules": {
77-
"import/first": 0
56+
"import/first": "off"
7857
}
7958
}
8059
]

frontends/web/.prettierrc

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"printWidth": 120,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "none",
8+
"bracketSpacing": true,
9+
"arrowParens": "always",
10+
"proseWrap": "preserve",
11+
"htmlWhitespaceSensitivity": "css",
12+
"endOfLine": "auto",
13+
"quoteProps": "as-needed"
14+
}

frontends/web/package-lock.json

+99
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontends/web/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"@typescript-eslint/parser": "^7.15.0",
1414
"@vitejs/plugin-react": "^4.3.3",
1515
"eslint": "^8.57.0",
16+
"eslint-plugin-prettier": "^5.2.3",
1617
"eslint-plugin-react": "^7.34.3",
1718
"eslint-plugin-react-hooks": "^4.6.2",
1819
"eslint-plugin-react-refresh": "^0.4.7",
@@ -26,9 +27,9 @@
2627
"vitest": "^2.1.4"
2728
},
2829
"dependencies": {
30+
"@reown/walletkit": "1.2.0",
2931
"@walletconnect/jsonrpc-types": "1.0.4",
3032
"@walletconnect/types": "2.17.2",
31-
"@reown/walletkit": "1.2.0",
3233
"flag-icons": "7.2.3",
3334
"i18next": "23.11.5",
3435
"lightweight-charts": "4.1.4",

0 commit comments

Comments
 (0)