mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-06 07:06:11 +00:00
chore: add CI for JS, iOS and Android formatting (#1782)
Added CI workflow and local pre-commit hook for formatting and linting the newly added JS, iOS and Android code.
This commit is contained in:
18
package.json
18
package.json
@@ -47,13 +47,16 @@
|
||||
"bob": "bob build",
|
||||
"flow": "flow src",
|
||||
"flowtyped": "flow-typed install",
|
||||
"format": "prettier --write README.md CONTRIBUTING.md CODE_OF_CONDUCT.md './src/**/*.{ts,tsx}'",
|
||||
"format": "yarn format-js && yarn format-ios && yarn format-java",
|
||||
"format-ios": "find apple/ -iname *.h -o -iname *.m -o -iname *.cpp -o -iname *.mm | xargs clang-format -i",
|
||||
"format-java": "node ./scripts/format-java.js",
|
||||
"format-js": "prettier --write README.md CONTRIBUTING.md CODE_OF_CONDUCT.md USAGE.md './src/**/*.{ts,tsx}' './Example/**/*.{ts,tsx}'",
|
||||
"jest": "jest",
|
||||
"lint": "eslint --ext .ts,.tsx src",
|
||||
"peg": "pegjs -o src/lib/extract/transform.js ./src/lib/extract/transform.peg",
|
||||
"prepare": "npm run bob",
|
||||
"prepare": "npm run bob && husky install",
|
||||
"release": "npm login && release-it",
|
||||
"test": "npm run lint && npm run tsc && npm run flow && npm run jest",
|
||||
"test": "npm run lint && npm run tsc && npm run jest",
|
||||
"tsc": "tsc --noEmit"
|
||||
},
|
||||
"peerDependencies": {
|
||||
@@ -78,6 +81,7 @@
|
||||
"@types/react-native": "^0.69.3",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"babel-jest": "^28.1.0",
|
||||
"clang-format": "^1.8.0",
|
||||
"eslint": "^8.16.0",
|
||||
"eslint-plugin-flowtype": "^8.0.3",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
@@ -85,7 +89,9 @@
|
||||
"flow-bin": "^0.119.1",
|
||||
"flow-typed": "^3.0.0",
|
||||
"flowgen": "^1.10.0",
|
||||
"husky": "^8.0.1",
|
||||
"jest": "^28.1.0",
|
||||
"lint-staged": "^13.0.3",
|
||||
"pegjs": "^0.10.0",
|
||||
"prettier": "^2.6.2",
|
||||
"react": "^17.0.1",
|
||||
@@ -96,6 +102,12 @@
|
||||
"ts-node": "^10.8.0",
|
||||
"typescript": "^4.7.2"
|
||||
},
|
||||
"lint-staged": {
|
||||
"{src,Example}/**/*.{js,ts,tsx}": "yarn format-js",
|
||||
"src/**/*.{js,ts,tsx}": "yarn lint",
|
||||
"apple/**/*.{h,m,mm,cpp}": "yarn format-ios",
|
||||
"android/src/**/*.java": "yarn format-java"
|
||||
},
|
||||
"nativePackage": true,
|
||||
"codegenConfig": {
|
||||
"libraries": [
|
||||
|
||||
Reference in New Issue
Block a user