Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mongoose-tsgen

Package Overview
Dependencies
Maintainers
1
Versions
148
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongoose-tsgen - npm Package Compare versions

Comparing version 7.0.8 to 7.0.9

17

lib/helpers/formatter.js

@@ -7,3 +7,6 @@ "use strict";

const prettier_1 = tslib_1.__importDefault(require("prettier"));
const eslint_1 = require("eslint");
// I removed ESLINT usage since it doesnt seem to add much value and adds room for bugs.
// If we want to re-add it, we need to add a check to ensure someone has an eslint config before linting files
// and set eslint as an optional dependency
// import { ESLint } from "eslint";
// NOTE: this could be sped up by formatting the generated file string prior to writing (no need to write file then read it again here and re-write it)

@@ -19,10 +22,10 @@ const prettifyFiles = (filePaths) => {

};
const fixFiles = async (filePaths) => {
const eslint = new eslint_1.ESLint({ fix: true });
const results = await eslint.lintFiles(filePaths);
await eslint_1.ESLint.outputFixes(results);
};
// const fixFiles = async (_filePaths: string[]) => {
// const eslint = new ESLint({ fix: true });
// const results = await eslint.lintFiles(filePaths);
// await ESLint.outputFixes(results);
// };
exports.format = async (filePaths) => {
prettifyFiles(filePaths);
await fixFiles(filePaths);
// await fixFiles(filePaths);
};

@@ -476,3 +476,5 @@ "use strict";

// custom, user-defined imports
fullTemplate += imports.join("\n") + "\n";
if (imports.length > 0)
fullTemplate += imports.join("\n") + "\n";
fullTemplate += "\n";
if (isAugmented)

@@ -479,0 +481,0 @@ fullTemplate += MODULE_DECLARATION_HEADER;

@@ -98,3 +98,3 @@ "use strict";

"no-format": command_1.flags.boolean({
description: "Disable formatting generated files with prettier and fixing with eslint."
description: "Disable formatting generated files with prettier."
}),

@@ -101,0 +101,0 @@ "no-func-types": command_1.flags.boolean({

{
"name": "mongoose-tsgen",
"description": "A Typescript interface generator for Mongoose that works out of the box.",
"version": "7.0.8",
"version": "7.0.9",
"author": "Francesco Virga @francescov1",

@@ -20,3 +20,2 @@ "bin": {

"cli-ux": "^5.5.0",
"eslint": "^7.13.0",
"flat": "^5.0.2",

@@ -42,2 +41,3 @@ "glob": "^7.1.6",

"@types/node": "^10.17.35",
"eslint": "^7.13.0",
"eslint-config-oclif": "^3.1.0",

@@ -44,0 +44,0 @@ "eslint-config-oclif-typescript": "^0.1.0",

@@ -142,3 +142,3 @@ # mongoose-tsgen

--no-format Disable formatting generated files with prettier and fixing with eslint.
--no-format Disable formatting generated files with prettier.

@@ -281,3 +281,3 @@ --no-func-types Disable using TS compiler API for method, static and query typings.

### generated typings file ./src/interfaces/mongoose.gen.ts
<!-- TODO: generate test file and replace with this -->
```typescript

@@ -284,0 +284,0 @@ /* tslint:disable */

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