Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Add support for continual watching/linting of files when developing
Browse files Browse the repository at this point in the history
This should make spotting problems much faster when they occur as a
part of the development workflow.

Add new scripts using chokidar to watch and run the watching scripts
during development.
  • Loading branch information
kasperg committed Sep 15, 2022
1 parent b68e917 commit 460362e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@
"js:eslint": "eslint 'src/**/*.{js,ts,tsx}' --max-warnings=0",
"js:prettier": "prettier 'src/**/*.{js,ts,tsx}'",
"js:lint": "concurrently 'yarn:js:eslint' 'yarn:js:prettier -- --check' --raw",
"js:lint:watch": "chokidar './src/**/*.{js,jsx,ts,tsx}' -c 'yarn js:lint'",
"js:format": "concurrently 'yarn:js:eslint -- --fix' 'yarn:js:prettier -- --write' --max-processes 1 --raw",
"css:stylelint": "stylelint 'src/**/*.scss'",
"css:prettier": "prettier 'src/styles/**/*.scss'",
"css:lint": "concurrently 'yarn:css:stylelint' 'yarn:css:prettier -- --check' --raw",
"css:lint:watch": "chokidar 'src/**/*.scss' -c 'yarn css:lint'",
"css:format": "concurrently 'yarn:css:stylelint -- --fix' 'yarn:css:prettier -- --write' --max-processes 1 --raw",
"css:build": "sass base.scss:src/styles/css/base.css",
"css:watch": "yarn css:build -- --watch",
"dev": "concurrently --raw \"yarn storybook\" \"yarn css:watch\"",
"watch": "concurrently 'yarn:js:lint:watch' 'yarn:css:lint:watch'",
"dev": "concurrently --raw \"yarn storybook\" \"yarn css:watch\" \"yarn watch\"",
"chromatic": "npx chromatic --exit-zero-on-changes",
"lint": "concurrently 'yarn:js:lint' 'yarn:css:lint'",
"lint:markdown": "markdownlint-cli2",
"lint:markdown:fix": "markdownlint-cli2-fix",
"build:doc": "doctoc README.md"
Expand Down Expand Up @@ -54,6 +58,7 @@
"@typescript-eslint/eslint-plugin": "^5.30.5",
"@typescript-eslint/parser": "^5.30.5",
"@whitespace/storybook-addon-html": "^5.0.0",
"chokidar-cli": "^3.0.0",
"clsx": "^1.1.1",
"concurrently": "^7.2.2",
"doctoc": "^2.2.0",
Expand Down
19 changes: 17 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4985,7 +4985,17 @@ check-types@^11.1.1:
resolved "https://registry.yarnpkg.com/check-types/-/check-types-11.1.2.tgz#86a7c12bf5539f6324eb0e70ca8896c0e38f3e2f"
integrity sha512-tzWzvgePgLORb9/3a0YenggReLKAIb2owL03H2Xdoe5pKcUyWRSEQ8xfCar8t2SIAuEDwtmx2da1YB52YuHQMQ==

[email protected], "chokidar@>=3.0.0 <4.0.0", chokidar@^3.4.1, chokidar@^3.4.2:
chokidar-cli@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/chokidar-cli/-/chokidar-cli-3.0.0.tgz#29283666063b9e167559d30f247ff8fc48794eb7"
integrity sha512-xVW+Qeh7z15uZRxHOkP93Ux8A0xbPzwK4GaqD8dQOYc34TlkqUhVSS59fK36DOp5WdJlrRzlYSy02Ht99FjZqQ==
dependencies:
chokidar "^3.5.2"
lodash.debounce "^4.0.8"
lodash.throttle "^4.1.1"
yargs "^13.3.0"

[email protected], "chokidar@>=3.0.0 <4.0.0", chokidar@^3.4.1, chokidar@^3.4.2, chokidar@^3.5.2:
version "3.5.3"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==
Expand Down Expand Up @@ -10013,6 +10023,11 @@ lodash.templatesettings@^4.0.0:
dependencies:
lodash._reinterpolate "^3.0.0"

lodash.throttle@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
integrity sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==

lodash.truncate@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193"
Expand Down Expand Up @@ -16177,7 +16192,7 @@ [email protected], yargs@^16.2.0:
y18n "^5.0.5"
yargs-parser "^20.2.2"

yargs@^13.3.2:
yargs@^13.3.0, yargs@^13.3.2:
version "13.3.2"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd"
integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==
Expand Down

0 comments on commit 460362e

Please sign in to comment.