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

schemalint

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

schemalint - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

.gitattributes

0

build/cli.d.ts
export {};

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export function processDatabase({ connection, rules, schemas }: {

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export namespace preferJsonbToJson {

@@ -0,0 +0,0 @@ "use strict";

2

package.json
{
"name": "schemalint",
"version": "0.0.2",
"version": "0.1.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "main": "build/index.js",

@@ -28,2 +28,5 @@ # Schemalint

},
plugins: ['./custom-rules'],
rules: {

@@ -30,0 +33,0 @@ 'table-name-casing': ['error', 'snake'],

@@ -0,0 +0,0 @@ import path from 'path';

@@ -0,1 +1,2 @@

import path from 'path';
import { keys, indexBy, prop, values } from 'ramda';

@@ -8,4 +9,2 @@ import knex from 'knex';

const registeredRules = indexBy(prop('name'), values(builtinRules));
let anyIssues = false;

@@ -15,3 +14,5 @@ const suggestedMigrations = [];

function report({ rule, identifier, message, suggestedMigration = null }) {
console.log(`${chalk.yellow(identifier)}: error ${chalk.red(rule)} : ${message}`);
console.log(
`${chalk.yellow(identifier)}: error ${chalk.red(rule)} : ${message}`
);
if (suggestedMigration) {

@@ -23,4 +24,14 @@ suggestedMigrations.push(suggestedMigration);

export async function processDatabase({ connection, rules, schemas }) {
console.log(`Connecting to ${chalk.greenBright(connection.database)} on ${connection.host}`);
export async function processDatabase({ connection, plugins, rules, schemas }) {
const pluginRules = plugins.map(p => require(path.join(process.cwd(), p)));
const allRules = [builtinRules, ...pluginRules].reduce((acc, elem) => {
return { ...acc, ...elem };
}, {});
const registeredRules = indexBy(prop('name'), values(allRules));
console.log(
`Connecting to ${chalk.greenBright(connection.database)} on ${
connection.host
}`
);
const knexConfig = {

@@ -50,3 +61,3 @@ client: 'pg',

for (const ruleKey of keys(mergedRules)) {
if (!ruleKey in registeredRules) {
if (!(ruleKey in registeredRules)) {
throw new Error(`Unknown rule: "${ruleKey}"`);

@@ -53,0 +64,0 @@ }

@@ -0,0 +0,0 @@ import { recase, detectCasing } from '@kristiandupont/recase';

@@ -0,0 +0,0 @@ {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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