From 6d6e6363cc338ea75694bd59ff75eefd32084647 Mon Sep 17 00:00:00 2001 From: Dominik Ferber Date: Thu, 10 Mar 2016 13:52:33 +0100 Subject: [PATCH] docs(README): add link to article Also rewrites part of the setup guide --- README.md | 2 ++ docs/guides/setup.md | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d1857062cb..ed890a7a69 100755 --- a/README.md +++ b/README.md @@ -46,6 +46,8 @@ Add these keys to your `.eslintrc.json` file: For a more thorough introduction, read the [setup guide](/docs/guides/setup.md). +An article with detailed setup instructions can be found [here](https://medium.com/@dferber90/linting-meteor-8f229ebc7942). + # List of supported rules ## Best Practices diff --git a/docs/guides/setup.md b/docs/guides/setup.md index 25c8cfafae..d788e81586 100644 --- a/docs/guides/setup.md +++ b/docs/guides/setup.md @@ -8,7 +8,7 @@ This document describes how to set up ESLint and ESLint-plugin-Meteor in Meteor This guide assumes you have [npm](https://www.npmjs.com/) installed. ## Setup -Meteor 1.3 supports npm packages out of the box. If you don't have a `package.json` at the root of your Meteor project, create one with `npm init --yes`. Next, add `private: true` to your package (to avoid some warnings and prevent publishing your project to npm's registry accidentally). +If you don't have a `package.json` at the root of your Meteor project, create one with `npm init --yes`. Next, add `private: true` to your package (to avoid some warnings and prevent publishing your project to npm's registry accidentally). Now, install ESLint and ESLint-plugin-Meteor as development dependencies: @@ -38,6 +38,8 @@ And that's it 🎉! More information on setting up ESLint can be found [here](http://eslint.org/docs/user-guide/configuring). +An article with detailed setup instructions specifically for Meteor projects can be found [here](https://medium.com/@dferber90/linting-meteor-8f229ebc7942). + ## Tips Here are some more tips to further improve the setup. @@ -45,11 +47,15 @@ Here are some more tips to further improve the setup. ### Add environments An environment tells ESLint about defined globals. -Since Meteor code can run in the browser and on the server, it's wise to add `browser` and `node`. As Meteor supports ES2015, `es6` should be added as well. And of course the `meteor` environment itself. +Since Meteor code can run in the browser and on the server, it's wise to add `browser` and `node`. As Meteor supports ES2015, `es6` should be added as well. And of course the `meteor` environment itself. Since Meteor 1.3 applications can use modules, they should be enabled for ESLint as well. ```js { /* ... */ + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module", + }, "env": { "es6": true, "browser": true, @@ -135,7 +141,3 @@ If `.eslintrc.json` is renamed to `.eslint.yaml` then the full configuration can moment: false # exported by momentjs:moment # .. ``` - -### Meteor 1.2 and lower - -Read through [Using npm modules for Meteor tooling](https://medium.com/@dferber90/using-npm-modules-for-meteor-tooling-d70c162d058#.ro83m7f48) and create a similar file structure. Then follow the steps outlined above.