New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

prisma-lint

Package Overview
Dependencies
Maintainers
5
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prisma-lint - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

8

dist/common/snake-case.js

@@ -19,2 +19,3 @@ import pluralize from 'pluralize';

const snakeCaseWithCompoundWords = compountWordsAsSnakeCase.reduce((acc, compoundWord) => acc.replace(compoundWord, compoundWord.replace(/_/g, '')), snakeCase);
let result = snakeCaseWithCompoundWords;
if (options.pluralize) {

@@ -26,5 +27,8 @@ if (options.irregularPlurals) {

}
return pluralize(snakeCaseWithCompoundWords);
result = pluralize(snakeCaseWithCompoundWords);
}
return snakeCaseWithCompoundWords;
if (options.requirePrefix) {
result = `${options.requirePrefix}${snakeCaseWithCompoundWords}`;
}
return result;
}

@@ -8,2 +8,3 @@ import { z } from 'zod';

compoundWords: z.array(z.string()).optional(),
requirePrefix: z.string().optional(),
})

@@ -47,2 +48,13 @@ .strict()

*
* @example { requirePrefix: ["_"] }
* // good
* model PersistedQuery {
* fooId String @map(name: "_foo_id")
* }
*
* // bad
* model PersistedQuery {
* fooId String @map(name: "foo_id")
* }
*
*/

@@ -53,3 +65,3 @@ export default {

create: (config, context) => {
const compoundWords = config?.compoundWords;
const { compoundWords, requirePrefix } = config ?? {};
return {

@@ -63,3 +75,6 @@ Field: (model, field) => {

const { name, attributes } = field;
const expectedSnakeCase = toSnakeCase(name, { compoundWords });
const expectedSnakeCase = toSnakeCase(name, {
compoundWords,
requirePrefix,
});
const isMappingRequired = !isAllLowerCase(name);

@@ -66,0 +81,0 @@ if (!attributes) {

{
"name": "prisma-lint",
"version": "0.1.1",
"version": "0.1.2",
"description": "A linter for Prisma schema files.",

@@ -5,0 +5,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc