From 5c5caec9b8b6fce5d2a9d96282f30405144dd207 Mon Sep 17 00:00:00 2001 From: NateScarlet Date: Thu, 25 Apr 2019 20:51:11 +0800 Subject: [PATCH] chore: configure prettier --- .gitignore | 3 +- .prettierrc | 5 +++ .vscode/extensions.json | 9 +++++ package.json | 77 +++++++++++++++++++++-------------------- 4 files changed, 55 insertions(+), 39 deletions(-) create mode 100644 .prettierrc create mode 100644 .vscode/extensions.json diff --git a/.gitignore b/.gitignore index 98277dde7..43b51f50a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ node_modules/* npm-debug.log # Editor -/.vscode +/.vscode/* +!/.vscode/extensions.json diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..f86253e22 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": false, + "semi": true, + "tabWidth": 4 +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..e6a1ddab3 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,9 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. + // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp + + // List of extensions which should be recommended for users of this workspace. + "recommendations": ["esbenp.prettier-vscode"], + // List of extensions recommended by VS Code that should not be recommended for users of this workspace. + "unwantedRecommendations": [] +} diff --git a/package.json b/package.json index f32290d4b..5fca0067b 100644 --- a/package.json +++ b/package.json @@ -1,40 +1,41 @@ { - "name": "litegraph.js", - "version": "0.7.0", - "description": "A graph node editor similar to PD or UDK Blueprints, it works in a HTML5 Canvas and allow to exported graphs to be included in applications.", - "main": "build/litegraph.js", - "directories": { - "doc": "doc" - }, - "private": false, - "scripts": { - "prebuild": "rimraf build", - "build": "grunt build", - "start": "nodemon utils/server.js", - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/jagenjo/litegraph.js.git" - }, - "author": "jagenjo", - "license": "MIT", - "files": [ - "build", - "css/litegraph.css" - ], - "bugs": { - "url": "https://github.com/jagenjo/litegraph.js/issues" - }, - "homepage": "https://github.com/kriffe/litegraph.js#readme", - "devDependencies": { - "express": "^4.16.4", - "google-closure-compiler": "^20171112.0.0", - "grunt": "^1.0.3", - "grunt-cli": "^1.2.0", - "grunt-closure-tools": "^1.0.0", - "grunt-contrib-concat": "^1.0.1", - "nodemon": "^1.18.9", - "rimraf": "^2.6.2" - } + "name": "litegraph.js", + "version": "0.7.0", + "description": "A graph node editor similar to PD or UDK Blueprints, it works in a HTML5 Canvas and allow to exported graphs to be included in applications.", + "main": "build/litegraph.js", + "directories": { + "doc": "doc" + }, + "private": false, + "scripts": { + "prebuild": "rimraf build", + "build": "grunt build", + "start": "nodemon utils/server.js", + "test": "echo \"Error: no test specified\" && exit 1", + "prettier": "npx prettier --write src/**/*.* css/**/*.*" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/jagenjo/litegraph.js.git" + }, + "author": "jagenjo", + "license": "MIT", + "files": [ + "build", + "css/litegraph.css" + ], + "bugs": { + "url": "https://github.com/jagenjo/litegraph.js/issues" + }, + "homepage": "https://github.com/kriffe/litegraph.js#readme", + "devDependencies": { + "express": "^4.16.4", + "google-closure-compiler": "^20171112.0.0", + "grunt": "^1.0.3", + "grunt-cli": "^1.2.0", + "grunt-closure-tools": "^1.0.0", + "grunt-contrib-concat": "^1.0.1", + "nodemon": "^1.18.9", + "rimraf": "^2.6.2" + } }