From 235091b3dc0e1fbb398eb1b14343389e71baed14 Mon Sep 17 00:00:00 2001 From: Omar Jaroudi <30807936+OmarJaroudi@users.noreply.github.com> Date: Wed, 3 Jul 2024 14:16:01 +0000 Subject: [PATCH] feat: port over cspell hook implementation --- .npmrc | 3 +++ .pre-commit-hooks.yaml | 7 +++++++ hooks/cspell/index.js | 3 +++ package.json | 12 ++++++++++++ 4 files changed, 25 insertions(+) create mode 100644 .npmrc create mode 100644 hooks/cspell/index.js create mode 100644 package.json diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..62c8ec8 --- /dev/null +++ b/.npmrc @@ -0,0 +1,3 @@ +@turo:registry=https://turo.jfrog.io/turo/api/npm/npm/ +//turo.jfrog.io/turo/api/npm/npm/:_auth="${NPM_AUTH_TOKEN}" +//turo.jfrog.io/turo/api/npm/npm/:always-auth=true diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 7efb3f6..8c5aaeb 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -95,3 +95,10 @@ language: script entry: hooks/yalc/yalc-check.sh files: package\.json +###################### +# Cspell hook +- id: cspell + name: "Run cspell-cli to check for spelling errors" + description: "Errors if there are spelling errors not whitelisted" + entry: cspell-cli + language: node diff --git a/hooks/cspell/index.js b/hooks/cspell/index.js new file mode 100644 index 0000000..323a5c9 --- /dev/null +++ b/hooks/cspell/index.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +import "cspell/bin"; diff --git a/package.json b/package.json new file mode 100644 index 0000000..fdf297f --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "bin": { + "cspell-cli": "./hooks/cspell/index.js" + }, + "type": "module", + "dependencies": { + "cspell": "8.10.0" + }, + "name": "@turo/pre-commit-hooks", + "private": true, + "version": "1.0.0" +}