File tree Expand file tree Collapse file tree 9 files changed +44
-53
lines changed
Expand file tree Collapse file tree 9 files changed +44
-53
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1010 os :
1111 - ubuntu-latest
1212 node_version :
13- - 18
1413 - 20
1514 - 22
15+ - 24
1616 name : Node ${{ matrix.node_version }} on ${{ matrix.os }}
1717 steps :
1818 - uses : actions/checkout@v3
Original file line number Diff line number Diff line change 11module . exports = {
22 '*.md' : ( filenames ) => filenames . map ( ( filename ) => `remark ${ filename } -qfo` ) ,
33 'package.json' : 'fixpack' ,
4- '*.js' : 'xo --fix'
4+ '*.js' : 'eslint . --fix'
55} ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 33> Router middleware for [ Koa] ( https://github.com/koajs/koa ) . Maintained by [ Forward Email] [ forward-email ] and [ Lad] [ ] .
44
55[ ![ build status] ( https://github.com/koajs/router/actions/workflows/ci.yml/badge.svg )] ( https://github.com/koajs/router/actions/workflows/ci.yml )
6- [ ![ code style] ( https://img.shields.io/badge/code_style-XO-5ed9c7.svg )] ( https://github.com/sindresorhus/xo )
6+
7+ <!-- [](https://github.com/sindresorhus/xo) -->
8+
79[ ![ styled with prettier] ( https://img.shields.io/badge/styled_with-prettier-ff69b4.svg )] ( https://github.com/prettier/prettier )
810[ ![ made with lass] ( https://img.shields.io/badge/made_with-lass-95CC28.svg )] ( https://lass.js.org )
911[ ![ license] ( https://img.shields.io/github/license/koajs/router.svg )] ( LICENSE )
Original file line number Diff line number Diff line change 1+ const js = require ( '@eslint/js' ) ;
2+ const eslintPluginUnicorn = require ( 'eslint-plugin-unicorn' ) ;
3+
4+ module . exports = [
5+ js . configs . recommended ,
6+ {
7+ languageOptions : {
8+ ecmaVersion : 2022 ,
9+ sourceType : 'commonjs' ,
10+ globals : {
11+ console : true ,
12+ setTimeout : true ,
13+ __dirname : true ,
14+ // Mocha globals
15+ before : true ,
16+ after : true ,
17+ beforeEach : true ,
18+ describe : true ,
19+ it : true
20+ }
21+ } ,
22+ plugins : {
23+ unicorn : eslintPluginUnicorn ,
24+ } ,
25+ rules : {
26+ 'promise/prefer-await-to-then' : 0 ,
27+ 'logical-assignment-operators' : 0 ,
28+ 'arrow-body-style' : 0 ,
29+ }
30+ }
31+ ] ;
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ class Router {
5151 * @constructor
5252 */
5353 constructor ( opts = { } ) {
54- if ( ! ( this instanceof Router ) ) return new Router ( opts ) ; // eslint-disable-line no-constructor-return
54+ if ( ! ( this instanceof Router ) ) return new Router ( opts ) ;
5555
5656 this . opts = opts ;
5757 this . methods = this . opts . methods || [
@@ -581,7 +581,6 @@ class Router {
581581
582582 debug ( 'test %s %s' , layer . path , layer . regexp ) ;
583583
584- // eslint-disable-next-line unicorn/prefer-regexp-test
585584 if ( layer . match ( path ) ) {
586585 matched . path . push ( layer ) ;
587586
@@ -830,7 +829,7 @@ for (const method of methods) {
830829}
831830
832831// Alias for `router.delete()` because delete is a reserved word
833- // eslint-disable-next-line dot-notation
832+
834833Router . prototype . del = Router . prototype [ 'delete' ] ;
835834
836835module . exports = Router ;
Original file line number Diff line number Diff line change 3131 "@commitlint/config-conventional" : " ^17.7.0" ,
3232 "@ladjs/env" : " ^4.0.0" ,
3333 "chalk" : " ^5.4.1" ,
34- "eslint" : " ^8.39 .0" ,
35- "eslint-config-xo-lass " : " ^2 .0.1 " ,
34+ "eslint" : " ^9.32 .0" ,
35+ "eslint-plugin-unicorn " : " ^60 .0.0 " ,
3636 "fixpack" : " ^4.0.0" ,
3737 "husky" : " ^9.1.7" ,
3838 "jsdoc-to-markdown" : " ^8.0.0" ,
4242 "nyc" : " ^17.0.0" ,
4343 "remark-cli" : " 11" ,
4444 "remark-preset-github" : " ^4.0.4" ,
45- "supertest" : " ^7.0.0" ,
46- "xo" : " 0.53.1"
45+ "supertest" : " ^7.0.0"
4746 },
4847 "engines" : {
49- "node" : " >= 18 "
48+ "node" : " >= 20 "
5049 },
5150 "files" : [
5251 " lib"
6968 "benchmark" : " node bench/run.js" ,
7069 "coverage" : " nyc npm run test" ,
7170 "docs" : " NODE_ENV=test jsdoc2md -t ./lib/API_tpl.hbs --src ./lib/*.js >| API.md" ,
72- "lint" : " xo --fix && remark . -qfo && fixpack" ,
71+ "lint" : " eslint . --fix && remark . -qfo && fixpack" ,
7372 "prepare" : " husky install" ,
7473 "pretest" : " npm run lint" ,
7574 "test" : " mocha test/**/*.js" ,
Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ describe('Router', () => {
270270 router
271271 . get (
272272 'users_single' ,
273- new RegExp ( '/users/:id(.*)' ) , // eslint-disable-line prefer-regex-literals
273+ new RegExp ( '/users/:id(.*)' ) ,
274274 ( ctx , next ) => {
275275 ctx . body = { single : true } ;
276276 next ( ) ;
You can’t perform that action at this time.
0 commit comments