Skip to content

Commit

Permalink
feat: add enforce-node-prefix eslint rule by default (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 authored Nov 25, 2023
1 parent 8227bdd commit 9480865
Show file tree
Hide file tree
Showing 14 changed files with 97 additions and 148 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/codeql.yml

This file was deleted.

6 changes: 2 additions & 4 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ on:
pull_request:
branches: [ master ]

workflow_dispatch: {}

jobs:
Job:
name: Node.js
uses: artusjs/github-actions/.github/workflows/node-test.yml@v1
uses: node-modules/github-actions/.github/workflows/node-test.yml@master
with:
os: 'ubuntu-latest'
version: '14, 16, 18'
version: '16, 18, 20'
6 changes: 1 addition & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ on:
push:
branches: [ master ]

workflow_dispatch: {}

jobs:
release:
name: Node.js
uses: artusjs/github-actions/.github/workflows/node-release.yml@v1
uses: eggjs/github-actions/.github/workflows/node-release.yml@master
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
with:
checkTest: false
73 changes: 73 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,76 @@
### Features

* Upgrade to tegg by default ([#22](https://github.com/eggjs/egg-boilerplate-ts/issues/22)) ([3ca85c4](https://github.com/eggjs/egg-boilerplate-ts/commit/3ca85c4fc41267a851f9e5acda70a74b836d730b))

---


1.8.0 / 2022-06-18
==================

**features**
* [[`0bc89be`](http://github.com/eggjs/egg-boilerplate-ts/commit/0bc89be0aac6128efb3efaf4eac8788436aedfd2)] - feat: upgrade deps version (#20) (吖猩 <<[email protected]>>)

1.7.0 / 2020-01-20
==================

**features**
* [[`144f5ae`](http://github.com/eggjs/egg-boilerplate-ts/commit/144f5ae09d6e196e92c3183a73d6bc26cb1795c0)] - feat: change tslint to eslint (#17) (吖猩 <<[email protected]>>)

1.6.0 / 2019-02-21
==================

**others**
* [[`520c5b5`](http://github.com/eggjs/egg-boilerplate-ts/commit/520c5b56d95a07fab02b7dbc8987a9711fbe1795)] - chore: using egg-bin declarations instead of require (#14) (吖猩 <<[email protected]>>)

1.5.0 / 2019-01-16
==================

* deps: upgrade tslint (#13)

1.4.0 / 2019-01-07
==================

* chore: scripts optimization (#12)

1.3.0 / 2018-09-11
==================

* feat: update deps and code optimization (#11)

1.2.3 / 2018-09-06
==================

* fix: typo (#10)

1.2.2 / 2018-06-14
==================

* fix: TSLint script and lint error (#9)

1.2.1 / 2018-05-30
==================

* fix: fix the config & appInfo define (#7)
* fix: git ignore. (#5)

1.2.0 / 2018-04-13
==================

* feat: adjust plugin (#4)
* chore: ignore node_modules* folders (#3)

1.1.1 / 2018-04-05
==================

* fix: test (#2)

1.1.0 / 2018-04-04
==================

* feat: less code (#1)

1.0.0 / 2018-04-04
==================

* feat: first version
70 changes: 0 additions & 70 deletions History.md

This file was deleted.

5 changes: 4 additions & 1 deletion boilerplate/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"root": true,
"extends": "eslint-config-egg/typescript"
"extends": [
"eslint-config-egg/typescript",
"eslint-config-egg/lib/rules/enforce-node-prefix"
]
}
6 changes: 1 addition & 5 deletions boilerplate/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
],
"console": "integratedTerminal",
"restart": true,
"protocol": "auto",
"port": 9229,
"autoAttachChildProcesses": true
},
{
Expand All @@ -28,12 +26,10 @@
"runtimeExecutable": "npm",
"runtimeArgs": [
"run",
"test-local",
"test:local",
"--",
"--inspect-brk"
],
"protocol": "auto",
"port": 9229,
"autoAttachChildProcesses": true
}
]
Expand Down
12 changes: 6 additions & 6 deletions boilerplate/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# hackernews-tegg
# tegg app

[Hacker News](https://news.ycombinator.com/) showcase using [tegg](https://github.com/eggjs/tegg)

Expand All @@ -7,18 +7,18 @@
### Development

```bash
$ npm i
$ npm run dev
$ open http://localhost:7001/
npm i
npm run dev
open http://localhost:7001/
```

Don't tsc compile at development mode, if you had run `tsc` then you need to `npm run clean` before `npm run dev`.

### Deploy

```bash
$ npm run tsc
$ npm start
npm run tsc
npm start
```

### Npm Scripts
Expand Down
10 changes: 5 additions & 5 deletions boilerplate/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"start": "egg-scripts start --daemon --title=egg-server-{{name}}",
"stop": "egg-scripts stop --title=egg-server-{{name}}",
"dev": "egg-bin dev",
"test-local": "egg-bin test -p",
"test": "npm run lint -- --fix && npm run test-local",
"test:local": "egg-bin test -p",
"test": "npm run lint -- --fix && npm run test:local",
"cov": "egg-bin cov -p",
"ci": "npm run lint && npm run cov && npm run tsc && npm run clean",
"lint": "eslint . --ext .ts --cache",
Expand All @@ -32,13 +32,13 @@
},
"devDependencies": {
"@types/mocha": "10",
"@types/node": "18",
"@types/node": "20",
"@eggjs/tsconfig": "1",
"egg-bin": "6",
"egg-mock": "5",
"eslint": "8",
"eslint-config-egg": "12",
"typescript": "4"
"eslint-config-egg": "13",
"typescript": "~5.2.2"
},
"engines": {
"node": ">=18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion boilerplate/test/app/module/bar/controller/home.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'assert';
import { strict as assert } from 'node:assert';
import { app } from 'egg-mock/bootstrap';

describe('test/app/module/bar/controller/home.test.ts', () => {
Expand Down
2 changes: 1 addition & 1 deletion boilerplate/test/app/module/bar/controller/user.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'assert';
import { strict as assert } from 'node:assert';
import { app } from 'egg-mock/bootstrap';

describe('test/app/module/bar/controller/user.test.ts', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'assert';
import { strict as assert } from 'node:assert';
import { app } from 'egg-mock/bootstrap';
import { HelloService } from '@/module/foo/service/HelloService';

Expand Down
5 changes: 0 additions & 5 deletions boilerplate/typings/index.d.ts

This file was deleted.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"ci-boilerplate": "npm run build && npm run install-deps && cd dist && npm run ci",
"clean": "rm -rf dist",
"build": "npm run clean && egg-init dist --force --silent --template=./",
"install-deps": "cd dist && cnpm i"
"install-deps": "cd dist && npm i"
},
"homepage": "https://github.com/eggjs/egg-boilerplate-ts",
"bugs": "https://github.com/eggjs/egg/issues",
Expand All @@ -20,9 +20,8 @@
},
"author": "TZ <[email protected]>",
"devDependencies": {
"cnpm": "^9.0.1",
"egg-init": "^2.3.1",
"eslint": "^8.34.0",
"eslint-config-egg": "^12.1.0"
"eslint-config-egg": "13"
}
}

0 comments on commit 9480865

Please sign in to comment.