Skip to content

Commit

Permalink
style: format
Browse files Browse the repository at this point in the history
  • Loading branch information
noyobo committed Jul 16, 2024
1 parent 472f578 commit 06e0798
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
6 changes: 2 additions & 4 deletions .github/linters/.eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ rules:
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/ban-ts-comment': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/explicit-member-accessibility':
['error', { 'accessibility': 'no-public' }],
'@typescript-eslint/explicit-function-return-type':
['error', { 'allowExpressions': true }],
'@typescript-eslint/explicit-member-accessibility': ['error', { 'accessibility': 'no-public' }],
'@typescript-eslint/explicit-function-return-type': ['error', { 'allowExpressions': true }],
'@typescript-eslint/func-call-spacing': ['error', 'never'],
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-empty-interface': 'error',
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"printWidth": 80,
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": false,
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A GitHub action for styling changed files on pull_request
name: prettier-check

on:
pull_request: # Must run on pull requests
pull_request: # Must run on pull requests
branches:
- main

Expand All @@ -32,6 +32,7 @@ jobs:
### Default Behavior
- Matched changed files `/\.(js|jsx|ts|tsx|json|json5|css|less|scss|sass|html|md|mdx|vue)$/` on the pull request
- Matched changed files on the pull request
- file extensions: `/\.(js|jsx|ts|tsx|json|json5|css|less|scss|sass|html|md|mdx|vue)$/`
- Use root `.prettierrc` file for prettier configuration
- Use root `.prettierignore` file for prettier ignore
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ export async function run(): Promise<void> {

let changedFiles = await getAllChangedFiles()

changedFiles = changedFiles.filter(f =>
/\.(js|jsx|ts|tsx|json|json5|css|less|scss|sass|html|md|mdx|vue)$/.test(f)
)
changedFiles = changedFiles.filter(f => /\.(js|jsx|ts|tsx|json|json5|css|less|scss|sass|html|md|mdx|vue)$/.test(f))

const commentIdentifier = '<!-- prettier-check-comment -->'

Expand All @@ -57,10 +55,7 @@ export async function run(): Promise<void> {
})
}
} else {
const prettierCheck = execSync(
`npx prettier --check ${changedFiles.join(' ')}`,
{ encoding: 'utf8' }
)
const prettierCheck = execSync(`npx prettier --check ${changedFiles.join(' ')}`, { encoding: 'utf8' })
const hasWarnings = prettierCheck.includes('Run Prettier to fix')
let body

Expand Down

0 comments on commit 06e0798

Please sign in to comment.