Skip to content

Commit

Permalink
init project
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackHole1 committed May 10, 2023
1 parent e7435bf commit e97c177
Show file tree
Hide file tree
Showing 26 changed files with 3,624 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish

on:
push:
branches:
- release

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0

- uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd # v2.2.4
with:
version: 8

- uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
with:
node-version: 18
cache: "pnpm"
scope: "@oomol"

- name: Install dependencies
run: pnpm i || pnpm i || pnpm i

- name: Publish
run: pnpm -r publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
node_modules
.idea
.vscode
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# code-style

* [ESLint](./eslint/README.md)
* [TsConfig](./tsconfig/README.md)
71 changes: 71 additions & 0 deletions eslint/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# EsLint code-style

## JavaScript project

### Install

```bash
pnpm add eslint -D
pnpm add @electronjs-cn/eslint-config-basic -D
```

## Configuring

### Create .eslintrc.js file

```js
module.exports = {
extends: [
"@electronjs-cn/eslint-config-basic",
],
};
```

## TypeScript Project

### Install

```bash
pnpm add eslint typescript -D
pnpm add @electronjs-cn/eslint-config-ts -D

# If is node project, please execute the following command
pnpm add @types/node -D
```

### Create .eslintrc.js file

```js
module.exports = {
parserOptions: {
project: "./tsconfig.json",
},

extends: [
"@electronjs-cn/eslint-config-ts",
],
};
```

## React Project

### Install

```bash
pnpm add eslint typescript -D
pnpm add @electronjs-cn/eslint-config-react -D
```

### Create .eslintrc.js file

```js
module.exports = {
parserOptions: {
project: "./tsconfig.json",
},

extends: [
"@electronjs-cn/eslint-config-react",
],
};
```
Loading

0 comments on commit e97c177

Please sign in to comment.