From eb5625987e33c47384a61e6cedc364e5cdb59187 Mon Sep 17 00:00:00 2001 From: Sinan Bolel <1915925+sbolel@users.noreply.github.com> Date: Wed, 17 Jul 2024 18:38:07 -0400 Subject: [PATCH 1/3] build(husky): add pre-commit prettier hook, change linter to prettier --- .husky/pre-commit | 4 ++++ package.json | 4 ++-- vite.config.ts | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..4cecb59 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +yarn lint-staged && git add -A diff --git a/package.json b/package.json index 55d9363..440713f 100644 --- a/package.json +++ b/package.json @@ -31,10 +31,10 @@ "test:ci": "NODE_ENV=test jest --ci --all --coverage --colors --maxWorkers=100%", "ci": "run-p 'lint:js' 'lint:other' 'test:ci'", "lint": "run-p 'lint:js' 'lint:other'", - "lint:js": "eslint ./ --ext ts,tsx,js,jsx,cjs -c .eslintrc.cjs --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint --color --report-unused-disable-directives", + "lint:js": "prettier --check '**/*.{ts,tsx,js,jsx,cjs}' --ignore-path .gitignore --ignore-path .prettierignore", "lint:other": "prettier --check '**/*.{json,md,yaml,yml}' --ignore-path .gitignore --ignore-path .prettierignore", "fix": "run-p 'fix:**'", - "fix:js": "yarn run lint:js --fix", + "fix:js": "yarn run lint:js --write", "fix:other": "yarn run lint:other --write", "semantic-release": "semantic-release", "postinstall": "yarn run prepare", diff --git a/vite.config.ts b/vite.config.ts index d29a0c2..b4f58be 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -9,8 +9,8 @@ export default defineConfig({ define: { 'process.env': {}, /* eslint-disable prettier/prettier */ - global: ({}), - _global: ({}), + global: {}, + _global: {}, /* eslint-enable prettier/prettier */ }, resolve: { From dd693f180897d3f0a561186cd5a7128a79b8b487 Mon Sep 17 00:00:00 2001 From: Sinan Bolel <1915925+sbolel@users.noreply.github.com> Date: Wed, 17 Jul 2024 18:52:58 -0400 Subject: [PATCH 2/3] chore: format .storybook/preview.tsx --- .storybook/preview.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 77a8c49..0081dea 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -5,11 +5,12 @@ import theme from '../src/theme/theme' export const decorators = [ withThemeFromJSXProvider({ - themes: { - light: theme, - dark: theme, - }, - defaultTheme: 'light', - Provider: ThemeProvider, - GlobalStyles: CssBaseline, -})]; + themes: { + light: theme, + dark: theme, + }, + defaultTheme: 'light', + Provider: ThemeProvider, + GlobalStyles: CssBaseline, + }), +] From a68b27e7452ab4d3f6ce95a7e888932638f138a6 Mon Sep 17 00:00:00 2001 From: Sinan Bolel <1915925+sbolel@users.noreply.github.com> Date: Wed, 17 Jul 2024 19:00:30 -0400 Subject: [PATCH 3/3] chore: revert formatting vite.config.js --- vite.config.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index b4f58be..dacfe76 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -8,10 +8,10 @@ import sass from 'sass' export default defineConfig({ define: { 'process.env': {}, - /* eslint-disable prettier/prettier */ - global: {}, - _global: {}, - /* eslint-enable prettier/prettier */ + // prettier-ignore + global: ({}), + // prettier-ignore + _global: ({}), }, resolve: { alias: {