mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
Speed up precommits (#2693)
* Speed up precommit hook by only checking staged files with eslint and using eslint cache * Linting test * Add rubocop cache to gitignore * Try to speed up flow
This commit is contained in:
committed by
GitHub
parent
6b50f2db45
commit
a89ed25283
6
.gitignore
vendored
6
.gitignore
vendored
@@ -95,3 +95,9 @@ artifacts/
|
||||
|
||||
# GitGuardian cache file
|
||||
.cache_ggshield
|
||||
|
||||
# Eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Rubocop cache
|
||||
**/tmp/rubocop_cache
|
||||
@@ -13,8 +13,8 @@ else
|
||||
echo
|
||||
fi
|
||||
|
||||
# Run lint and flow
|
||||
npm run lint:fix
|
||||
# Run lint on staged files and run flow
|
||||
npm run lint:staged:fix
|
||||
|
||||
# Generate translations from strings.ftl
|
||||
npm run translate
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
AllCops:
|
||||
NewCops: enable
|
||||
UseCache: true
|
||||
CacheRootDirectory: tmp/rubocop_cache
|
||||
MaxFilesInCache: 5000
|
||||
|
||||
Layout/ArgumentAlignment:
|
||||
EnforcedStyle: with_fixed_indentation
|
||||
|
||||
14
package.json
14
package.json
@@ -15,6 +15,7 @@
|
||||
"test:memory": "jest --runInBand --logHeapUsage",
|
||||
"lint": "npm run lint:eslint && npm run lint:flow && npm run lint:rubocop",
|
||||
"lint:fix": "npm run lint:eslint:fix && npm run lint:flow && npm run lint:rubocop:fix",
|
||||
"lint:staged:fix": "npx lint-staged",
|
||||
"lint:eslint": "eslint .",
|
||||
"lint:eslint:fix": "eslint . --fix",
|
||||
"lint:flow": "flow check",
|
||||
@@ -203,5 +204,14 @@
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"packageManager": "yarn@3.6.4"
|
||||
}
|
||||
"packageManager": "yarn@3.6.4",
|
||||
"lint-staged": {
|
||||
"*.{js,jsx,ts,tsx}": [
|
||||
"eslint --cache --fix --max-warnings=0 --cache-location .eslintcache",
|
||||
"flow check --temp-dir=/tmp/flow --max-workers 4"
|
||||
],
|
||||
"*.rb": [
|
||||
"bundle exec rubocop --force-exclusion --parallel"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user