@jsse/eslint-config 0.1.3 → 0.1.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/dist/cli.cjs CHANGED
@@ -617,32 +617,57 @@ var CAC = class extends import_events.EventEmitter {
617
617
  var cac = (name = "") => new CAC(name);
618
618
 
619
619
  // package.json
620
- var version = "0.1.3";
620
+ var version = "0.1.5";
621
621
 
622
622
  // src/cli.ts
623
623
  var cli = cac("jsselint");
624
- var configStringCjs = `
624
+ var CONFIG_OPTIONS_STRING = `
625
+ {
626
+ /**
627
+ * ===================
628
+ * jsse eslint options
629
+ * ===================
630
+ */
631
+ debug: false,
632
+
633
+ /**
634
+ * Enable TypeScript support.
635
+ */
636
+ // typescript: {
637
+ // tsconfigPath: "tsconfig.json", // or ["tsconfig.json", "tsconfig.eslint.json", ...]
638
+ // },
639
+
640
+ /**
641
+ * Enable React support.
642
+ * @default false
643
+ */
644
+ // react: true,
645
+ // reactRefresh: true,
646
+
647
+ /**
648
+ * Report unused disable directives
649
+ * @default true
650
+ */
651
+ // reportUnusedDisableDirectives: false,
652
+
653
+ /**
654
+ * rules 2 turn off
655
+ * @default []
656
+ * @example ["super-annoying-rule"]
657
+ */
658
+ // off: [],
659
+ }
660
+ `;
661
+ var CONFIG_STRING_CJS = `
625
662
  module.exports = require("@jsse/eslint-config").jsse(
626
- {
627
- // options
628
- // typescript: {
629
- // tsconfigPath: "tsconfig.json", // or ["tsconfig.json", "tsconfig.eslint.json", ...]
630
- // },
631
- // react: true
632
- }
663
+ ${CONFIG_OPTIONS_STRING}
633
664
  )
634
665
  `;
635
- var configStringEsm = `
666
+ var CONFIG_STRING_ESM = `
636
667
  import jsse from "@jsse/eslint-config";
637
668
 
638
669
  export default jsse(
639
- {
640
- // options
641
- // typescript: {
642
- // tsconfigPath: "tsconfig.json", // or ["tsconfig.json", "tsconfig.eslint.json", ...]
643
- // },
644
- // react: true
645
- }
670
+ ${CONFIG_OPTIONS_STRING}
646
671
  );
647
672
  `;
648
673
  cli.command("init", "create eslint config file").option("--force", "force create eslint config file").action(async (options) => {
@@ -660,14 +685,12 @@ cli.command("init", "create eslint config file").option("--force", "force create
660
685
  console.warn(msg);
661
686
  throw new Error(msg);
662
687
  }
663
- const packageJson = JSON.parse(
664
- import_node_fs.default.readFileSync("package.json", "utf-8")
665
- );
688
+ const packageJson = JSON.parse(import_node_fs.default.readFileSync("package.json", "utf8"));
666
689
  const isModule = packageJson.type === "module";
667
690
  const eslintConfigString = [
668
- isModule ? configStringEsm : configStringCjs,
691
+ isModule ? CONFIG_STRING_ESM : CONFIG_STRING_CJS,
669
692
  "/* ALT */",
670
- (isModule ? configStringCjs : configStringEsm).split("\n").map((line) => `// ${line}`).join("\n")
693
+ (isModule ? CONFIG_STRING_CJS : CONFIG_STRING_ESM).split("\n").map((line) => `// ${line}`).join("\n")
671
694
  ];
672
695
  import_node_fs.default.writeFileSync(configPath, eslintConfigString.join("\n"));
673
696
  console.log(`made eslint.config.js (type: ${packageJson.type})`);
package/dist/cli.js CHANGED
@@ -593,32 +593,57 @@ var CAC = class extends EventEmitter {
593
593
  var cac = (name = "") => new CAC(name);
594
594
 
595
595
  // package.json
596
- var version = "0.1.3";
596
+ var version = "0.1.5";
597
597
 
598
598
  // src/cli.ts
599
599
  var cli = cac("jsselint");
600
- var configStringCjs = `
600
+ var CONFIG_OPTIONS_STRING = `
601
+ {
602
+ /**
603
+ * ===================
604
+ * jsse eslint options
605
+ * ===================
606
+ */
607
+ debug: false,
608
+
609
+ /**
610
+ * Enable TypeScript support.
611
+ */
612
+ // typescript: {
613
+ // tsconfigPath: "tsconfig.json", // or ["tsconfig.json", "tsconfig.eslint.json", ...]
614
+ // },
615
+
616
+ /**
617
+ * Enable React support.
618
+ * @default false
619
+ */
620
+ // react: true,
621
+ // reactRefresh: true,
622
+
623
+ /**
624
+ * Report unused disable directives
625
+ * @default true
626
+ */
627
+ // reportUnusedDisableDirectives: false,
628
+
629
+ /**
630
+ * rules 2 turn off
631
+ * @default []
632
+ * @example ["super-annoying-rule"]
633
+ */
634
+ // off: [],
635
+ }
636
+ `;
637
+ var CONFIG_STRING_CJS = `
601
638
  module.exports = require("@jsse/eslint-config").jsse(
602
- {
603
- // options
604
- // typescript: {
605
- // tsconfigPath: "tsconfig.json", // or ["tsconfig.json", "tsconfig.eslint.json", ...]
606
- // },
607
- // react: true
608
- }
639
+ ${CONFIG_OPTIONS_STRING}
609
640
  )
610
641
  `;
611
- var configStringEsm = `
642
+ var CONFIG_STRING_ESM = `
612
643
  import jsse from "@jsse/eslint-config";
613
644
 
614
645
  export default jsse(
615
- {
616
- // options
617
- // typescript: {
618
- // tsconfigPath: "tsconfig.json", // or ["tsconfig.json", "tsconfig.eslint.json", ...]
619
- // },
620
- // react: true
621
- }
646
+ ${CONFIG_OPTIONS_STRING}
622
647
  );
623
648
  `;
624
649
  cli.command("init", "create eslint config file").option("--force", "force create eslint config file").action(async (options) => {
@@ -636,14 +661,12 @@ cli.command("init", "create eslint config file").option("--force", "force create
636
661
  console.warn(msg);
637
662
  throw new Error(msg);
638
663
  }
639
- const packageJson = JSON.parse(
640
- fs.readFileSync("package.json", "utf-8")
641
- );
664
+ const packageJson = JSON.parse(fs.readFileSync("package.json", "utf8"));
642
665
  const isModule = packageJson.type === "module";
643
666
  const eslintConfigString = [
644
- isModule ? configStringEsm : configStringCjs,
667
+ isModule ? CONFIG_STRING_ESM : CONFIG_STRING_CJS,
645
668
  "/* ALT */",
646
- (isModule ? configStringCjs : configStringEsm).split("\n").map((line) => `// ${line}`).join("\n")
669
+ (isModule ? CONFIG_STRING_CJS : CONFIG_STRING_ESM).split("\n").map((line) => `// ${line}`).join("\n")
647
670
  ];
648
671
  fs.writeFileSync(configPath, eslintConfigString.join("\n"));
649
672
  console.log(`made eslint.config.js (type: ${packageJson.type})`);