Skip to content

Commit aae2dec

Browse files
committed
Add editorconfig and prettier integration with eslint
1 parent ad32ba8 commit aae2dec

11 files changed

+121
-14
lines changed

backend/.editorconfig

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false
17+

backend/.eslintrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"extends": [
88
"eslint:recommended",
99
"plugin:@typescript-eslint/eslint-recommended",
10-
"plugin:@typescript-eslint/recommended"
10+
"plugin:@typescript-eslint/recommended",
11+
"prettier"
1112
],
1213
"rules": {
1314
"@typescript-eslint/ban-ts-comment": 1,

backend/.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
package-lock.json

backend/.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"endOfLine": "lf",
3+
"printWidth": 80,
4+
"tabWidth": 2,
5+
"trailingComma": "es5"
6+
}

backend/package-lock.json

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

backend/package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"start-production": "node --max-old-space-size=4096 dist/index.js",
2727
"test": "echo \"Error: no test specified\" && exit 1",
2828
"lint": "./node_modules/.bin/eslint . --ext .ts",
29-
"lint:fix": "./node_modules/.bin/eslint . --ext .ts --fix"
29+
"lint:fix": "./node_modules/.bin/eslint . --ext .ts --fix",
30+
"prettier": "./node_modules/.bin/prettier --write \"src/**/*.{js,ts}\""
3031
},
3132
"dependencies": {
3233
"@mempool/electrum-client": "^1.1.7",
@@ -49,6 +50,8 @@
4950
"@typescript-eslint/eslint-plugin": "^5.30.5",
5051
"@typescript-eslint/parser": "^5.30.5",
5152
"eslint": "^8.19.0",
53+
"eslint-config-prettier": "^8.5.0",
54+
"prettier": "^2.7.1",
5255
"tslint": "^6.1.0"
5356
}
5457
}

frontend/.editorconfig

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ indent_size = 2
88
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

11+
[*.ts]
12+
quote_type = single
13+
1114
[*.md]
1215
max_line_length = off
1316
trim_trailing_whitespace = false
17+

frontend/.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
package-lock.json

frontend/.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"endOfLine": "lf",
3+
"printWidth": 80,
4+
"tabWidth": 2,
5+
"trailingComma": "es5"
6+
}

frontend/package-lock.json

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

frontend/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"test": "npm run ng -- test",
4545
"lint": "./node_modules/.bin/eslint . --ext .ts",
4646
"lint:fix": "./node_modules/.bin/eslint . --ext .ts --fix",
47+
"prettier": "prettier --write \"src/app/**/*.{js,json,css,scss,less,md,ts,html,component.html}\"",
4748
"e2e": "npm run generate-config && npm run ng -- e2e",
4849
"e2e:ci": "npm run cypress:run:ci",
4950
"config:defaults:mempool": "node update-config.js TESTNET_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true LIQUID_TESTNET_ENABLED=true BISQ_ENABLED=true ITEMS_PER_PAGE=25 BASE_MODULE=mempool BLOCK_WEIGHT_UNITS=4000000 && npm run generate-config",
@@ -109,6 +110,7 @@
109110
"@typescript-eslint/parser": "^5.30.5",
110111
"eslint": "^8.19.0",
111112
"http-proxy-middleware": "~2.0.6",
113+
"prettier": "^2.7.1",
112114
"ts-node": "~10.8.1",
113115
"typescript": "~4.6.4"
114116
},

0 commit comments

Comments
 (0)