From 62a957655422d3ce81a309b84d764ac029702889 Mon Sep 17 00:00:00 2001 From: Katerina Koukiou Date: Thu, 27 Sep 2018 12:42:29 +0200 Subject: [PATCH] Allow running eslint with `npm run eslint` Document this command in README.md file --- README.md | 13 +++++++++++++ package.json | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d8c1328..a87d9ca 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,19 @@ ln -s `pwd`/dist ~/.local/share/cockpit/starter-kit After changing the code and running `make` again, reload the Cockpit page in your browser. +# Running eslint + +This plugin uses [ESLint](https://eslint.org/) to automatically check +JavaScript code style in `.jsx` and `.es6` files. + +The linter is executed within every build as a webpack preloader. + +For developer convenience, the ESLint can be started explicitly by: + + $ npm run eslint + +Rules configuration can be found in the `.eslintrc.json` file. + # Automated Testing Run `make check` to build an RPM, install it into a standard Cockpit test VM diff --git a/package.json b/package.json index 473cf29..4dc3713 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "author": "", "license": "LGPL-2.1", "scripts": { - "build": "webpack" + "build": "webpack", + "eslint": "eslint --ext .jsx --ext .es6 ." }, "devDependencies": { "@babel/core": "^7.0.0",