-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#3] Install & configure lint-staged
This runs our linters & formatters on just the files that have changed.
- Loading branch information
1 parent
56b978d
commit bdfc227
Showing
4 changed files
with
550 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
npm run format | ||
ddev exec npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* This runs within the DDEV container | ||
* We have access to the appropriate PHP & Composer versions | ||
*/ | ||
export default { | ||
'**/*.php': [ | ||
'./vendor/bin/ecs check --ansi --fix', | ||
'./vendor/bin/phpstan analyse --memory-limit=1G', | ||
], | ||
'*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --ignore-unknown --write'], | ||
// Negate the JS files above so there isn't a race condition | ||
// https://github.com/lint-staged/lint-staged?tab=readme-ov-file#task-concurrency | ||
'!(*.js|*.jsx|*.ts|*.tsx)': 'prettier --ignore-unknown --write', | ||
} |
Oops, something went wrong.