From 72b287d5e848342f739785ee186c004c9975b5ea Mon Sep 17 00:00:00 2001 From: Carey Gumaer Date: Fri, 26 Jan 2024 15:59:51 -0500 Subject: [PATCH] remove manual formatting and use pre-commit prettier instead --- .github/workflows/ci.yml | 3 --- .pre-commit-config.yaml | 14 +++++++++++++- package.json | 8 ++------ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2760378..8363dfa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,3 @@ jobs: - name: Lint run: yarn lint - - - name: Code formatting - run: yarn fmt:check diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1845c56..3d286fe 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,25 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks +ci: + skip: + - eslint repos: - repo: git@github.com:Yelp/detect-secrets rev: v1.3.0 hooks: - - id: detect-secrets + - id: detect-secrets args: - --baseline - .secrets.baseline - --exclude-files - README.md exclude: .*_test.*|yarn\.lock + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.1.0 + hooks: + - id: prettier + types_or: + [javascript, jsx, ts, tsx, json, scss, sass, css, yaml, markdown] + args: + - --no-config + - --no-semi diff --git a/package.json b/package.json index 6d919ff..7ff66d4 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,7 @@ "author": "Carey Gumaer ", "license": "MIT", "scripts": { - "lint": "eslint './**/*.{js,jsx,ts,tsx}'", - "fmt": "yarn fmt:check --write", - "fmt:check": "LOG_LEVEL= prettier-eslint --list-different './**/*.{js,jsx,ts,tsx,scss}'" + "lint": "eslint './**/*.{js,jsx,ts,tsx}'" }, "dependencies": { "@typescript-eslint/eslint-plugin": "^6.19.1", @@ -18,8 +16,6 @@ "eslint-config-google": "^0.14.0", "eslint-config-mitodl": "^1.0.0", "eslint-plugin-react": "^7.33.2", - "eslint-plugin-react-hooks": "^4.6.0", - "prettier-eslint": "^16.3.0", - "prettier-eslint-cli": "^8.0.1" + "eslint-plugin-react-hooks": "^4.6.0" } }