@jsse/eslint-config 0.0.3 → 0.0.5

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2023-PRESENT Jesse K Rubin <https://github.com/jessekrubin>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2023-PRESENT Jesse K Rubin <https://github.com/jessekrubin>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
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.5";
601
620
 
602
621
  // src/cli.ts
603
622
  var cli = cac("jsselint");
@@ -628,28 +647,30 @@ 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(
663
+ import_node_fs.default.readFileSync("package.json", "utf-8")
664
+ );
644
665
  const isModule = packageJson.type === "module";
645
666
  const eslintConfigString = [
646
667
  isModule ? configStringEsm : configStringCjs,
647
668
  "/* ALT */",
648
669
  (isModule ? configStringCjs : configStringEsm).split("\n").map((line) => `// ${line}`).join("\n")
649
670
  ];
650
- fs__default.default.writeFileSync(configPath, eslintConfigString.join("\n"));
671
+ import_node_fs.default.writeFileSync(configPath, eslintConfigString.join("\n"));
651
672
  console.log(`made eslint.config.js (type: ${packageJson.type})`);
652
673
  });
653
674
  cli.help();
654
- cli.version(version );
675
+ cli.version(typeof version === "string" ? version : "unknown");
655
676
  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.5";
595
596
 
596
597
  // src/cli.ts
597
598
  var cli = cac("jsselint");
@@ -634,7 +635,9 @@ cli.command("init", "create eslint config file").option("--force", "force create
634
635
  console.warn(msg);
635
636
  throw new Error(msg);
636
637
  }
637
- const packageJson = JSON.parse(fs.readFileSync("package.json", "utf-8"));
638
+ const packageJson = JSON.parse(
639
+ fs.readFileSync("package.json", "utf-8")
640
+ );
638
641
  const isModule = packageJson.type === "module";
639
642
  const eslintConfigString = [
640
643
  isModule ? configStringEsm : configStringCjs,
@@ -645,5 +648,5 @@ cli.command("init", "create eslint config file").option("--force", "force create
645
648
  console.log(`made eslint.config.js (type: ${packageJson.type})`);
646
649
  });
647
650
  cli.help();
648
- cli.version(version );
651
+ cli.version(typeof version === "string" ? version : "unknown");
649
652
  cli.parse();