Skip to content

Commit

Permalink
Merge pull request #19 from mzwallace/modules
Browse files Browse the repository at this point in the history
Upgrade to ESM modules
  • Loading branch information
davidmerrique authored Dec 29, 2021
2 parents a4aa683 + a850ec0 commit d4bfb94
Show file tree
Hide file tree
Showing 35 changed files with 2,648 additions and 2,762 deletions.
21 changes: 21 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
root: true,
env: {
browser: false,
es2021: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:unicorn/recommended",
"plugin:prettier/recommended",
],
plugins: ["prettier"],
parserOptions: {
ecmaVersion: 13,
sourceType: "module",
},
rules: {
"unicorn/no-process-exit": "off",
},
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ test/data/*
npm-debug.log
.vscode
jsconfig.json
.history/
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

bash bin/post-merge
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"quoteProps": "consistent"
}
15 changes: 12 additions & 3 deletions bin/post-merge
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
#!/bin/bash
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com

# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.

changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"

check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
if echo "$changed_files" | grep -q $1; then
echo "$1 changed. Running '$2'"
eval "$2"
echo ""
fi
# echo "$changed_files" | grep --quiet "$1" && eval "$2"
}

check_run package.json "npm install"
check_run package-lock.json "npm i"

exit 0
Loading

0 comments on commit d4bfb94

Please sign in to comment.