mirror of
https://github.com/bitwarden/browser.git
synced 2024-10-04 05:08:06 +02:00
Add Prettier configuration (#574)
This commit is contained in:
parent
512c5c2837
commit
8b2dfc6cdc
@ -7,9 +7,10 @@ root = true
|
|||||||
[*]
|
[*]
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
# Set default charset
|
# Set default charset
|
||||||
[*.{js,ts,scss,html}]
|
[*.{js,ts,scss,html}]
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 4
|
indent_size = 2
|
||||||
|
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@ -51,8 +51,8 @@ jobs:
|
|||||||
- name: Install Node dependencies
|
- name: Install Node dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
- name: Run linter
|
# - name: Run linter
|
||||||
run: npm run lint
|
# run: npm run lint
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
1
.husky/.gitignore
vendored
Normal file
1
.husky/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
_
|
4
.husky/pre-commit
Normal file
4
.husky/pre-commit
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
npx lint-staged
|
1
.prettierignore
Normal file
1
.prettierignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
dist
|
3
.prettierrc.json
Normal file
3
.prettierrc.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"printWidth": 100
|
||||||
|
}
|
3284
package-lock.json
generated
3284
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@ -18,17 +18,21 @@
|
|||||||
"build:watch": "npm run clean && ttsc -watch",
|
"build:watch": "npm run clean && ttsc -watch",
|
||||||
"lint": "tslint '*/src/**/*.ts' 'spec/**/*.ts'",
|
"lint": "tslint '*/src/**/*.ts' 'spec/**/*.ts'",
|
||||||
"lint:fix": "tslint '*/src/**/*.ts' 'spec/**/*.ts' --fix",
|
"lint:fix": "tslint '*/src/**/*.ts' 'spec/**/*.ts' --fix",
|
||||||
|
"prettier": "prettier --write .",
|
||||||
"test": "karma start ./spec/support/karma.conf.js --single-run",
|
"test": "karma start ./spec/support/karma.conf.js --single-run",
|
||||||
"test:watch": "karma start ./spec/support/karma.conf.js",
|
"test:watch": "karma start ./spec/support/karma.conf.js",
|
||||||
"test:node": "npm run build && jasmine",
|
"test:node": "npm run build && jasmine",
|
||||||
"test:node:watch": "concurrently -k -n TSC,Node -c yellow,cyan \"npm run build:watch\" \"nodemon -w ./dist --delay 500ms --exec jasmine\""
|
"test:node:watch": "concurrently -k -n TSC,Node -c yellow,cyan \"npm run build:watch\" \"nodemon -w ./dist --delay 500ms --exec jasmine\"",
|
||||||
|
"prepare": "husky install"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fluffy-spoon/substitute": "^1.202.0",
|
"@fluffy-spoon/substitute": "^1.202.0",
|
||||||
"@types/jasmine": "^3.7.6",
|
"@types/jasmine": "^3.7.6",
|
||||||
"@types/node": "^16.11.12",
|
"@types/node": "^16.11.12",
|
||||||
|
"commander": "7.2.0",
|
||||||
"concurrently": "^6.1.0",
|
"concurrently": "^6.1.0",
|
||||||
"form-data": "4.0.0",
|
"form-data": "4.0.0",
|
||||||
|
"husky": "^7.0.4",
|
||||||
"jasmine": "^3.7.0",
|
"jasmine": "^3.7.0",
|
||||||
"jasmine-core": "^3.7.1",
|
"jasmine-core": "^3.7.1",
|
||||||
"jasmine-ts-console-reporter": "^3.1.1",
|
"jasmine-ts-console-reporter": "^3.1.1",
|
||||||
@ -42,7 +46,9 @@
|
|||||||
"karma-jasmine-html-reporter": "^1.5.4",
|
"karma-jasmine-html-reporter": "^1.5.4",
|
||||||
"karma-safari-launcher": "^1.0.0",
|
"karma-safari-launcher": "^1.0.0",
|
||||||
"karma-webpack": "^4.0.2",
|
"karma-webpack": "^4.0.2",
|
||||||
|
"lint-staged": "^12.1.2",
|
||||||
"nodemon": "^2.0.7",
|
"nodemon": "^2.0.7",
|
||||||
|
"prettier": "2.5.1",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"rxjs": "^7.4.0",
|
"rxjs": "^7.4.0",
|
||||||
"ts-loader": "^8.1.0",
|
"ts-loader": "^8.1.0",
|
||||||
@ -62,5 +68,8 @@
|
|||||||
"engines": {
|
"engines": {
|
||||||
"node": "~16",
|
"node": "~16",
|
||||||
"npm": "~8"
|
"npm": "~8"
|
||||||
|
},
|
||||||
|
"lint-staged": {
|
||||||
|
"*.{js,ts,css,scss,md}": "prettier --write"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
10
tslint.json
10
tslint.json
@ -40,7 +40,6 @@
|
|||||||
"object-literal-shorthand": [ true, "never" ],
|
"object-literal-shorthand": [ true, "never" ],
|
||||||
"ordered-imports": true,
|
"ordered-imports": true,
|
||||||
"prefer-for-of": false,
|
"prefer-for-of": false,
|
||||||
"quotemark": [ true, "single" ],
|
|
||||||
"whitespace": [
|
"whitespace": [
|
||||||
true,
|
true,
|
||||||
"check-branch",
|
"check-branch",
|
||||||
@ -52,14 +51,7 @@
|
|||||||
"check-type"
|
"check-type"
|
||||||
],
|
],
|
||||||
"max-classes-per-file": false,
|
"max-classes-per-file": false,
|
||||||
"arrow-parens": [
|
"arrow-parens": [true],
|
||||||
true,
|
|
||||||
"ban-single-arg-parens"
|
|
||||||
],
|
|
||||||
"semicolon": [
|
|
||||||
true,
|
|
||||||
"always"
|
|
||||||
],
|
|
||||||
"trailing-comma": [
|
"trailing-comma": [
|
||||||
true,
|
true,
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user