Socket
Socket
Sign inDemoInstall

create-textlint-rule

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-textlint-rule - npm Package Compare versions

Comparing version 1.5.0 to 2.0.0

25

bin/cmd.js
#!/usr/bin/env node
"use strict";
const meow = require("meow");
const chalk = require("chalk");
const updateNotifier = require("update-notifier");
const pkg = require("../package.json");
const cliHandler = require("../lib/cli-handler");
import meow from "meow";
import chalk from "chalk";
import updateNotifier from "update-notifier";
import cliHandler from "../lib/cli-handler.js";
import { readFile } from "node:fs/promises";
export const getPackageInfo = async () => {
const pkg = await readFile(new URL("../package.json", import.meta.url));
return JSON.parse(pkg);
};
const cli = meow(

@@ -28,5 +31,5 @@ `

{
alias: {
h: "help"
}
importMeta: import.meta,
autoHelp: true,
autoVersion: true
}

@@ -42,3 +45,3 @@ );

updateNotifier({
pkg: pkg,
pkg: await getPackageInfo(),
updateCheckInterval: 1000 * 60 * 60 * 24 * 7

@@ -59,3 +62,3 @@ }).notify();

})
.catch(error => {
.catch((error) => {
console.log(chalk.red(`✗ Error: ${error.message}`));

@@ -62,0 +65,0 @@ console.log();

@@ -1,11 +0,9 @@

// MIT © 2016 azu
"use strict";
const path = require("path");
const chalk = require("chalk");
const createTextlintRule = require("./scripts/create-textlint-rule");
import chalk from "chalk";
import createTextlintRule from "./scripts/create-textlint-rule.js";
/**
* @param {string} projectName
* @param {{
* yes: boolean
* yarn: boolean
* yes: boolean,
* yarn: boolean,
* cwd: string

@@ -15,6 +13,6 @@ * }} options

*/
module.exports = function(projectName, options = {}) {
export default function (projectName, options = {}) {
return createTextlintRule(projectName, options).then(() => {
console.log(chalk.green(`✔ Complete: Let's write textlint rule`));
});
};
}

@@ -1,7 +0,5 @@

// MIT © 2016 azu
"use strict";
const spawn = require("cross-spawn-promise");
const path = require("path");
const rimraf = require("rimraf");
const chalk = require("chalk");
import rimraf from "rimraf";
import chalk from "chalk";
import spawn from "cross-spawn-promise";
import path from "node:path";

@@ -12,5 +10,5 @@ /**

* @param {{
* yes: boolean
* yarn: boolean
* typescript: boolean
* yes: boolean,
* yarn: boolean,
* typescript: boolean,
* cwd: string

@@ -20,3 +18,3 @@ * }} [options]

*/
module.exports = function(projectName, options = {}) {
export default function (projectName, options = {}) {
const useYarn = options.yarn !== undefined;

@@ -27,4 +25,4 @@ const useYes = options.yes !== undefined;

const ruleName = isInitInCurrentDir
? path.basename(options.cwd)
: `textlint-rule-${projectName.replace(/^textlint-rule-/, "")}`;
? path.basename(options.cwd)
: `textlint-rule-${projectName.replace(/^textlint-rule-/, "")}`;
if (isInitInCurrentDir && !/^textlint-rule-/.test(ruleName)) {

@@ -37,6 +35,3 @@ throw new Error(`Current directory name should start with "textlint-rule-<rule-name>": ${ruleName}.`);

: "https://github.com/textlint/textlint-rule-template.git";
return spawn(`git`, [
"clone", "--depth=1", gitRepositoryUrl,
isInitInCurrentDir ? "." : ruleName
], {
return spawn(`git`, ["clone", "--depth=1", gitRepositoryUrl, isInitInCurrentDir ? "." : ruleName], {
stdio: "inherit"

@@ -81,2 +76,2 @@ })

});
};
}
{
"directories": {
"test": "test"
},
"author": "azu",
"license": "MIT",
"files": [
"bin/",
"lib/"
],
"name": "create-textlint-rule",
"version": "1.5.0",
"version": "2.0.0",
"description": "Create textlint rule project with no configuration.",
"main": "lib/create-textlint-rule.js",
"bin": {
"create-textlint-rule": "bin/cmd.js"
},
"scripts": {
"test": "./test/test.sh",
"prettier": "prettier --write \"**/*.{js,jsx,ts,tsx,css}\""
},
"keywords": [

@@ -28,2 +11,6 @@ "textlint",

],
"homepage": "https://github.com/textlint/create-textlint-rule",
"bugs": {
"url": "https://github.com/textlint/create-textlint-rule/issues"
},
"repository": {

@@ -33,35 +20,47 @@ "type": "git",

},
"bugs": {
"url": "https://github.com/textlint/create-textlint-rule/issues"
"license": "MIT",
"author": "azu",
"type": "module",
"main": "lib/create-textlint-rule.js",
"bin": {
"create-textlint-rule": "bin/cmd.js"
},
"homepage": "https://github.com/textlint/create-textlint-rule",
"directories": {
"test": "test"
},
"files": [
"bin/",
"lib/"
],
"engines": {
"node": ">=14.16"
},
"scripts": {
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,css}\"",
"prepare": "git config --local core.hooksPath .githooks",
"test": "./test/test.sh"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,css}": [
"prettier --write"
]
},
"prettier": {
"printWidth": 120,
"singleQuote": false,
"tabWidth": 4,
"trailingComma": "none"
},
"dependencies": {
"chalk": "^4.1.0",
"chalk": "^5.1.2",
"cross-spawn": "^7.0.3",
"cross-spawn-promise": "^0.10.2",
"meow": "^7.0.1",
"meow": "^11.0.0",
"rimraf": "^3.0.2",
"update-notifier": "^4.1.0"
"update-notifier": "^6.0.2"
},
"devDependencies": {
"husky": "^4.2.5",
"lint-staged": "^10.2.11",
"prettier": "^2.0.5"
},
"prettier": {
"singleQuote": false,
"printWidth": 120,
"tabWidth": 4
},
"husky": {
"hooks": {
"precommit": "lint-staged"
}
},
"lint-staged": {
"*.{js,jsx,ts,tsx,css}": [
"prettier --write",
"git add"
]
"lint-staged": "^13.0.3",
"prettier": "^2.7.1"
}
}

@@ -11,3 +11,3 @@ # create-textlint-rule [![Build Status](https://travis-ci.org/textlint/create-textlint-rule.svg?branch=master)](https://travis-ci.org/textlint/create-textlint-rule)

npm install create-textlint-rule -g
npm install --global create-textlint-rule
# Or

@@ -14,0 +14,0 @@ npx create-textlint-rule

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