diff --git a/bin/eslint b/bin/eslint new file mode 100755 index 0000000..0471f53 --- /dev/null +++ b/bin/eslint @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +BINDIR=$(dirname $(node -pe "require.resolve('eslint/package.json')")) + +if [[ -z "$BINDIR" ]]; then + echo "Required package 'eslint' not found" + exit 1 +fi + +# Redirect to original eslint bin +$BINDIR/bin/eslint.js $@ \ No newline at end of file diff --git a/bin/lint-staged b/bin/lint-staged new file mode 100755 index 0000000..1b1390d --- /dev/null +++ b/bin/lint-staged @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +BINDIR=$(dirname $(node -pe "require.resolve('lint-staged/package.json')")) + +if [[ -z "$BINDIR" ]]; then + echo "Required package 'lint-staged' not found" + exit 1 +fi + +# Redirect to original lint-staged bin +$BINDIR/bin/lint-staged.js $@ \ No newline at end of file diff --git a/bin/prettier b/bin/prettier new file mode 100755 index 0000000..889d62f --- /dev/null +++ b/bin/prettier @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +BINDIR=$(dirname $(node -pe "require.resolve('prettier')")) + +if [[ -z "$BINDIR" ]]; then + echo "Required package 'prettier' not found" + exit 1 +fi + +# Redirect to original prettier bin +$BINDIR/bin/prettier.cjs $@ \ No newline at end of file diff --git a/bin/stylelint b/bin/stylelint new file mode 100755 index 0000000..9b16901 --- /dev/null +++ b/bin/stylelint @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +BINDIR=$(dirname $(node -pe "require.resolve('stylelint/package.json')")) + +if [[ -z "$BINDIR" ]]; then + echo "Required package 'stylelint' not found" + exit 1 +fi + +# Redirect to original stylelint bin +$BINDIR/bin/stylelint.mjs $@ \ No newline at end of file diff --git a/bin/svgo b/bin/svgo new file mode 100755 index 0000000..515e45e --- /dev/null +++ b/bin/svgo @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +BINDIR=$(dirname $(node -pe "require.resolve('svgo/package.json')")) + +if [[ -z "$BINDIR" ]]; then + echo "Required package 'svgo' not found" + exit 1 +fi + +# Redirect to original svgo bin +$BINDIR/bin/svgo $@ \ No newline at end of file diff --git a/package.json b/package.json index df6b9df..08b39d4 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,12 @@ "description": "Diplodoc platform internal utility set for linting", "bin": { "lint": "./bin/lint", - "husky": "./bin/husky" + "husky": "./bin/husky", + "eslint": "./bin/eslint", + "prettier": "./bin/prettier", + "stylelint": "./bin/stylelint", + "lint-staged": "./bin/lint-staged", + "svgo": "./bin/svgo" }, "scripts": { "test": "cd test && npm start"