Skip to content

Commit

Permalink
🔧 Update prettier and format project
Browse files Browse the repository at this point in the history
  • Loading branch information
willy-ahva authored and AudBrou committed Feb 22, 2023
1 parent 9082b13 commit 9cadbba
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 63 deletions.
18 changes: 7 additions & 11 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,20 @@
"sourceType": "module",
"project": ["./tsconfig.json"],
"ecmaFeatures": {
"jsx": true
"jsx": true
}
},
"plugins": [
"react",
"@typescript-eslint",
"react-hooks"
],
"plugins": ["react", "@typescript-eslint", "react-hooks"],
"rules": {
"@typescript-eslint/semi": ["error", "always"],
"@typescript-eslint/space-before-function-paren": 0,
"prefer-arrow-callback": "error",
"react/function-component-definition": [
"error",
{
"namedComponents": "arrow-function",
"unnamedComponents": "arrow-function"
}
"error",
{
"namedComponents": "arrow-function",
"unnamedComponents": "arrow-function"
}
]
},
"ignorePatterns": ["*/*.config.js", "*.config.js"],
Expand Down
37 changes: 18 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
name: CI

on:
push:
branches:
- main
pull_request:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: [self-hosted, debian-stable]
steps:
- name: Clean Workspace
uses: mickem/clean-after-action@v1
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Compile
run: npm run tsc

build:
runs-on: [self-hosted, debian-stable]
steps:
- name: Clean Workspace
uses: mickem/clean-after-action@v1
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Compile
run: npm run tsc
59 changes: 29 additions & 30 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
name: Publish package

on:
release:
types: [created]

release:
types: [created]

jobs:
build:
runs-on: [self-hosted, debian-stable]
steps:
- name: Clean Workspace
uses: mickem/clean-after-action@v1
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
scope: '@ZeroGachis'
# Skip post-install scripts here, as a malicious
# script could steal GITHUB_TOKEN.
- name: Install dependencies
run: npm ci --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# `npm rebuild` will run all those post-install scripts for us.
- name: Rebuild & Prepare dependencies
run: npm rebuild && npm run prepare --if-present
- name: Compile
run: npm run tsc
- name: Publish to Github Registry
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
runs-on: [self-hosted, debian-stable]
steps:
- name: Clean Workspace
uses: mickem/clean-after-action@v1
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
scope: '@ZeroGachis'
# Skip post-install scripts here, as a malicious
# script could steal GITHUB_TOKEN.
- name: Install dependencies
run: npm ci --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# `npm rebuild` will run all those post-install scripts for us.
- name: Rebuild & Prepare dependencies
run: npm rebuild && npm run prepare --if-present
- name: Compile
run: npm run tsc
- name: Publish to Github Registry
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
build
coverage
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"printWidth": 100,
"tabWidth": 4,
"trailingComma": "all",
"endOfLine": "crlf",
"overrides": [
{
"files": "*.json",
Expand Down
2 changes: 1 addition & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ const App = () => {
);
};

export default App;
export default App;
22 changes: 22 additions & 0 deletions package-lock.json

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

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"jest": "^28.1.1",
"jest-junit": "^15.0.0",
"pod-install": "^0.1.0",
"prettier": "2.8.4",
"react": "18.1.0",
"react-native": "0.70.6",
"typescript": "^4.9.5"
Expand All @@ -77,7 +78,5 @@
"<rootDir>/example/node_modules",
"<rootDir>/lib/"
]
},
"dependencies": {
}
}

0 comments on commit 9cadbba

Please sign in to comment.