File tree Expand file tree Collapse file tree 8 files changed +42
-51
lines changed Expand file tree Collapse file tree 8 files changed +42
-51
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
module . exports = {
2
2
'*.md' : ( filenames ) => filenames . map ( ( filename ) => `remark ${ filename } -qfo` ) ,
3
3
'package.json' : 'fixpack' ,
4
- '*.js' : 'xo --fix'
4
+ '*.js' : 'eslint . --fix'
5
5
} ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3
3
> Router middleware for [ Koa] ( https://github.com/koajs/koa ) . Maintained by [ Forward Email] [ forward-email ] and [ Lad] [ ] .
4
4
5
5
[ ![ 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
+
7
9
[ ![ styled with prettier] ( https://img.shields.io/badge/styled_with-prettier-ff69b4.svg )] ( https://github.com/prettier/prettier )
8
10
[ ![ made with lass] ( https://img.shields.io/badge/made_with-lass-95CC28.svg )] ( https://lass.js.org )
9
11
[ ![ 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 {
51
51
* @constructor
52
52
*/
53
53
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 ) ;
55
55
56
56
this . opts = opts ;
57
57
this . methods = this . opts . methods || [
@@ -581,7 +581,6 @@ class Router {
581
581
582
582
debug ( 'test %s %s' , layer . path , layer . regexp ) ;
583
583
584
- // eslint-disable-next-line unicorn/prefer-regexp-test
585
584
if ( layer . match ( path ) ) {
586
585
matched . path . push ( layer ) ;
587
586
@@ -830,7 +829,7 @@ for (const method of methods) {
830
829
}
831
830
832
831
// Alias for `router.delete()` because delete is a reserved word
833
- // eslint-disable-next-line dot-notation
832
+
834
833
Router . prototype . del = Router . prototype [ 'delete' ] ;
835
834
836
835
module . exports = Router ;
Original file line number Diff line number Diff line change 31
31
"@commitlint/config-conventional" : " ^17.7.0" ,
32
32
"@ladjs/env" : " ^4.0.0" ,
33
33
"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 " ,
36
36
"fixpack" : " ^4.0.0" ,
37
37
"husky" : " ^9.1.7" ,
38
38
"jsdoc-to-markdown" : " ^8.0.0" ,
42
42
"nyc" : " ^17.0.0" ,
43
43
"remark-cli" : " 11" ,
44
44
"remark-preset-github" : " ^4.0.4" ,
45
- "supertest" : " ^7.0.0" ,
46
- "xo" : " 0.53.1"
45
+ "supertest" : " ^7.0.0"
47
46
},
48
47
"engines" : {
49
48
"node" : " >= 18"
69
68
"benchmark" : " node bench/run.js" ,
70
69
"coverage" : " nyc npm run test" ,
71
70
"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" ,
73
72
"prepare" : " husky install" ,
74
73
"pretest" : " npm run lint" ,
75
74
"test" : " mocha test/**/*.js" ,
Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ describe('Router', () => {
270
270
router
271
271
. get (
272
272
'users_single' ,
273
- new RegExp ( '/users/:id(.*)' ) , // eslint-disable-line prefer-regex-literals
273
+ new RegExp ( '/users/:id(.*)' ) ,
274
274
( ctx , next ) => {
275
275
ctx . body = { single : true } ;
276
276
next ( ) ;
You can’t perform that action at this time.
0 commit comments