From a055f93d231cec165c42a2616742da28bc71739f Mon Sep 17 00:00:00 2001 From: Curtis Dulmage Date: Sun, 2 Jul 2023 13:45:47 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20[Scripts]=20Add=20dedic?= =?UTF-8?q?ated=20`prettier`=20command=20(#32)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/labeler.yml | 29 ++++++++++++++++------------- .github/workflows/labeler.yml | 1 + .github/workflows/lint.yml | 3 +++ .vscode/extensions.json | 11 +++++------ .vscode/settings.json | 7 ++----- package.json | 5 ++++- 6 files changed, 31 insertions(+), 25 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 0cb9fbb..f07d2ca 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,19 +1,22 @@ -๐Ÿ‘ฝ๏ธ dependency: - - any: ['package.json', 'package-lock.json', 'yarn.lock', '.pnp.*'] -๐Ÿ“ documentation: ['README.md', 'docs/**/*'] -๐Ÿ”– release: 'CHANGELOG.md' -๐Ÿงช testing: '**/*.test.ts' -๐Ÿ”ง tooling: +๐Ÿงฐ Dependency: + - any: ['package-lock.json', 'yarn.lock'] +๐Ÿ“š Documentation: + - any: ['README.md', 'docs/**'] +๐Ÿ”– Release: 'CHANGELOG.md' +โš–๏ธ Legal: 'LICENSE' +๐Ÿงช Testing: '**/*.test.ts' +๐Ÿ”ง Tooling: - any: [ '*', - '.github/**/*', - '.vscode/**/*', + '.github/**', + '.vscode/**', '.yarn*', - '.yarn/**/*', - 'config/**/*', - 'scripts/**/*', - '!package*', + '.yarn/**', + 'config/**', + 'scripts/**', + '!LICENSE', + '!package.lock', '!yarn.lock', - '!*.@(md|mdx)', + '!*.md', ] diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 36717aa..a4c8c0f 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -16,4 +16,5 @@ jobs: - name: Apply PR labels uses: actions/labeler@v4 with: + dot: true repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ae37910..506c595 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,3 +21,6 @@ jobs: - name: Lint run: npm run lint + + - name: Prettier + run: npm run format diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 93a1b8c..6d2444d 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,14 +1,13 @@ { "recommendations": [ + "codezombiech.gitignore", + "github.vscode-github-actions", + "EditorConfig.editorconfig", "christian-kohler.npm-intellisense", "christian-kohler.path-intellisense", - "codezombiech.gitignore", + "Gruntfuggly.todo-tree", "DavidAnson.vscode-markdownlint", "dbaeumer.vscode-eslint", - "EditorConfig.editorconfig", - "esbenp.prettier-vscode", - "Gruntfuggly.todo-tree", - "stylelint.vscode-stylelint", - "mrmlnc.vscode-scss" + "esbenp.prettier-vscode" ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index c6fd57c..ae77e68 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,14 +1,11 @@ { - "css.validate": false, - "scss.validate": false, - "javascript.validate.enable": false, - "stylelint.enable": true, "editor.codeActionsOnSave": { "source.fixAll": true }, "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode", - "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"], + "eslint.validate": ["javascript", "typescript"], + "stylelint.enable": true, "typescript.tsdk": "./node_modules/typescript/lib", "typescript.enablePromptUseWorkspaceTsdk": true, "files.exclude": { diff --git a/package.json b/package.json index fb4f841..09d9ec5 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,10 @@ "nuke": "npm run clean && rm -rf node_modules && rm -rf package-lock.json && npm cache clean --force", "build": "npm run clean && tsc && vite build", "preview": "vite preview", - "lint": "eslint 'src/**/*.{ts,tsx}'", + "lint": "eslint . --ext .ts", + "lint:fix": "npm run lint -- --fix", + "format": "prettier --check src/", + "format:fix": "prettier --write src/", "test": "vitest", "test:ui": "vitest --ui", "coverage": "vitest --run --coverage",