From ad4aa6205cab3e04d620954eb7af175251a8683d Mon Sep 17 00:00:00 2001 From: Payton Swick Date: Mon, 14 Jan 2019 18:39:46 -0500 Subject: [PATCH 1/2] Add Requirements to README This adds a Requirements section to the README and adds more details to the Installation section to make it easier for new developers to use. --- README.md | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4103213..d6e5024 100644 --- a/README.md +++ b/README.md @@ -4,20 +4,42 @@ [![Build Status](https://api.travis-ci.org/WordPress-Coding-Standards/eslint-config-wordpress.svg?branch=master)](https://travis-ci.org/WordPress-Coding-Standards/eslint-config-wordpress) [![bitHound Overall Score](https://www.bithound.io/github/WordPress-Coding-Standards/eslint-config-wordpress/badges/score.svg)](https://www.bithound.io/github/WordPress-Coding-Standards/eslint-config-wordpress) [![NPM version](http://img.shields.io/npm/v/eslint-config-wordpress.svg)](https://www.npmjs.org/package/eslint-config-wordpress) +## Requirements + +#### npm + +If you do not have npm installed on your computer, [follow the instructions here](https://www.npmjs.com/get-npm). + +Next you will need to have npm set up for your JavaScript project. If you do not see a `package.json` file in your project's directory, run `npm init` within that directory and follow the prompts to create one. You do not need to answer all the questions if you do not plan to be publishing your project to npm, so accepting the defaults is usually fine. You can also edit the configuration later by editing your `package.json` file. + +#### eslint + +After that you will need to have eslint installed for your project. If it is not installed already, run the following command: + +```console +$ npm install --save-dev eslint +``` + ## Installation +If the requirements are satisfied, you can install this plugin as follows: + ```console -$ npm install eslint-config-wordpress +$ npm install --save-dev eslint-config-wordpress ``` -## Usage +## Configuration + +To use this plugin, you must have an eslint configuration file for your project. [There are several different formats for this config file](https://eslint.org/docs/user-guide/configuring#configuration-file-formats). In your config file you will need to find or create a section called "extends" and add "wordpress" to that section. -Add this to your `.eslintrc.json` file: +For example, if you are using the JSON file `.eslintrc.json`, it should look something like this: ```json -"extends": "wordpress" +{ + "extends": "wordpress" +} ``` -If you are using YAML or JavaScript for your [ESLint configuration file format](http://eslint.org/docs/user-guide/configuring#configuration-file-formats) ensure you use the correct syntax for the language used. +There may be other sections in your config file as well. [Read more about configuring eslint here](https://eslint.org/docs/user-guide/configuring). ## [License](LICENSE) From feb3acc4b3fe91fa64216af2414540f5b7f54645 Mon Sep 17 00:00:00 2001 From: Payton Swick Date: Tue, 15 Jan 2019 10:05:28 -0500 Subject: [PATCH 2/2] Keep heading levels incremental --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d6e5024..f171dbe 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@ ## Requirements -#### npm +### npm If you do not have npm installed on your computer, [follow the instructions here](https://www.npmjs.com/get-npm). Next you will need to have npm set up for your JavaScript project. If you do not see a `package.json` file in your project's directory, run `npm init` within that directory and follow the prompts to create one. You do not need to answer all the questions if you do not plan to be publishing your project to npm, so accepting the defaults is usually fine. You can also edit the configuration later by editing your `package.json` file. -#### eslint +### eslint After that you will need to have eslint installed for your project. If it is not installed already, run the following command: