Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

chore(workflows): setup prettier and eslint workflow #14

Merged
merged 1 commit into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/1-bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ about: Report a bug encountered with this project
labels: kind/bug
---

<!--
<!--
Please use this template while reporting a bug and provide as much info as possible.
If the matter is security related, please disclose it privately via oss@levain.tech
-->
Expand All @@ -15,4 +15,4 @@ If the matter is security related, please disclose it privately via oss@levain.t

#### How to reproduce it (as minimally and precisely as possible):

#### Anything else we need to know?:
#### Anything else we need to know?:
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/2-enhancement.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ labels: kind/feature

#### What would you like to be added:

#### Why is this needed:
#### Why is this needed:
7 changes: 2 additions & 5 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ categories:
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&'
version-resolver:
minor:
labels:
- 'kind/feature'
default: patch
default: major
prerelease: false
version-template: "$MAJOR.0.0"
version-template: '$MAJOR.0.0'
template: |
$CHANGES
18 changes: 3 additions & 15 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
"helpers:pinGitHubActionDigests",
":semanticCommitTypeAll(bump)"
],
"extends": ["config:base", "helpers:pinGitHubActionDigests", ":semanticCommitTypeAll(bump)"],
"dependencyDashboard": true,
"dependencyDashboardAutoclose": false,
"major": {
Expand All @@ -13,19 +9,11 @@
"rangeStrategy": "bump",
"packageRules": [
{
"matchPackagePatterns": [
"^@birthdayresearch/sticky",
"^@birthdayresearch/eslint-config"
],
"matchPackagePatterns": ["^@birthdayresearch/sticky", "^@birthdayresearch/eslint-config"],
"groupName": "@birthdayresearch/sticky"
},
{
"matchPackageNames": [
"expo",
"@babel/core",
"@types/react",
"typescript"
],
"matchPackageNames": ["expo", "@babel/core", "@types/react", "typescript"],
"groupName": "yarn expo-cli upgrade",
"enabled": false
},
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
workflow_dispatch:
pull_request:
branches: [main]
merge_group:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint_prettier:
name: Lint (prettier)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- run: corepack enable yarn

- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version-file: '.nvmrc'
cache: yarn

- run: yarn install --frozen-lockfile

- run: yarn prettier --check .

lint_eslint:
name: Lint (eslint)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- run: corepack enable yarn

- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version-file: '.nvmrc'
cache: yarn

- run: yarn install --frozen-lockfile

- run: yarn turbo run lint
2 changes: 1 addition & 1 deletion .github/workflows/expo-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
body: |
#### What this PR does / why we need it:
Bump expo dependencies to newest release with `expo-cli upgrade`.
branch: github-actions/expo-deps
branch: github-actions/expo-deps
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.husky
.idea
*.d.ts
*.d.ts.map
*.js
*.js.map
yarn.lock
.contented
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
## License & Disclaimer

By using the `levaintech/keychain` repository, you (the user) agree to be bound by the terms of the
[GPL License](https://github.com/levaintech/keychain/blob/main/LICENSE).
[GPL License](https://github.com/levaintech/keychain/blob/main/LICENSE).
5 changes: 3 additions & 2 deletions app/AppEntry.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { registerRootComponent } from 'expo';
import App from './src/App';

registerRootComponent(App);
import App from './src/App.tsx';

registerRootComponent(App);
2 changes: 1 addition & 1 deletion app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
## Dependencies Management

- `package.json:dependencies` that are required for the app to run used in production and installed on the client (mobile devices).
- `package.json:devDependencies` that are required for the app to build and function but not necessary part of the app such as testing, linting, etc.
- `package.json:devDependencies` that are required for the app to build and function but not necessary part of the app such as testing, linting, etc.
16 changes: 10 additions & 6 deletions app/app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"expo": {
"name": "keychain",
"slug": "keychain",
"name": "Levain Keychain",
"slug": "levain-keychain",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
Expand All @@ -11,9 +11,7 @@
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"assetBundlePatterns": [
"**/*"
],
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true
},
Expand All @@ -25,6 +23,12 @@
},
"web": {
"favicon": "./assets/favicon.png"
}
},
"extra": {
"eas": {
"projectId": "538ec1e8-a11b-4465-acfa-26b5df238331"
}
},
"owner": "levain"
}
}
2 changes: 1 addition & 1 deletion app/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = function(api) {
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
Expand Down
35 changes: 29 additions & 6 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,34 @@
{
"name": "@levaintech/keychain-app",
"private": true,
"name": "@levain-keychain/app",
"version": "1.0.0",
"private": true,
"main": "AppEntry.js",
"scripts": {
"lint": "eslint .",
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
"start:android": "expo start --android",
"start:ios": "expo start --ios",
"start:web": "expo start --web"
},
"lint-staged": {
"*": [
"prettier --write --ignore-unknown"
],
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write"
]
},
"eslintConfig": {
"parserOptions": {
"project": "./tsconfig.json"
},
"extends": [
"@levain-keychain"
],
"ignorePatterns": [
"babel.config.js"
]
},
"dependencies": {
"@babel/core": "^7.20.0",
Expand All @@ -16,9 +37,11 @@
"expo-status-bar": "~1.4.4",
"react": "18.2.0",
"react-native": "0.71.3",
"typescript": "^4.9.4"
"typescript": "4.9.5"
},
"devDependencies": {
"@levain-keychain/eslint-config": "0.0.0",
"eas-cli": "^3.13.3",
"expo-cli": "^6.3.8"
}
}
2 changes: 1 addition & 1 deletion app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';

export default function App() {
export default function App(): JSX.Element {
return (
<View style={styles.container}>
<Text>KeyChain — Open up App.js to start working on your app!</Text>
Expand Down
6 changes: 4 additions & 2 deletions app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"extends": "expo/tsconfig.base",
"compilerOptions": {}
}
"compilerOptions": {
"strictNullChecks": true
}
}
21 changes: 19 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
{
"name": "@levaintech/keychain",
"name": "@levain-keychain/project",
"private": true,
"workspaces": [
"packages/*",
"app"
],
"private": true,
"scripts": {
"format": "prettier --write .",
"lint": "turbo run lint -- --fix",
"prepare": "husky install"
},
"lint-staged": {
"*": "prettier --write --ignore-unknown"
},
"prettier": "@stickyjs/prettier",
"devDependencies": {
"@stickyjs/eslint-config": "1.0.1",
"@stickyjs/prettier": "1.0.1",
"@stickyjs/turbo": "1.0.1",
"@stickyjs/typescript": "1.0.1",
"turbo": "1.10.3",
"typescript": "4.9.5"
},
"packageManager": "yarn@1.22.19",
"engines": {
"node": "^18.15.0",
Expand Down
11 changes: 11 additions & 0 deletions packages/eslint-config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
extends: [
'universe',
'universe/shared/typescript-analysis',
'@stickyjs'
],
rules: {
'import/no-default-export': 'off',
'@typescript-eslint/explicit-function-return-type': ['error', {allowExpressions: true}],
}
};
10 changes: 10 additions & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "@levain-keychain/eslint-config",
"version": "0.0.0",
"private": true,
"main": "index.js",
"dependencies": {
"@stickyjs/eslint-config": "1.0.1",
"eslint-config-universe": "11.2.0"
}
}
11 changes: 11 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://turborepo.org/schema.json",
"pipeline": {
"clean": {
"cache": false
},
"lint": {
"outputs": []
}
}
}
Loading