@jsse/eslint-config 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -1,13 +1,32 @@
1
- 'use strict';
2
-
3
- var fs = require('fs');
4
- var events = require('events');
5
-
6
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
7
-
8
- var fs__default = /*#__PURE__*/_interopDefault(fs);
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
9
24
 
10
25
  // src/cli.ts
26
+ var import_node_fs = __toESM(require("fs"), 1);
27
+
28
+ // node_modules/.pnpm/cac@6.7.14/node_modules/cac/dist/index.mjs
29
+ var import_events = require("events");
11
30
  function toArr(any) {
12
31
  return any == null ? [] : Array.isArray(any) ? any : [any];
13
32
  }
@@ -407,7 +426,7 @@ var GlobalCommand = class extends Command {
407
426
  }
408
427
  };
409
428
  var __assign = Object.assign;
410
- var CAC = class extends events.EventEmitter {
429
+ var CAC = class extends import_events.EventEmitter {
411
430
  constructor(name = "") {
412
431
  super();
413
432
  this.name = name;
@@ -597,7 +616,7 @@ var CAC = class extends events.EventEmitter {
597
616
  var cac = (name = "") => new CAC(name);
598
617
 
599
618
  // package.json
600
- var version = "0.0.3";
619
+ var version = "0.0.4";
601
620
 
602
621
  // src/cli.ts
603
622
  var cli = cac("jsselint");
@@ -628,28 +647,28 @@ export default jsse(
628
647
  cli.command("init", "create eslint config file").option("--force", "force create eslint config file").action(async (options) => {
629
648
  console.log("init");
630
649
  const configPath = "eslint.config.js";
631
- if (fs__default.default.existsSync(configPath)) {
650
+ if (import_node_fs.default.existsSync(configPath)) {
632
651
  const msg = "eslint.config.js already exists";
633
652
  console.warn(msg);
634
653
  if (!options.force) {
635
654
  throw new Error(msg);
636
655
  }
637
656
  }
638
- if (!fs__default.default.existsSync("package.json")) {
657
+ if (!import_node_fs.default.existsSync("package.json")) {
639
658
  const msg = "package.json not found";
640
659
  console.warn(msg);
641
660
  throw new Error(msg);
642
661
  }
643
- const packageJson = JSON.parse(fs__default.default.readFileSync("package.json", "utf-8"));
662
+ const packageJson = JSON.parse(import_node_fs.default.readFileSync("package.json", "utf-8"));
644
663
  const isModule = packageJson.type === "module";
645
664
  const eslintConfigString = [
646
665
  isModule ? configStringEsm : configStringCjs,
647
666
  "/* ALT */",
648
667
  (isModule ? configStringCjs : configStringEsm).split("\n").map((line) => `// ${line}`).join("\n")
649
668
  ];
650
- fs__default.default.writeFileSync(configPath, eslintConfigString.join("\n"));
669
+ import_node_fs.default.writeFileSync(configPath, eslintConfigString.join("\n"));
651
670
  console.log(`made eslint.config.js (type: ${packageJson.type})`);
652
671
  });
653
672
  cli.help();
654
- cli.version(version );
673
+ cli.version(typeof version === "string" ? version : "unknown");
655
674
  cli.parse();
package/dist/cli.js CHANGED
@@ -1,7 +1,8 @@
1
- import fs from 'fs';
2
- import { EventEmitter } from 'events';
3
-
4
1
  // src/cli.ts
2
+ import fs from "fs";
3
+
4
+ // node_modules/.pnpm/cac@6.7.14/node_modules/cac/dist/index.mjs
5
+ import { EventEmitter } from "events";
5
6
  function toArr(any) {
6
7
  return any == null ? [] : Array.isArray(any) ? any : [any];
7
8
  }
@@ -591,7 +592,7 @@ var CAC = class extends EventEmitter {
591
592
  var cac = (name = "") => new CAC(name);
592
593
 
593
594
  // package.json
594
- var version = "0.0.3";
595
+ var version = "0.0.4";
595
596
 
596
597
  // src/cli.ts
597
598
  var cli = cac("jsselint");
@@ -645,5 +646,5 @@ cli.command("init", "create eslint config file").option("--force", "force create
645
646
  console.log(`made eslint.config.js (type: ${packageJson.type})`);
646
647
  });
647
648
  cli.help();
648
- cli.version(version );
649
+ cli.version(typeof version === "string" ? version : "unknown");
649
650
  cli.parse();