From c7843808a61d0a08d07bec30f58037f431b3d46c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Segersv=C3=A4rd?= Date: Fri, 6 Nov 2015 09:35:53 +0100 Subject: [PATCH 1/2] More eslint * Lint before test * Fix lint errors --- .eslintrc | 3 +++ package.json | 2 +- src/utils/defaults.js | 4 ++-- src/utils/first.js | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.eslintrc b/.eslintrc index 6e5fb1a..3a7900e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -16,6 +16,9 @@ "mocha": true, "node": true }, + "globals": { + "Promise": false + }, "extends": "eslint:recommended", "ecmaFeatures": { "modules": true diff --git a/package.json b/package.json index 25746f8..83afd34 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "rollup": "./bin/rollup" }, "scripts": { - "pretest": "npm run build", + "pretest": "eslint src/**/*.js && npm run build", "test": "mocha", "pretest-coverage": "npm run build", "test-coverage": "rm -rf coverage/* && istanbul cover --report json node_modules/.bin/_mocha -- -u exports -R spec test/test.js", diff --git a/src/utils/defaults.js b/src/utils/defaults.js index fef4f8a..9deea1f 100644 --- a/src/utils/defaults.js +++ b/src/utils/defaults.js @@ -1,5 +1,5 @@ import { isFile, readFileSync } from './fs.js'; -import { dirname, extname, isAbsolute, resolve } from './path.js'; +import { dirname, isAbsolute, resolve } from './path.js'; export function load ( id ) { return readFileSync( id, 'utf-8' ); @@ -28,5 +28,5 @@ export function resolveId ( importee, importer ) { } export function onwarn ( msg ) { - console.error( msg ); + console.error( msg ); //eslint-disable-line no-console } diff --git a/src/utils/first.js b/src/utils/first.js index 0fe2587..21d6fe3 100644 --- a/src/utils/first.js +++ b/src/utils/first.js @@ -9,5 +9,5 @@ export default function first ( candidates ) { result : Promise.resolve( candidate( ...args ) ) ); }, Promise.resolve() ); - } + }; } From ae9643fb3114e6946bac98741b08a55669080c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Segersv=C3=A4rd?= Date: Wed, 11 Nov 2015 14:07:05 +0100 Subject: [PATCH 2/2] Remove .eslintrc Promise global. Fix lint redundancy in package. --- .eslintrc | 3 --- package.json | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.eslintrc b/.eslintrc index 3a7900e..6e5fb1a 100644 --- a/.eslintrc +++ b/.eslintrc @@ -16,9 +16,6 @@ "mocha": true, "node": true }, - "globals": { - "Promise": false - }, "extends": "eslint:recommended", "ecmaFeatures": { "modules": true diff --git a/package.json b/package.json index 83afd34..9594074 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "rollup": "./bin/rollup" }, "scripts": { - "pretest": "eslint src/**/*.js && npm run build", + "pretest": "npm run lint && npm run build", "test": "mocha", "pretest-coverage": "npm run build", "test-coverage": "rm -rf coverage/* && istanbul cover --report json node_modules/.bin/_mocha -- -u exports -R spec test/test.js", @@ -17,7 +17,7 @@ "build": "git rev-parse HEAD > .commithash && rollup -c -o dist/rollup.js", "build:browser": "git rev-parse HEAD > .commithash && rollup -c rollup.config.browser.js -o dist/rollup.browser.js", "prepublish": "npm test && npm run build:browser", - "lint": "eslint src" + "lint": "eslint src browser" }, "repository": { "type": "git",