Skip to content

Commit

Permalink
fix(lint): methodOverride cause lint fail
Browse files Browse the repository at this point in the history
  • Loading branch information
jackey8616 committed Oct 3, 2024
1 parent e04625e commit ca473d1
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 11 deletions.
4 changes: 3 additions & 1 deletion tests/esm/fixtures/express/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import { RegisterRoutes } from './routes.js';
export const app: express.Express = express();
app.use(bodyParser.urlencoded({ extended: true }) as RequestHandler);
app.use(bodyParser.json() as RequestHandler);
app.use(methodOverride());
app.use((req, res, next) => {
methodOverride()(req, res, next);
});
app.use((req: any, res: any, next: any) => {
req.stringValue = 'fancyStringForContext';
next();
Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/custom/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import { RegisterRoutes } from './customRoutes';
export const app: express.Express = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(methodOverride());
app.use((req, res, next) => {
methodOverride()(req, res, next);
});
app.use((req: any, res: any, next: any) => {
req.stringValue = 'fancyStringForContext';
next();
Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/express-dynamic-controllers/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { RegisterRoutes } from './routes';
export const app: express.Express = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(methodOverride());
app.use((req, res, next) => {
methodOverride()(req, res, next);
});
app.use((req: any, res: any, next: any) => {
req.stringValue = 'fancyStringForContext';
next();
Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/express-openapi3/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ import { RegisterRoutes } from './routes';
export const app: express.Express = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(methodOverride());
app.use((req, res, next) => {
methodOverride()(req, res, next);
});
app.use((req: any, res: any, next: any) => {
req.stringValue = 'fancyStringForContext';
next();
Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/express-router-with-custom-multer/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export const router = express.Router();
app.use('/v1', router);
router.use(bodyParser.urlencoded({ extended: true }));
router.use(bodyParser.json());
router.use(methodOverride());
router.use((req, res, next) => {
methodOverride()(req, res, next);
});
router.use((req: any, res: any, next: any) => {
req.stringValue = 'fancyStringForContext';
next();
Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/express-router/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export const router = express.Router();
app.use('/v1', router);
router.use(bodyParser.urlencoded({ extended: true }));
router.use(bodyParser.json());
router.use(methodOverride());
router.use((req, res, next) => {
methodOverride()(req, res, next);
});
router.use((req: any, res: any, next: any) => {
req.stringValue = 'fancyStringForContext';
next();
Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/express/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ import { RegisterRoutes } from './routes';
export const app: express.Express = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(methodOverride());
app.use((req, res, next) => {
methodOverride()(req, res, next);
});
app.use((req: any, res: any, next: any) => {
req.stringValue = 'fancyStringForContext';
next();
Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/inversify-async/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import { RegisterRoutes } from './routes';
export const app: express.Express = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(methodOverride());
app.use((req, res, next) => {
methodOverride()(req, res, next);
});
RegisterRoutes(app);

// It's important that this come after the main routes are registered
Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/inversify-cpg/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { RegisterRoutes } from './routes';
export const app: express.Express = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(methodOverride());
app.use((req, res, next) => {
methodOverride()(req, res, next);
});
RegisterRoutes(app);

// It's important that this come after the main routes are registered
Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/inversify-dynamic-container/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { RegisterRoutes } from './routes';
export const app: express.Express = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(methodOverride());
app.use((req, res, next) => {
methodOverride()(req, res, next);
});
RegisterRoutes(app);

// It's important that this come after the main routes are registered
Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/inversify/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { RegisterRoutes } from './routes';
export const app: express.Express = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(methodOverride());
app.use((req, res, next) => {
methodOverride()(req, res, next);
});
RegisterRoutes(app);

// It's important that this come after the main routes are registered
Expand Down

0 comments on commit ca473d1

Please sign in to comment.