From 2f1f09458e894baea2ef562648307a16c9aa14e0 Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Tue, 5 Sep 2023 22:01:01 +0200 Subject: [PATCH] fix(rules): add Next.js --- src/rules/__snapshots__/index.test.ts.snap | 1 + src/rules/js/index.ts | 1 + src/rules/js/nextjs.ts | 9 +++++++++ .../spec/nodejs/__snapshots__/component.test.ts.snap | 6 ++++++ src/types/techs.ts | 1 + 5 files changed, 18 insertions(+) create mode 100644 src/rules/js/nextjs.ts diff --git a/src/rules/__snapshots__/index.test.ts.snap b/src/rules/__snapshots__/index.test.ts.snap index 5b1448fa..b2616903 100644 --- a/src/rules/__snapshots__/index.test.ts.snap +++ b/src/rules/__snapshots__/index.test.ts.snap @@ -135,6 +135,7 @@ exports[`all > should match everything 1`] = ` "neo4j", "netlify", "newrelic", + "nextjs", "nginx", "nodejs", "notion", diff --git a/src/rules/js/index.ts b/src/rules/js/index.ts index 228ea8b9..a9006f63 100644 --- a/src/rules/js/index.ts +++ b/src/rules/js/index.ts @@ -6,6 +6,7 @@ import './express.js'; import './fastify.js'; import './hotjar.js'; import './koa.js'; +import './nextjs.js'; import './prettier.js'; import './prisma.js'; import './puppeteer.js'; diff --git a/src/rules/js/nextjs.ts b/src/rules/js/nextjs.ts new file mode 100644 index 00000000..9c6dda88 --- /dev/null +++ b/src/rules/js/nextjs.ts @@ -0,0 +1,9 @@ +import { register } from '../../register.js'; + +register({ + tech: 'nextjs', + name: 'Next.js', + type: 'tool', + files: ['next.config.js'], + dependencies: [{ type: 'npm', name: 'next' }], +}); diff --git a/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap b/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap index 36d4aa61..119926b8 100644 --- a/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap +++ b/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap @@ -76,6 +76,7 @@ exports[`npm > should match everything 1`] = ` "neo4j", "netlify", "newrelic", + "nextjs", "nodejs", "okta", "openai", @@ -766,6 +767,11 @@ exports[`npm > should match everything 2`] = ` "newrelic", "0.0.0", ], + [ + "npm", + "next", + "0.0.0", + ], [ "npm", "node-mailjet", diff --git a/src/types/techs.ts b/src/types/techs.ts index 491e882e..a14ef505 100644 --- a/src/types/techs.ts +++ b/src/types/techs.ts @@ -161,6 +161,7 @@ export type AllowedKeys = | 'neo4j' | 'netlify' | 'newrelic' + | 'nextjs' | 'nginx' | 'nodejs' | 'notion'