Skip to content
This repository was archived by the owner on Oct 27, 2020. It is now read-only.

Add scripts for run linting and linting-fix tasks #87

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/coverage
/dist
/node_modules
/test/fixtures
/test/fixtures
/scripts
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -2,4 +2,5 @@
/dist
/node_modules
/test/fixtures
CHANGELOG.md
/scripts
CHANGELOG.md
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -17,9 +17,12 @@
"build": "cross-env NODE_ENV=production babel src -d dist --ignore \"src/**/*.test.js\" --copy-files",
"clean": "del-cli dist",
"commitlint": "commitlint --from=master",
"lint:prettier": "prettier \"{**/*,*}.{js,json,md,yml,css}\" --list-different",
"lint:prettier": "prettier \"{**/*,*}.{js,json,md,yml,css}\" --check",
"lint:js": "eslint --cache src test",
"lint": "npm-run-all -l -p \"lint:**\"",
"lint": "node scripts/lint",
"lint-fix:prettier": "prettier \"{**/*,*}.{js,json,md,yml,css}\" --write",
"lint-fix:js": "eslint --fix --cache src test",
"lint-fix": "node scripts/lint-fix",
"prepare": "npm run build",
"release": "standard-version",
"security": "npm audit",
12 changes: 12 additions & 0 deletions scripts/lint-fix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const runAll = require('npm-run-all');

runAll(
["lint-fix:*"],
{
parallel: true,
printLabel: true,
stdout: process.stdout
})
.catch(() => {
console.log('\x1b[31m%s\x1b[0m', `There was errors when running the lint-fix task.`);
});
12 changes: 12 additions & 0 deletions scripts/lint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const runAll = require('npm-run-all');

runAll(
["lint:*"],
{
parallel: true,
printLabel: true,
stdout: process.stdout
})
.catch(() => {
console.log('\x1b[31m%s\x1b[0m', `There was errors when running the lint task. Please execute 'npm run lint-fix'.`);
});