Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Adds prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
vardan10 committed May 16, 2023
1 parent 2294f7e commit 1864367
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 3 deletions.
55 changes: 55 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Files
Jenkinsfile*
Makefile
Dockerfile
LICENSE
.DS_Store
data/
.idea
logs/
jenkins/*.deployment

docs/

.gitkeep
mocha.opts

# rc files
.*rc
## ignore files
.*ignore

# Ignore extensions
*.png
*.sql
*.blob
*.ejs
*.sh
*.conf
*.env

## jest snapshot
*.snap
*.tsbuildinfo

# project specific paths
test/.coverage-unit/
helm
build/
dist/
docker/.env*
qa/
bin
tmp/

*.pid
*.gz

*.SHA256
*.mock
*.txt
.editorconfig

*.mainnet

docker/*
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 100,
"singleQuote": true,
"trailingComma": "all",
"useTabs": true,
"arrowParens": "avoid"
}
2 changes: 2 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ _Before_ submitting a pull request, please make sure the following is done:
Follow the [JavaScript](https://github.com/airbnb/javascript) styleguide from
Airbnb with the
[lisk extension](https://github.com/LiskHQ/eslint-config-lisk-base).
1. Format your code using [Prettier](https://prettier.io/). This can be performed manually
with `npm run format`.
1. Submit a pull request via GitHub. Include issue numbers in the PR title, at
the end with: `Description - Closes #IssueNumber`.
1. Check that Jenkins CI tests pass (pull request turns green). First time
Expand Down
15 changes: 15 additions & 0 deletions jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ pipeline {
}
}
}
stage('Format Service') {
steps {
nvm(readFile(".nvmrc").trim()) {
sh '''
npm run format
if [ -z "$(git status --untracked-files=no --porcelain)" ]; then
echo "All files formatted"
else
echo "Running format is required"
exit 1
fi
'''
}
}
}
stage('Perform unit tests') {
steps {
script { echoBanner(STAGE_NAME) }
Expand Down
24 changes: 23 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@
"scripts": {
"start": "pm2 start ecosystem.config.js",
"stop": "pm2 delete ecosystem.config.js",
"format": "prettier --write '**/*'",
"eslint": "eslint \"./framework/**/*.js\" \"./services/**/*.js\" \"./tests/**/*.js\"",
"eslint-fix": "eslint --fix \"./framework/**/*.js\" \"./services/**/*.js\" \"./tests/**/*.js\"",
"test:coverage": "jest --config=jest.config.unit.js --coverage=true --verbose --forceExit"
},
"dependencies": {},
"devDependencies": {
"eslint": "^7.32.0",
"eslint-config-lisk-base": "^2.0.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.2.2",
"eslint-plugin-mocha": "^10.0.4",
"jest": "^27.3.0"
"jest": "^27.3.0",
"prettier": "2.8.8"
}
}

0 comments on commit 1864367

Please sign in to comment.