From 6bbdb048242b311844c82280fbe0e74e8341f9f5 Mon Sep 17 00:00:00 2001 From: Mohammed Saud Date: Sun, 18 Apr 2021 16:58:36 +0530 Subject: [PATCH] Fix misplaced braces in lint config (#31) * fix misplaced braces in lint config * add lint instructions --- README.md | 13 +++++++++++++ webui-src/.eslintrc.json | 4 ++-- webui-src/.prettierrc | 2 ++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b613357..cba3f2b 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,19 @@ References Contributing ------------ +### Preparing code +Install `prettier` and `eslint` (required for linting & formatting code): +```sh +npm install -g prettier eslint +``` +Next, run the following in the `webui-src` directory: + +To run the linter: `eslint app` + +To run the formatter: `prettier -c app` + +Linting and formatting can also be done with editor/IDE plugins. + ### Bug Reports & Feature requests Please create an [issue](https://github.com/Retroshare/RsNewWebUI/issues) concisely describing the bug you faced, or the feature you would like to see implemented. diff --git a/webui-src/.eslintrc.json b/webui-src/.eslintrc.json index 4c171da..a274c1b 100644 --- a/webui-src/.eslintrc.json +++ b/webui-src/.eslintrc.json @@ -53,12 +53,12 @@ "args": "none", "caughtErrors": "none", "ignoreRestSiblings": true, - "vars": "all", + "vars": "all" + }], "no-use-before-define": ["warn", { "functions": true, "classes": false }], "object-shorthand": "error", "prefer-const": ["error", { "destructuring": "all" }], "semi-style": ["warn", "last"], "spaced-comment": ["warn", "always"] - }] } } diff --git a/webui-src/.prettierrc b/webui-src/.prettierrc index aacf2b3..dcc22c8 100644 --- a/webui-src/.prettierrc +++ b/webui-src/.prettierrc @@ -1,6 +1,8 @@ { "arrowParens": "always", "printWidth": 100, + "tabWidth": 2, + "useTabs": false, "singleQuote": true, "trailingComma": "es5", "bracketSpacing": true