From 48122ebce3f18a15633e83ec7d5d60997b163507 Mon Sep 17 00:00:00 2001 From: Brandon Mills Date: Sat, 29 Apr 2017 20:21:10 -0400 Subject: [PATCH] Build: Dogfood plugin without npm link (#65) Credit goes to @not-an-aardvark for the recipe: https://gist.github.com/not-an-aardvark/2358fe2164af521a761710d5f380b1e4 --- .eslintrc.js | 31 +++++++++++++++++++++++++++++++ .eslintrc.yml | 14 -------------- .travis.yml | 3 --- README.md | 3 +-- 4 files changed, 32 insertions(+), 19 deletions(-) create mode 100644 .eslintrc.js delete mode 100644 .eslintrc.yml diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..602a722 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,31 @@ +"use strict"; + +var fs = require("fs"); +var path = require("path"); +var PACKAGE_NAME = require("./package").name; +var SYMLINK_LOCATION = path.join(__dirname, "node_modules", PACKAGE_NAME); + +// Symlink node_modules/eslint-plugin-markdown to this directory so that ESLint +// resolves this plugin name correctly. +if (!fs.existsSync(SYMLINK_LOCATION)) { + fs.symlinkSync(__dirname, SYMLINK_LOCATION); +} + +module.exports = { + "root": true, + + "plugins": [ + PACKAGE_NAME + ], + + "env": { + "node": true + }, + + "extends": "eslint", + + "rules": { + "strict": "off", + "eol-last": "off" + } +}; diff --git a/.eslintrc.yml b/.eslintrc.yml deleted file mode 100644 index 9d96172..0000000 --- a/.eslintrc.yml +++ /dev/null @@ -1,14 +0,0 @@ -root: true - -plugins: - - "markdown" - -env: - node: true - -extends: - "eslint" - -rules: - strict: 0 - eol-last: 0 diff --git a/.travis.yml b/.travis.yml index f4b49b8..ba78360 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,3 @@ node_js: sudo: false notifications: email: false -install: - - npm link - - npm link eslint-plugin-markdown diff --git a/README.md b/README.md index 4f21202..c3a583e 100644 --- a/README.md +++ b/README.md @@ -113,8 +113,7 @@ Since code blocks are not files themselves but embedded inside a Markdown docume ```sh $ git clone https://github.com/eslint/eslint-plugin-markdown.git $ cd eslint-plugin-markdown -$ npm link -$ npm link eslint-plugin-markdown +$ npm install $ npm test ```