Skip to content

Commit

Permalink
Include .mjs files to pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertVilaCalvo committed May 5, 2024
1 parent c45e305 commit 0974573
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/dev/git-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ then
fi

get_staged_files() {
ALL_FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g' | awk '/\.ts$|\.tsx$|\.js$|\.jsx$|\.md$|\.yml$|\.yaml$|\.css$|\.json$/')
ALL_FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g' | awk '/\.ts$|\.tsx$|\.js$|\.jsx$|\.mjs$|\.md$|\.yml$|\.yaml$|\.css$|\.json$/')
CODE_FILES=$(echo "$ALL_FILES" | awk '/\.ts$|\.tsx$|\.js$|\.jsx$/')
}

Expand Down
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import pluginReactConfig from 'eslint-plugin-react/configs/recommended.js'

export default [
{
ignores: ['.docusaurus/**', 'build/', "babel.config.js"],
ignores: ['.docusaurus/**', 'build/', 'babel.config.js'],
},
{
languageOptions: { globals: globals.browser },
Expand Down
2 changes: 1 addition & 1 deletion pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ then
fi

get_staged_files() {
ALL_FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g' | awk '/\.ts$|\.tsx$|\.js$|\.jsx$|\.md$|\.yml$|\.yaml$|\.css$|\.json$/')
ALL_FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g' | awk '/\.ts$|\.tsx$|\.js$|\.jsx$|\.mjs$|\.md$|\.yml$|\.yaml$|\.css$|\.json$/')
CODE_FILES=$(echo "$ALL_FILES" | awk '/\.ts$|\.tsx$|\.js$|\.jsx$/')
}

Expand Down

0 comments on commit 0974573

Please sign in to comment.