From a0d17ab9e5cb65833066ab072624ba783ab429c2 Mon Sep 17 00:00:00 2001 From: jankapunkt Date: Sun, 24 Jul 2022 14:43:12 +0200 Subject: [PATCH] feature(build): add eslint via @quave/eslint-config-quave and lint scripts --- CONTRIBUTING.md | 23 +++++++++++++++++++++++ test-app/package.json | 10 ++++++++++ 2 files changed, 33 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 093ea8224..32340f9f0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,6 +50,29 @@ $ meteor npm run setup # create link to packages This has to be done only once. +#### Run the linter + +We use eslint with the [quave config](https://github.com/quavedev/eslint-config), which is also used +by the Meteor core project. + +Due to the fact, that this repo consists of multiple packages, you should run the linter for single packages +like so: + +```bash +$ cd test-app +$ meteor npm run lint:check -- ./packages/templating-compiler +``` + +If you need to lint other packages, use `.packages/` or use `./packages/` to lint all packages. +Beware, however, that this might take a while to lint all packages. + +The same goes for autofixing common lint errors: + +```bash +$ cd test-app +$ meteor npm run lint:check -- ./packages/templating-compiler +``` + #### Run the tests Simply execute the test script: diff --git a/test-app/package.json b/test-app/package.json index 457975df6..048e13d76 100644 --- a/test-app/package.json +++ b/test-app/package.json @@ -8,6 +8,8 @@ "scripts": { "start": "meteor run", "setup": "ln -sfn ../packages ./packages", + "lint:check": "npx eslint", + "lint:fix": "npm run eslint --fix", "test:watch": "meteor test-packages --raw-logs ./packages/*", "test:ci": "ci.sh" }, @@ -17,5 +19,13 @@ "jquery": "^3.6.0", "meteor-node-stubs": "^1.2.1", "puppeteer": "^10.4.0" + }, + "devDependencies": { + "@quave/eslint-config-quave": "^1.0.7" + }, + "eslintConfig": { + "extends": [ + "@quave/quave" + ] } }