Merge pull request #256 from CesiumGS/prettier

Switch to prettier for formatting
This commit is contained in:
Ian Lilley 2021-08-02 08:28:21 -07:00 committed by GitHub
commit bd4b7320fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 5 deletions

View File

@ -3,7 +3,7 @@ root = true
[*] [*]
indent_style = space indent_style = space
indent_size = 4 indent_size = 2
charset = utf-8 charset = utf-8
trim_trailing_whitespace = true trim_trailing_whitespace = true
insert_final_newline = true insert_final_newline = true

View File

@ -1,5 +1,5 @@
{ {
"extends": "cesium/node", "extends": ["cesium/node", "prettier"],
"rules": { "rules": {
"no-unused-vars": ["error", {"args": "none"}] "no-unused-vars": ["error", {"args": "none"}]
} }

3
.gitignore vendored
View File

@ -7,6 +7,9 @@ package-lock.json
.idea/workspace.xml .idea/workspace.xml
.idea/tasks.xml .idea/tasks.xml
# VSCode user-specific
*.vscode
# Generate data # Generate data
.eslintcache .eslintcache
coverage coverage

View File

@ -1,3 +1,4 @@
/.vscode
/.idea /.idea
/coverage /coverage
/doc/* /doc/*
@ -10,6 +11,7 @@
.gitattributes .gitattributes
.nyc_output .nyc_output
.npmignore .npmignore
.prettierignore
.travis.yml .travis.yml
gulpfile.js gulpfile.js
*.tgz *.tgz

12
.prettierignore Normal file
View File

@ -0,0 +1,12 @@
# Ignore everything
*
# Unignore directories (to all depths) and unignore code and style files in these directories
!bin/**/
!doc/**/
!lib/**/
!specs/**/
!**/*.js
!**/*.md

View File

@ -37,14 +37,18 @@
"devDependencies": { "devDependencies": {
"cloc": "^2.8.0", "cloc": "^2.8.0",
"coveralls": "^3.1.1", "coveralls": "^3.1.1",
"eslint": "^7.31.0", "eslint": "^7.32.0",
"eslint-config-cesium": "^8.0.1", "eslint-config-cesium": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"gulp": "^4.0.2", "gulp": "^4.0.2",
"husky": "^4.3.8",
"jasmine": "^3.8.0", "jasmine": "^3.8.0",
"jasmine-spec-reporter": "^7.0.0", "jasmine-spec-reporter": "^7.0.0",
"jsdoc": "^3.6.7", "jsdoc": "^3.6.7",
"nyc": "^15.1.0", "nyc": "^15.1.0",
"open": "^8.2.1" "open": "^8.2.1",
"prettier": "2.3.2",
"pretty-quick": "^3.1.1"
}, },
"scripts": { "scripts": {
"jsdoc": "jsdoc ./lib -R ./README.md -d doc", "jsdoc": "jsdoc ./lib -R ./README.md -d doc",
@ -53,7 +57,10 @@
"test-watch": "gulp test-watch", "test-watch": "gulp test-watch",
"coverage": "gulp coverage", "coverage": "gulp coverage",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls", "coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls",
"cloc": "gulp cloc" "cloc": "gulp cloc",
"prettier": "prettier --write \"**/*\"",
"prettier-check": "prettier --check \"**/*\"",
"pretty-quick": "pretty-quick"
}, },
"bin": { "bin": {
"obj2gltf": "./bin/obj2gltf.js" "obj2gltf": "./bin/obj2gltf.js"