Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps-dev): replace standard with neostandard #148

Merged
merged 2 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![CI](https://github.com/fastify/fastify-schedule/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/fastify/fastify-schedule/actions/workflows/ci.yml)
[![NPM version](https://img.shields.io/npm/v/@fastify/schedule.svg?style=flat)](https://www.npmjs.com/package/@fastify/schedule)
[![NPM downloads](https://img.shields.io/npm/dm/@fastify/schedule.svg?style=flat)](https://www.npmjs.com/package/@fastify/schedule)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)
[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)

Fastify plugin for scheduling periodic jobs. Provides an instance of [toad-scheduler](https://github.com/kibertoad/toad-scheduler) on fastify instance.
Jobs are stopped automatically when the fastify instance is stopped.
Expand Down
6 changes: 6 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict'

module.exports = require('neostandard')({
ignores: require('neostandard').resolveIgnoresFromGitignore(),
ts: true
})
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"type": "commonjs",
"types": "types/index.d.ts",
"scripts": {
"lint": "eslint",
"lint:fix": "eslint --fix",
"test": "npm run test:unit && npm run test:typescript",
"test:unit": "c8 --100 node --test",
"test:typescript": "tsd",
"lint": "standard",
"lint:fix": "standard --fix"
"test:typescript": "tsd"
},
"dependencies": {
"fastify-plugin": "^5.0.0"
Expand All @@ -30,8 +30,8 @@
"@types/node": "^22.0.0",
"c8": "^10.1.2",
"fastify": "^5.0.0",
"neostandard": "^0.11.9",
"prettier": "^3.2.5",
"standard": "^17.1.0",
"toad-scheduler": "^3.0.1",
"tsd": "^0.31.1"
},
Expand Down
10 changes: 5 additions & 5 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { FastifyPluginCallback } from "fastify";
import { ToadScheduler } from "toad-scheduler";
import { FastifyPluginCallback } from 'fastify'
import { ToadScheduler } from 'toad-scheduler'

declare module "fastify" {
declare module 'fastify' {
interface FastifyInstance {
scheduler: ToadScheduler;
}
}

type FastifySchedule = FastifyPluginCallback;
type FastifySchedule = FastifyPluginCallback

declare namespace fastifySchedule {
export const fastifySchedule: FastifySchedule
export { fastifySchedule as default }
}

declare function fastifySchedule(...params: Parameters<FastifySchedule>): ReturnType<FastifySchedule>
declare function fastifySchedule (...params: Parameters<FastifySchedule>): ReturnType<FastifySchedule>
export = fastifySchedule
46 changes: 23 additions & 23 deletions types/index.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import { FastifyInstance, FastifyPluginCallback } from "fastify";
import fastify from "fastify";
import { expectType } from "tsd";
import { FastifyInstance, FastifyPluginCallback } from 'fastify'
import fastify from 'fastify'
import { expectType } from 'tsd'

import { fastifySchedule as fastifyScheduleNamed } from "..";
import fastifyScheduleDefault from "..";
import * as fastifyScheduleStar from "..";
import fastifyScheduleCjsImport = require("..");
const fastifyScheduleCjs = require("./");
import { fastifySchedule as fastifyScheduleNamed } from '..'
import fastifyScheduleDefault from '..'
import * as fastifyScheduleStar from '..'
import fastifyScheduleCjsImport = require('..')
const fastifyScheduleCjs = require('./')

const app: FastifyInstance = fastify();
app.register(fastifyScheduleNamed);
app.register(fastifyScheduleDefault);
app.register(fastifyScheduleCjs);
app.register(fastifyScheduleCjsImport.default);
app.register(fastifyScheduleCjsImport.fastifySchedule);
app.register(fastifyScheduleStar.default);
app.register(fastifyScheduleStar.fastifySchedule);
const app: FastifyInstance = fastify()
app.register(fastifyScheduleNamed)
app.register(fastifyScheduleDefault)
app.register(fastifyScheduleCjs)
app.register(fastifyScheduleCjsImport.default)
app.register(fastifyScheduleCjsImport.fastifySchedule)
app.register(fastifyScheduleStar.default)
app.register(fastifyScheduleStar.fastifySchedule)

expectType<FastifyPluginCallback>(fastifyScheduleNamed);
expectType<FastifyPluginCallback>(fastifyScheduleDefault);
expectType<FastifyPluginCallback>(fastifyScheduleCjsImport.default);
expectType<FastifyPluginCallback>(fastifyScheduleCjsImport.fastifySchedule);
expectType<FastifyPluginCallback>(fastifyScheduleStar.default);
expectType<FastifyPluginCallback>(fastifyScheduleStar.fastifySchedule);
expectType<any>(fastifyScheduleCjs);
expectType<FastifyPluginCallback>(fastifyScheduleNamed)
expectType<FastifyPluginCallback>(fastifyScheduleDefault)
expectType<FastifyPluginCallback>(fastifyScheduleCjsImport.default)
expectType<FastifyPluginCallback>(fastifyScheduleCjsImport.fastifySchedule)
expectType<FastifyPluginCallback>(fastifyScheduleStar.default)
expectType<FastifyPluginCallback>(fastifyScheduleStar.fastifySchedule)
expectType<any>(fastifyScheduleCjs)
Loading