From bca57619ab0c180f5b14397ac4ad6cd3cee0d9bb Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Fri, 29 Jun 2018 21:28:25 +0200 Subject: [PATCH] refactor: define stylesheet paths in npm config Define an npm config variable in package.json to specify where the stylesheets are that we want to lint and update our package scripts to reference this. --- package.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index adf2321e..f3bbcbf4 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ "lint-fix-base": "npm run lint-base -- --fix", "lint-fix": "npm run lint-fix-base -- \"./**/*.{js,json,md}\"", "lint-styles-base": "stylelint --custom-formatter=node_modules/stylelint-formatter-pretty", - "lint-styles": "npm run lint-styles-base -- app/*.scss app/components/**/*.scss", + "lint-styles": "npm run lint-styles-base -- $npm_package_config_style_paths", "lint-styles-fix-base": "npm run lint-styles-base -- --fix", - "lint-styles-fix": "npm run lint-styles-fix-base -- app/*.scss app/components/**/*.scss", + "lint-styles-fix": "npm run lint-styles-fix-base -- $npm_package_config_style_paths", "lint-check": "eslint --print-config .eslintrc.js | eslint-config-prettier-check", "lint-ci": "npm run lint && npm run lint-styles && npm run flow", "package": "npm run build && build --publish never", @@ -36,6 +36,9 @@ "test-e2e": "cross-env NODE_ENV=test BABEL_DISABLE_CACHE=1 node --trace-warnings ./test/runTests.js e2e", "test-watch": "npm test -- --watch" }, + "config": { + "style_paths": "app/styles/*.scss app/components/**/*.scss" + }, "browserslist": "electron 2.0", "engines": { "node": ">=8.2.1",