@jsse/eslint-config 0.1.6 → 0.1.8

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/index.cjs CHANGED
@@ -2806,39 +2806,41 @@ __export(src_exports, {
2806
2806
  GLOB_SRC_EXT: () => GLOB_SRC_EXT,
2807
2807
  GLOB_STYLE: () => GLOB_STYLE,
2808
2808
  GLOB_TESTS: () => GLOB_TESTS,
2809
+ GLOB_TOML: () => GLOB_TOML,
2809
2810
  GLOB_TS: () => GLOB_TS,
2810
2811
  GLOB_TSX: () => GLOB_TSX,
2811
2812
  GLOB_YAML: () => GLOB_YAML,
2812
2813
  combine: () => combine,
2813
2814
  combineAsync: () => combineAsync,
2814
2815
  default: () => jsse,
2816
+ importJsoncLibs: () => importJsoncLibs,
2817
+ importParserJsonc: () => importParserJsonc,
2818
+ importPluginJsdoc: () => importPluginJsdoc,
2819
+ importPluginJsonc: () => importPluginJsonc,
2820
+ importPluginMarkdown: () => importPluginMarkdown,
2821
+ importPluginReact: () => importPluginReact,
2822
+ importPluginReactHooks: () => importPluginReactHooks,
2823
+ importPluginReactRefresh: () => importPluginReactRefresh,
2824
+ importPluginStylistic: () => importPluginStylistic,
2825
+ importPluginTailwind: () => importPluginTailwind,
2826
+ importReactPlugins: () => importReactPlugins,
2827
+ importYmlLibs: () => importYmlLibs,
2815
2828
  interopDefault: () => interopDefault2,
2816
2829
  isCI: () => isCI,
2817
2830
  isInEditor: () => isInEditor,
2818
2831
  jsse: () => jsse,
2819
2832
  jsseReact: () => jsseReact,
2820
2833
  jssestd: () => jssestd,
2821
- parserJsonc: () => import_jsonc_eslint_parser.default,
2822
2834
  parserTs: () => parserTs,
2823
2835
  pluginAntfu: () => import_eslint_plugin_antfu.default,
2824
2836
  pluginEslintComments: () => import_eslint_plugin_eslint_comments.default,
2825
2837
  pluginImport: () => pluginImport,
2826
- pluginJsdoc: () => import_eslint_plugin_jsdoc.default,
2827
- pluginJsonc: () => pluginJsonc,
2828
- pluginMarkdown: () => import_eslint_plugin_markdown.default,
2829
2838
  pluginN: () => import_eslint_plugin_n.default,
2830
- pluginNoOnlyTests: () => import_eslint_plugin_no_only_tests.default,
2831
2839
  pluginPerfectionist: () => import_eslint_plugin_perfectionist.default,
2832
- pluginReact: () => import_eslint_plugin_react.default,
2833
- pluginReactHooks: () => import_eslint_plugin_react_hooks.default,
2834
- pluginReactRefresh: () => pluginReactRefresh,
2835
2840
  pluginSortKeys: () => pluginSortKeys,
2836
- pluginStylistic: () => import_eslint_plugin.default,
2837
- pluginTailwind: () => import_eslint_plugin_tailwindcss.default,
2838
- pluginTs: () => import_eslint_plugin2.default,
2841
+ pluginTs: () => import_eslint_plugin.default,
2839
2842
  pluginUnicorn: () => import_eslint_plugin_unicorn.default,
2840
2843
  pluginUnusedImports: () => import_eslint_plugin_unused_imports.default,
2841
- pluginVitest: () => import_eslint_plugin_vitest.default,
2842
2844
  renameRules: () => renameRules
2843
2845
  });
2844
2846
  module.exports = __toCommonJS(src_exports);
@@ -9660,6 +9662,83 @@ function resolvePackage(name, options = {}) {
9660
9662
  }
9661
9663
  }
9662
9664
 
9665
+ // src/lager.ts
9666
+ var levels = {
9667
+ trace: 10,
9668
+ debug: 20,
9669
+ info: 30,
9670
+ warn: 40,
9671
+ error: 50,
9672
+ fatal: 60
9673
+ };
9674
+ function isLagerLevel(level) {
9675
+ return level === "trace" || level === "debug" || level === "info" || level === "warn" || level === "error" || level === "fatal";
9676
+ }
9677
+ var Lager = class {
9678
+ constructor(options) {
9679
+ this._level = "info";
9680
+ this.id = "lager";
9681
+ this.levelNo = levels[this._level];
9682
+ const { level, id } = {
9683
+ level: "info",
9684
+ id: "lager",
9685
+ ...options
9686
+ };
9687
+ this.id = id;
9688
+ this._level = isLagerLevel(level) ? level : "info";
9689
+ this.levelNo = levels[this._level];
9690
+ this.log = this.log.bind(this);
9691
+ this.debug = this.debug.bind(this);
9692
+ }
9693
+ get level() {
9694
+ return this._level;
9695
+ }
9696
+ set level(level) {
9697
+ this._level = level;
9698
+ this.levelNo = levels[level];
9699
+ }
9700
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9701
+ log(...args) {
9702
+ console.log(...args);
9703
+ }
9704
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9705
+ trace(...args) {
9706
+ if (this.levelNo > levels.trace) {
9707
+ return;
9708
+ }
9709
+ console.trace(...args);
9710
+ }
9711
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9712
+ debug(...args) {
9713
+ if (this.levelNo > levels.debug) {
9714
+ return;
9715
+ }
9716
+ console.debug(...args);
9717
+ }
9718
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9719
+ info(...args) {
9720
+ if (this.levelNo > levels.info) {
9721
+ return;
9722
+ }
9723
+ console.info(...args);
9724
+ }
9725
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9726
+ warn(...args) {
9727
+ if (this.levelNo > levels.warn) {
9728
+ return;
9729
+ }
9730
+ console.warn(...args);
9731
+ }
9732
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9733
+ error(...args) {
9734
+ if (this.levelNo > levels.error) {
9735
+ return;
9736
+ }
9737
+ console.error(...args);
9738
+ }
9739
+ };
9740
+ var log = new Lager();
9741
+
9663
9742
  // src/globs.ts
9664
9743
  var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
9665
9744
  var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
@@ -9674,6 +9753,7 @@ var GLOB_SCSS = "**/*.scss";
9674
9753
  var GLOB_JSON = "**/*.json";
9675
9754
  var GLOB_JSON5 = "**/*.json5";
9676
9755
  var GLOB_JSONC = "**/*.jsonc";
9756
+ var GLOB_TOML = "**/*.toml";
9677
9757
  var GLOB_MARKDOWN = "**/*.md";
9678
9758
  var GLOB_YAML = "**/*.y?(a)ml";
9679
9759
  var GLOB_HTML = "**/*.htm?(l)";
@@ -9728,28 +9808,135 @@ var GLOB_EXCLUDE = [
9728
9808
  "**/yarn.lock"
9729
9809
  ];
9730
9810
 
9811
+ // src/utils.ts
9812
+ var import_node_process3 = __toESM(require("process"), 1);
9813
+ async function combine(...configs) {
9814
+ const resolved = await Promise.all(configs);
9815
+ return resolved.flat();
9816
+ }
9817
+ async function combineAsync(...configs) {
9818
+ const resolved = await Promise.all(configs);
9819
+ return resolved.flatMap(
9820
+ (config) => Array.isArray(config) ? config : [config]
9821
+ );
9822
+ }
9823
+ function renameRules(rules, from, to) {
9824
+ if (from === to) {
9825
+ return rules;
9826
+ }
9827
+ return Object.fromEntries(
9828
+ Object.entries(rules).map(([key, value]) => {
9829
+ if (key.startsWith(from)) {
9830
+ return [to + key.slice(from.length), value];
9831
+ }
9832
+ return [key, value];
9833
+ })
9834
+ );
9835
+ }
9836
+ async function interopDefault2(m) {
9837
+ const resolved = await m;
9838
+ return resolved.default || resolved;
9839
+ }
9840
+ function isCI() {
9841
+ return !!import_node_process3.default.env.CI;
9842
+ }
9843
+ function isInEditor() {
9844
+ return !!((import_node_process3.default.env.VSCODE_PID || import_node_process3.default.env.JETBRAINS_IDE) && !isCI());
9845
+ }
9846
+
9731
9847
  // src/plugins.ts
9732
- var import_eslint_plugin = __toESM(require("@stylistic/eslint-plugin"), 1);
9733
- var import_eslint_plugin2 = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
9734
- var parserTs = __toESM(require("@typescript-eslint/parser"), 1);
9735
9848
  var import_eslint_plugin_antfu = __toESM(require("eslint-plugin-antfu"), 1);
9736
9849
  var import_eslint_plugin_eslint_comments = __toESM(require("eslint-plugin-eslint-comments"), 1);
9737
9850
  var pluginImport = __toESM(require("eslint-plugin-import-x"), 1);
9738
- var import_eslint_plugin_jsdoc = __toESM(require("eslint-plugin-jsdoc"), 1);
9739
- var pluginJsonc = __toESM(require("eslint-plugin-jsonc"), 1);
9740
- var import_eslint_plugin_markdown = __toESM(require("eslint-plugin-markdown"), 1);
9741
9851
  var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
9742
- var import_eslint_plugin_no_only_tests = __toESM(require("eslint-plugin-no-only-tests"), 1);
9743
9852
  var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
9744
- var import_eslint_plugin_react = __toESM(require("eslint-plugin-react"), 1);
9745
- var import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"), 1);
9746
- var pluginReactRefresh = __toESM(require("eslint-plugin-react-refresh"), 1);
9747
- var pluginSortKeys = __toESM(require_eslint_plugin_sort_keys(), 1);
9748
- var import_eslint_plugin_tailwindcss = __toESM(require("eslint-plugin-tailwindcss"), 1);
9749
9853
  var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
9750
9854
  var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
9751
- var import_eslint_plugin_vitest = __toESM(require("eslint-plugin-vitest"), 1);
9752
- var import_jsonc_eslint_parser = __toESM(require("jsonc-eslint-parser"), 1);
9855
+ var import_eslint_plugin = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
9856
+ var parserTs = __toESM(require("@typescript-eslint/parser"), 1);
9857
+ var pluginSortKeys = __toESM(require_eslint_plugin_sort_keys(), 1);
9858
+ async function importPluginReact() {
9859
+ const pluginReact = await interopDefault2(import("eslint-plugin-react"));
9860
+ return {
9861
+ pluginReact
9862
+ };
9863
+ }
9864
+ async function importPluginReactHooks() {
9865
+ const pluginReactHooks = await interopDefault2(
9866
+ import("eslint-plugin-react-hooks")
9867
+ );
9868
+ return {
9869
+ pluginReactHooks
9870
+ };
9871
+ }
9872
+ async function importPluginReactRefresh() {
9873
+ const pluginReactRefresh = await interopDefault2(
9874
+ import("eslint-plugin-react-refresh")
9875
+ );
9876
+ return {
9877
+ pluginReactRefresh
9878
+ };
9879
+ }
9880
+ async function importReactPlugins() {
9881
+ const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
9882
+ [
9883
+ interopDefault2(import("eslint-plugin-react")),
9884
+ interopDefault2(import("eslint-plugin-react-hooks")),
9885
+ interopDefault2(import("eslint-plugin-react-refresh"))
9886
+ ]
9887
+ );
9888
+ return { pluginReact, pluginReactHooks, pluginReactRefresh };
9889
+ }
9890
+ async function importParserJsonc() {
9891
+ const parserJsonc = await interopDefault2(import("jsonc-eslint-parser"));
9892
+ return {
9893
+ parserJsonc
9894
+ };
9895
+ }
9896
+ async function importPluginJsonc() {
9897
+ const pluginJsonc = await interopDefault2(import("eslint-plugin-jsonc"));
9898
+ return {
9899
+ pluginJsonc
9900
+ };
9901
+ }
9902
+ async function importJsoncLibs() {
9903
+ const [{ parserJsonc }, { pluginJsonc }] = await Promise.all([
9904
+ importParserJsonc(),
9905
+ importPluginJsonc()
9906
+ ]);
9907
+ return { parserJsonc, pluginJsonc };
9908
+ }
9909
+ async function importYmlLibs() {
9910
+ const [pluginYaml, parserYaml] = await Promise.all([
9911
+ interopDefault2(import("eslint-plugin-yml")),
9912
+ interopDefault2(import("yaml-eslint-parser"))
9913
+ ]);
9914
+ return { parserYaml, pluginYaml };
9915
+ }
9916
+ async function importPluginMarkdown() {
9917
+ const pluginMarkdown = await interopDefault2(import("eslint-plugin-markdown"));
9918
+ return {
9919
+ pluginMarkdown
9920
+ };
9921
+ }
9922
+ async function importPluginJsdoc() {
9923
+ const pluginJsdoc = await interopDefault2(import("eslint-plugin-jsdoc"));
9924
+ return {
9925
+ pluginJsdoc
9926
+ };
9927
+ }
9928
+ async function importPluginStylistic() {
9929
+ const pluginStylistic = await interopDefault2(
9930
+ import("@stylistic/eslint-plugin")
9931
+ );
9932
+ return { pluginStylistic };
9933
+ }
9934
+ async function importPluginTailwind() {
9935
+ const pluginTailwind = await interopDefault2(
9936
+ import("eslint-plugin-tailwindcss")
9937
+ );
9938
+ return { pluginTailwind };
9939
+ }
9753
9940
 
9754
9941
  // src/configs/antfu.ts
9755
9942
  var antfu = async () => {
@@ -9767,7 +9954,7 @@ var antfu = async () => {
9767
9954
  },
9768
9955
  {
9769
9956
  files: ["**/src/**/*"],
9770
- name: "jsse:antfu:bin",
9957
+ name: "jsse:antfu:src",
9771
9958
  // @ts-expect-error - antfu plugin types err
9772
9959
  rules: {
9773
9960
  "antfu/no-import-dist": "error"
@@ -9784,989 +9971,916 @@ var antfu = async () => {
9784
9971
  ];
9785
9972
  };
9786
9973
 
9787
- // src/lager.ts
9788
- var levels = {
9789
- trace: 10,
9790
- debug: 20,
9791
- info: 30,
9792
- warn: 40,
9793
- error: 50,
9794
- fatal: 60
9795
- };
9796
- function isLagerLevel(level) {
9797
- return level === "trace" || level === "debug" || level === "info" || level === "warn" || level === "error" || level === "fatal";
9798
- }
9799
- var Lager = class {
9800
- constructor(options) {
9801
- this._level = "info";
9802
- this.id = "lager";
9803
- this.levelNo = levels[this._level];
9804
- const { level, id } = {
9805
- level: "info",
9806
- id: "lager",
9807
- ...options
9808
- };
9809
- this.id = id;
9810
- this._level = isLagerLevel(level) ? level : "info";
9811
- this.levelNo = levels[this._level];
9812
- this.log = this.log.bind(this);
9813
- this.debug = this.debug.bind(this);
9814
- }
9815
- get level() {
9816
- return this._level;
9817
- }
9818
- set level(level) {
9819
- this._level = level;
9820
- this.levelNo = levels[level];
9821
- }
9822
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9823
- log(...args) {
9824
- console.log(...args);
9825
- }
9826
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9827
- trace(...args) {
9828
- if (this.levelNo > levels.trace) {
9829
- return;
9830
- }
9831
- console.trace(...args);
9832
- }
9833
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9834
- debug(...args) {
9835
- if (this.levelNo > levels.debug) {
9836
- return;
9837
- }
9838
- console.debug(...args);
9839
- }
9840
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9841
- info(...args) {
9842
- if (this.levelNo > levels.info) {
9843
- return;
9844
- }
9845
- console.info(...args);
9846
- }
9847
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9848
- warn(...args) {
9849
- if (this.levelNo > levels.warn) {
9850
- return;
9974
+ // src/configs/comments.ts
9975
+ var comments = async () => [
9976
+ {
9977
+ name: "jsse:eslint-comments",
9978
+ plugins: {
9979
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
9980
+ "eslint-comments": import_eslint_plugin_eslint_comments.default
9981
+ },
9982
+ rules: {
9983
+ "eslint-comments/no-aggregating-enable": "error",
9984
+ "eslint-comments/no-duplicate-disable": "error",
9985
+ "eslint-comments/no-unlimited-disable": "error",
9986
+ "eslint-comments/no-unused-enable": "error"
9851
9987
  }
9852
- console.warn(...args);
9853
9988
  }
9854
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9855
- error(...args) {
9856
- if (this.levelNo > levels.error) {
9857
- return;
9989
+ ];
9990
+
9991
+ // src/configs/ignores.ts
9992
+ var ignores = async () => {
9993
+ return [
9994
+ {
9995
+ ignores: GLOB_EXCLUDE
9858
9996
  }
9859
- console.error(...args);
9860
- }
9997
+ ];
9861
9998
  };
9862
- var log = new Lager();
9863
9999
 
9864
- // src/configs/ts/typescript-rules.ts
9865
- function typescriptRulesTypeAware() {
9866
- return {
9867
- "@typescript-eslint/await-thenable": "error",
9868
- "@typescript-eslint/no-for-in-array": "error",
9869
- "no-implied-eval": "off",
9870
- "@typescript-eslint/consistent-type-exports": [
9871
- "error",
9872
- {
9873
- fixMixedExportsWithInlineTypeSpecifier: true
9874
- }
9875
- ],
9876
- "dot-notation": "off",
9877
- "@typescript-eslint/dot-notation": [
9878
- "error",
9879
- {
9880
- allowPattern: "^_",
9881
- allowKeywords: true
9882
- }
9883
- ],
9884
- "@typescript-eslint/no-implied-eval": "error",
9885
- "@typescript-eslint/no-misused-promises": "error",
9886
- "@typescript-eslint/no-unnecessary-qualifier": "error",
9887
- "@typescript-eslint/no-unnecessary-type-arguments": "off",
9888
- "@typescript-eslint/no-unnecessary-type-assertion": "error",
9889
- "@typescript-eslint/no-useless-template-literals": "error",
9890
- "no-throw-literal": "off",
9891
- "@typescript-eslint/no-throw-literal": "error",
9892
- "@typescript-eslint/no-unsafe-argument": "error",
9893
- "@typescript-eslint/no-unsafe-assignment": "error",
9894
- "@typescript-eslint/no-unsafe-call": "error",
9895
- "@typescript-eslint/no-unsafe-member-access": "error",
9896
- "@typescript-eslint/no-unsafe-return": "error",
9897
- "@typescript-eslint/restrict-plus-operands": "error",
9898
- "@typescript-eslint/restrict-template-expressions": "error",
9899
- "@typescript-eslint/unbound-method": "error",
9900
- "@typescript-eslint/naming-convention": [
9901
- "error",
9902
- {
9903
- selector: ["variable"],
9904
- modifiers: ["global"],
9905
- format: ["camelCase", "snake_case", "UPPER_CASE", "PascalCase"],
9906
- leadingUnderscore: "allowSingleOrDouble",
9907
- trailingUnderscore: "allow",
9908
- filter: {
9909
- regex: "[- ]",
9910
- match: false
9911
- }
9912
- },
9913
- {
9914
- selector: [
9915
- "classProperty",
9916
- "objectLiteralProperty",
9917
- "typeProperty",
9918
- "classMethod",
9919
- "objectLiteralMethod",
9920
- "typeMethod",
9921
- "accessor",
9922
- "enumMember"
9923
- ],
9924
- // eslint-disable-next-line unicorn/no-null
9925
- format: null,
9926
- modifiers: ["requiresQuotes"]
9927
- },
9928
- {
9929
- selector: [
9930
- "variable",
9931
- "function",
9932
- "classProperty",
9933
- "objectLiteralProperty",
9934
- "parameterProperty",
9935
- "classMethod",
9936
- "objectLiteralMethod",
9937
- "typeMethod",
9938
- "accessor"
9939
- ],
9940
- format: ["camelCase", "snake_case", "PascalCase"],
9941
- leadingUnderscore: "allowSingleOrDouble",
9942
- trailingUnderscore: "allow",
9943
- filter: {
9944
- // also allow when '/' is in object key
9945
- regex: "^[0-9]|[- ]|[/]",
9946
- match: false
9947
- }
10000
+ // src/configs/imports.ts
10001
+ var imports = async (options) => {
10002
+ const { stylistic: stylistic2 = true } = options ?? {};
10003
+ return [
10004
+ {
10005
+ name: "jsse:import",
10006
+ plugins: {
10007
+ import: pluginImport
9948
10008
  },
9949
- {
9950
- selector: "typeLike",
9951
- format: ["PascalCase"]
10009
+ rules: {
10010
+ "import/first": "error",
10011
+ "import/no-duplicates": "error",
10012
+ "import/no-mutable-exports": "error",
10013
+ "import/no-named-default": "error",
10014
+ "import/no-self-import": "error",
10015
+ "import/no-webpack-loader-syntax": "error",
10016
+ "import/order": "error",
10017
+ ...stylistic2 ? {
10018
+ "import/newline-after-import": [
10019
+ "error",
10020
+ { considerComments: true, count: 1 }
10021
+ ]
10022
+ } : {}
10023
+ }
10024
+ }
10025
+ ];
10026
+ };
10027
+
10028
+ // src/configs/javascript.ts
10029
+ var import_js = __toESM(require("@eslint/js"), 1);
10030
+ var import_globals = __toESM(require_globals2(), 1);
10031
+ var javascript = async (options) => {
10032
+ const {
10033
+ isInEditor: isInEditor2 = false,
10034
+ overrides = {},
10035
+ reportUnusedDisableDirectives = true
10036
+ } = options ?? {};
10037
+ return [
10038
+ {
10039
+ languageOptions: {
10040
+ ecmaVersion: 2022,
10041
+ globals: {
10042
+ ...import_globals.default.browser,
10043
+ ...import_globals.default.es2021,
10044
+ ...import_globals.default.node,
10045
+ document: "readonly",
10046
+ navigator: "readonly",
10047
+ window: "readonly"
10048
+ },
10049
+ parserOptions: {
10050
+ ecmaFeatures: {
10051
+ jsx: true
10052
+ },
10053
+ ecmaVersion: 2022,
10054
+ sourceType: "module"
10055
+ },
10056
+ sourceType: "module"
9952
10057
  },
9953
- {
9954
- selector: "variable",
9955
- types: ["boolean"],
9956
- format: ["PascalCase", "camelCase"],
9957
- prefix: ["is", "has", "can", "should", "will", "did"]
10058
+ linterOptions: {
10059
+ reportUnusedDisableDirectives
9958
10060
  },
9959
- {
9960
- selector: "interface",
9961
- format: ["PascalCase"]
10061
+ name: "jsse:javascript",
10062
+ plugins: {
10063
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10064
+ "unused-imports": import_eslint_plugin_unused_imports.default
9962
10065
  },
9963
- {
9964
- selector: "typeParameter",
9965
- filter: "^T$|^[A-Z][a-zA-Z]+$",
9966
- format: ["PascalCase"]
9967
- }
9968
- ],
9969
- "@typescript-eslint/no-floating-promises": [
9970
- "error",
9971
- {
9972
- ignoreVoid: true,
9973
- ignoreIIFE: true
9974
- }
9975
- ]
9976
- };
9977
- }
9978
- function typescriptRulesTypeOblivious() {
9979
- return {
9980
- eqeqeq: "error",
9981
- camelcase: "off",
9982
- yoda: "error",
9983
- "arrow-parens": "off",
9984
- "no-console": [
9985
- "warn",
9986
- {
9987
- allow: [
9988
- "log",
9989
- "warn",
9990
- "dir",
9991
- "time",
9992
- "timeEnd",
9993
- "timeLog",
9994
- "trace",
9995
- "assert",
9996
- "clear",
9997
- "count",
9998
- "countReset",
9999
- "group",
10000
- "groupEnd",
10001
- "table",
10002
- "debug",
10003
- "info",
10004
- "dirxml",
10066
+ rules: {
10067
+ ...import_js.default.configs.recommended.rules,
10068
+ "accessor-pairs": [
10005
10069
  "error",
10006
- "groupCollapsed",
10007
- "Console",
10008
- "profile",
10009
- "profileEnd",
10010
- "timeStamp",
10011
- "context"
10012
- ]
10013
- }
10014
- ],
10015
- "object-curly-spacing": "off",
10016
- "@typescript-eslint/object-curly-spacing": "off",
10017
- "@typescript-eslint/no-inferrable-types": "off",
10018
- "@typescript-eslint/prefer-ts-expect-error": "error",
10019
- "@typescript-eslint/consistent-type-imports": [
10020
- "error",
10021
- {
10022
- prefer: "type-imports",
10023
- fixStyle: "separate-type-imports"
10024
- }
10025
- ],
10026
- "@typescript-eslint/adjacent-overload-signatures": "error",
10027
- "@typescript-eslint/ban-types": [
10028
- "warn",
10029
- {
10030
- extendDefaults: false,
10031
- types: {
10032
- String: {
10033
- message: 'Use "string" instead',
10034
- fixWith: "string"
10035
- },
10036
- Boolean: {
10037
- message: 'Use "boolean" instead',
10038
- fixWith: "boolean"
10039
- },
10040
- Number: {
10041
- message: 'Use "number" instead',
10042
- fixWith: "number"
10043
- },
10044
- BigInt: {
10045
- message: "Use `bigint` instead.",
10046
- fixWith: "bigint"
10047
- },
10048
- Object: {
10049
- message: "The `Object` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead. See https://github.com/typescript-eslint/typescript-eslint/pull/848",
10050
- fixWith: "Record<string, unknown>"
10051
- },
10052
- object: {
10053
- message: "The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848",
10054
- fixWith: "Record<string, unknown>"
10055
- },
10056
- Symbol: {
10057
- message: 'Use "symbol" instead',
10058
- fixWith: "symbol"
10059
- },
10060
- Function: {
10061
- message: 'The "Function" type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with "new".\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.'
10062
- },
10063
- // eslint-disable-next-line @typescript-eslint/naming-convention
10064
- "{}": {
10065
- message: "The `{}` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead.",
10066
- fixWith: "Record<string, unknown>"
10067
- },
10068
- // eslint-disable-next-line @typescript-eslint/naming-convention
10069
- "[]": "Don't use the empty array type `[]`. It only allows empty arrays. Use `SomeType[]` instead.",
10070
- // eslint-disable-next-line @typescript-eslint/naming-convention
10071
- "[[]]": "Don't use `[[]]`. It only allows an array with a single element which is an empty array. Use `SomeType[][]` instead.",
10072
- // eslint-disable-next-line @typescript-eslint/naming-convention
10073
- "[[[]]]": "Don't use `[[[]]]`. Use `SomeType[][][]` instead."
10074
- }
10075
- }
10076
- ],
10077
- "@typescript-eslint/consistent-type-assertions": "error",
10078
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
10079
- "@typescript-eslint/member-ordering": [
10080
- "warn",
10081
- {
10082
- default: "never",
10083
- classes: ["field", "constructor", "method"]
10084
- }
10085
- ],
10086
- "no-array-constructor": "off",
10087
- "@typescript-eslint/no-array-constructor": "error",
10088
- "@typescript-eslint/no-explicit-any": "error",
10089
- "@typescript-eslint/no-misused-new": "error",
10090
- "@typescript-eslint/no-namespace": [
10091
- "error",
10092
- {
10093
- allowDeclarations: false,
10094
- allowDefinitionFiles: false
10095
- }
10096
- ],
10097
- "no-unused-vars": "off",
10098
- "@typescript-eslint/no-unused-vars": [
10099
- "warn",
10100
- {
10101
- vars: "all",
10102
- args: "none",
10103
- argsIgnorePattern: "^_",
10104
- varsIgnorePattern: "^_",
10105
- caughtErrorsIgnorePattern: "^_"
10106
- }
10107
- ],
10108
- "no-use-before-define": "off",
10109
- "@typescript-eslint/no-use-before-define": [
10110
- "error",
10111
- {
10112
- functions: true,
10113
- classes: true,
10114
- variables: true,
10115
- enums: true,
10116
- typedefs: true
10117
- }
10118
- ],
10119
- "@typescript-eslint/prefer-namespace-keyword": "warn",
10120
- "@typescript-eslint/typedef": [
10121
- "warn",
10122
- {
10123
- arrayDestructuring: false,
10124
- arrowParameter: false,
10125
- memberVariableDeclaration: true,
10126
- objectDestructuring: false,
10127
- parameter: true,
10128
- propertyDeclaration: true,
10129
- variableDeclaration: false,
10130
- variableDeclarationIgnoreFunction: true
10131
- }
10132
- ],
10133
- "accessor-pairs": "error",
10134
- "for-direction": "warn",
10135
- "guard-for-in": "error",
10136
- "max-lines": [
10137
- "warn",
10138
- {
10139
- max: 2e3
10140
- }
10141
- ],
10142
- "no-async-promise-executor": "error",
10143
- "no-bitwise": [
10144
- "warn",
10145
- {
10146
- allow: ["^", "<<", ">>", ">>>", "^=", "<<=", ">>=", ">>>=", "~"]
10147
- }
10148
- ],
10149
- "no-caller": "error",
10150
- "no-compare-neg-zero": "error",
10151
- "no-cond-assign": "error",
10152
- "no-constant-condition": "warn",
10153
- "no-control-regex": "error",
10154
- "no-debugger": "warn",
10155
- "no-delete-var": "error",
10156
- "no-duplicate-case": "error",
10157
- "no-empty": "warn",
10158
- "no-empty-character-class": "error",
10159
- "no-empty-pattern": "warn",
10160
- "no-eval": "warn",
10161
- "no-ex-assign": "error",
10162
- "no-extend-native": "error",
10163
- "no-extra-boolean-cast": "warn",
10164
- "no-extra-label": "warn",
10165
- "no-fallthrough": "error",
10166
- "no-func-assign": "warn",
10167
- "no-implied-eval": "error",
10168
- "no-invalid-regexp": "error",
10169
- "no-label-var": "error",
10170
- "no-lone-blocks": "warn",
10171
- "no-misleading-character-class": "error",
10172
- "no-multi-str": "error",
10173
- "no-new": "warn",
10174
- "no-new-func": "error",
10175
- "no-new-wrappers": "warn",
10176
- "no-octal": "error",
10177
- "no-octal-escape": "error",
10178
- "no-regex-spaces": "error",
10179
- "no-return-assign": "error",
10180
- "no-script-url": "warn",
10181
- "no-self-assign": "error",
10182
- "no-self-compare": "error",
10183
- "no-sequences": "error",
10184
- "no-shadow-restricted-names": "error",
10185
- "no-sparse-arrays": "error",
10186
- "no-unmodified-loop-condition": "warn",
10187
- "no-unsafe-finally": "error",
10188
- "no-unused-expressions": "off",
10189
- "@typescript-eslint/no-unused-expressions": "error",
10190
- "no-unused-labels": "error",
10191
- "no-useless-catch": "warn",
10192
- "no-useless-concat": "error",
10193
- "no-var": "error",
10194
- "no-void": [
10195
- "error",
10196
- {
10197
- allowAsStatement: true
10198
- }
10199
- ],
10200
- "no-with": "error",
10201
- "prefer-const": "error",
10202
- "require-atomic-updates": "error",
10203
- "require-yield": "warn",
10204
- strict: ["error", "never"],
10205
- "use-isnan": "error",
10206
- "no-useless-constructor": "off",
10207
- "@typescript-eslint/no-useless-constructor": "error",
10208
- "@typescript-eslint/no-unnecessary-type-constraint": "error",
10209
- "@typescript-eslint/brace-style": [
10210
- "error",
10211
- "1tbs",
10212
- {
10213
- allowSingleLine: false
10214
- }
10215
- ],
10216
- "comma-spacing": "off",
10217
- "@typescript-eslint/comma-spacing": [
10218
- "error",
10219
- {
10220
- before: false,
10221
- after: true
10222
- }
10223
- ],
10224
- "default-param-last": "off",
10225
- "@typescript-eslint/default-param-last": "error",
10226
- "func-call-spacing": "off",
10227
- "@typescript-eslint/func-call-spacing": ["error", "never"],
10228
- "keyword-spacing": "off",
10229
- "@typescript-eslint/keyword-spacing": "error",
10230
- "lines-between-class-members": "off",
10231
- "@typescript-eslint/lines-between-class-members": [
10232
- "error",
10233
- "always",
10234
- {
10235
- exceptAfterSingleLine: true
10236
- }
10237
- ],
10238
- "no-dupe-class-members": "off",
10239
- "@typescript-eslint/no-dupe-class-members": "error",
10240
- "no-empty-function": "off",
10241
- "@typescript-eslint/no-empty-function": "error",
10242
- "no-extra-parens": "off",
10243
- "no-extra-semi": "off",
10244
- "@typescript-eslint/no-extra-semi": "error",
10245
- "no-loop-func": "off",
10246
- "@typescript-eslint/no-loop-func": "error",
10247
- "no-loss-of-precision": "off",
10248
- "@typescript-eslint/no-loss-of-precision": "error",
10249
- "no-redeclare": "off",
10250
- "@typescript-eslint/no-redeclare": "error",
10251
- "no-restricted-imports": "off",
10252
- "@typescript-eslint/no-restricted-imports": [
10253
- "error",
10254
- {
10255
- paths: [
10070
+ { enforceForClassMembers: true, setWithoutGet: true }
10071
+ ],
10072
+ "array-callback-return": "error",
10073
+ "arrow-parens": ["error", "as-needed", { requireForBlockBody: true }],
10074
+ "block-scoped-var": "error",
10075
+ "constructor-super": "error",
10076
+ "default-case-last": "error",
10077
+ "dot-notation": ["error", { allowKeywords: true }],
10078
+ eqeqeq: ["error", "smart"],
10079
+ "new-cap": [
10080
+ "error",
10081
+ { capIsNew: false, newIsCap: true, properties: true }
10082
+ ],
10083
+ "no-alert": "error",
10084
+ "no-array-constructor": "error",
10085
+ "no-async-promise-executor": "error",
10086
+ "no-caller": "error",
10087
+ "no-case-declarations": "error",
10088
+ "no-class-assign": "error",
10089
+ "no-compare-neg-zero": "error",
10090
+ "no-cond-assign": ["error", "always"],
10091
+ "no-console": ["error", { allow: ["warn", "error"] }],
10092
+ "no-const-assign": "error",
10093
+ "no-control-regex": "error",
10094
+ "no-debugger": "error",
10095
+ "no-delete-var": "error",
10096
+ "no-dupe-args": "error",
10097
+ "no-dupe-class-members": "error",
10098
+ "no-dupe-keys": "error",
10099
+ "no-duplicate-case": "error",
10100
+ "no-empty": ["error", { allowEmptyCatch: true }],
10101
+ "no-empty-character-class": "error",
10102
+ "no-empty-pattern": "error",
10103
+ "no-eval": "error",
10104
+ "no-ex-assign": "error",
10105
+ "no-extend-native": "error",
10106
+ "no-extra-bind": "error",
10107
+ "no-extra-boolean-cast": "error",
10108
+ "no-fallthrough": "error",
10109
+ "no-func-assign": "error",
10110
+ "no-global-assign": "error",
10111
+ "no-implied-eval": "error",
10112
+ "no-import-assign": "error",
10113
+ "no-invalid-regexp": "error",
10114
+ "no-invalid-this": "error",
10115
+ "no-irregular-whitespace": "error",
10116
+ "no-iterator": "error",
10117
+ "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
10118
+ "no-lone-blocks": "error",
10119
+ "no-loss-of-precision": "error",
10120
+ "no-misleading-character-class": "error",
10121
+ "no-multi-str": "error",
10122
+ "no-nested-ternary": "off",
10123
+ "no-new": "error",
10124
+ "no-new-func": "error",
10125
+ "no-new-object": "error",
10126
+ "no-new-symbol": "error",
10127
+ "no-new-wrappers": "error",
10128
+ "no-obj-calls": "error",
10129
+ "no-octal": "error",
10130
+ "no-octal-escape": "error",
10131
+ "no-proto": "error",
10132
+ "no-prototype-builtins": "error",
10133
+ "no-redeclare": ["error", { builtinGlobals: false }],
10134
+ "no-regex-spaces": "error",
10135
+ "no-restricted-globals": [
10136
+ "error",
10137
+ { message: "Use `globalThis` instead.", name: "global" },
10138
+ { message: "Use `globalThis` instead.", name: "self" }
10139
+ ],
10140
+ "no-restricted-properties": [
10141
+ "error",
10142
+ {
10143
+ message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",
10144
+ property: "__proto__"
10145
+ },
10146
+ {
10147
+ message: "Use `Object.defineProperty` instead.",
10148
+ property: "__defineGetter__"
10149
+ },
10150
+ {
10151
+ message: "Use `Object.defineProperty` instead.",
10152
+ property: "__defineSetter__"
10153
+ },
10154
+ {
10155
+ message: "Use `Object.getOwnPropertyDescriptor` instead.",
10156
+ property: "__lookupGetter__"
10157
+ },
10158
+ {
10159
+ message: "Use `Object.getOwnPropertyDescriptor` instead.",
10160
+ property: "__lookupSetter__"
10161
+ }
10162
+ ],
10163
+ "no-restricted-syntax": [
10164
+ "error",
10165
+ "DebuggerStatement",
10166
+ "LabeledStatement",
10167
+ "WithStatement",
10168
+ "TSEnumDeclaration[const=true]",
10169
+ "TSExportAssignment"
10170
+ ],
10171
+ "no-self-assign": ["error", { props: true }],
10172
+ "no-self-compare": "error",
10173
+ "no-sequences": "error",
10174
+ "no-shadow-restricted-names": "error",
10175
+ "no-sparse-arrays": "error",
10176
+ "no-template-curly-in-string": "error",
10177
+ "no-this-before-super": "error",
10178
+ "no-throw-literal": "error",
10179
+ "no-undef": "error",
10180
+ "no-undef-init": "error",
10181
+ "no-unexpected-multiline": "error",
10182
+ "no-unmodified-loop-condition": "error",
10183
+ "no-unneeded-ternary": ["error", { defaultAssignment: false }],
10184
+ "no-unreachable": "error",
10185
+ "no-unreachable-loop": "error",
10186
+ "no-unsafe-finally": "error",
10187
+ "no-unsafe-negation": "error",
10188
+ "no-unused-expressions": [
10189
+ "error",
10190
+ {
10191
+ allowShortCircuit: true,
10192
+ allowTaggedTemplates: true,
10193
+ allowTernary: true
10194
+ }
10195
+ ],
10196
+ "no-unused-vars": [
10256
10197
  "error",
10257
- "domain",
10258
- "freelist",
10259
- "smalloc",
10260
- "punycode",
10261
- "sys",
10262
- "querystring",
10263
- "colors"
10264
- ]
10265
- }
10266
- ],
10267
- "padding-line-between-statements": "off",
10268
- "@typescript-eslint/padding-line-between-statements": "off",
10269
- quotes: "off",
10270
- "@typescript-eslint/quotes": "off",
10271
- "space-before-function-paren": "off",
10272
- "@typescript-eslint/space-before-function-paren": "off",
10273
- "space-infix-ops": "off",
10274
- "@typescript-eslint/space-infix-ops": "error",
10275
- semi: "off",
10276
- "@typescript-eslint/semi": ["error", "always"],
10277
- "space-before-blocks": "off",
10278
- "@typescript-eslint/space-before-blocks": ["error", "always"],
10279
- "no-undef": "off",
10280
- "no-duplicate-imports": "off"
10281
- };
10282
- }
10283
- function typescriptRules(props) {
10284
- const { typeAware } = props ?? {};
10285
- if (typeAware === true) {
10286
- return {
10287
- ...typescriptRulesTypeOblivious(),
10288
- ...typescriptRulesTypeAware()
10289
- };
10290
- }
10291
- return typescriptRulesTypeOblivious();
10292
- }
10293
-
10294
- // src/configs/markdown.ts
10295
- var markdown = async (options) => {
10296
- const { componentExts = [], overrides = {} } = options ?? {};
10297
- const tsRulesOff = Object.fromEntries(
10298
- // @ts-expect-error - undefined
10299
- Object.keys(typescriptRulesTypeAware()).map((key) => [
10300
- `@typescript-eslint/${key}`,
10301
- "off"
10302
- ])
10303
- );
10304
- return [
10305
- {
10306
- name: "jsse:markdown:setup",
10307
- plugins: {
10308
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10309
- markdown: import_eslint_plugin_markdown.default
10198
+ {
10199
+ args: "none",
10200
+ caughtErrors: "none",
10201
+ ignoreRestSiblings: true,
10202
+ vars: "all"
10203
+ }
10204
+ ],
10205
+ "no-use-before-define": [
10206
+ "error",
10207
+ { classes: false, functions: false, variables: true }
10208
+ ],
10209
+ "no-useless-backreference": "error",
10210
+ "no-useless-call": "error",
10211
+ "no-useless-catch": "error",
10212
+ "no-useless-computed-key": "error",
10213
+ "no-useless-constructor": "error",
10214
+ "no-useless-rename": "error",
10215
+ "no-useless-return": "error",
10216
+ "no-var": "error",
10217
+ "no-with": "error",
10218
+ "object-shorthand": [
10219
+ "error",
10220
+ "always",
10221
+ {
10222
+ avoidQuotes: true,
10223
+ ignoreConstructors: false
10224
+ }
10225
+ ],
10226
+ "one-var": ["error", { initialized: "never" }],
10227
+ "prefer-arrow-callback": [
10228
+ "error",
10229
+ {
10230
+ allowNamedFunctions: false,
10231
+ allowUnboundThis: true
10232
+ }
10233
+ ],
10234
+ "prefer-const": [
10235
+ "error",
10236
+ {
10237
+ destructuring: "all",
10238
+ ignoreReadBeforeAssign: true
10239
+ }
10240
+ ],
10241
+ "prefer-exponentiation-operator": "error",
10242
+ "prefer-promise-reject-errors": "error",
10243
+ "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
10244
+ "prefer-rest-params": "error",
10245
+ "prefer-spread": "error",
10246
+ "prefer-template": "error",
10247
+ "sort-imports": [
10248
+ "error",
10249
+ {
10250
+ allowSeparatedGroups: false,
10251
+ ignoreCase: false,
10252
+ ignoreDeclarationSort: true,
10253
+ ignoreMemberSort: false,
10254
+ memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
10255
+ }
10256
+ ],
10257
+ "symbol-description": "error",
10258
+ "unicode-bom": ["error", "never"],
10259
+ "unused-imports/no-unused-imports": isInEditor2 ? "off" : "error",
10260
+ "unused-imports/no-unused-vars": [
10261
+ "error",
10262
+ {
10263
+ args: "after-used",
10264
+ argsIgnorePattern: "^_",
10265
+ vars: "all",
10266
+ varsIgnorePattern: "^_"
10267
+ }
10268
+ ],
10269
+ "use-isnan": [
10270
+ "error",
10271
+ { enforceForIndexOf: true, enforceForSwitchCase: true }
10272
+ ],
10273
+ "valid-typeof": ["error", { requireStringLiterals: true }],
10274
+ "vars-on-top": "error",
10275
+ yoda: ["error", "never"],
10276
+ ...overrides
10310
10277
  }
10311
10278
  },
10312
10279
  {
10313
- files: [GLOB_MARKDOWN],
10314
- name: "jsse:markdown:processor",
10315
- processor: "markdown/markdown"
10316
- },
10317
- {
10318
- files: [
10319
- GLOB_MARKDOWN_CODE,
10320
- ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
10321
- ],
10322
- languageOptions: {
10323
- parserOptions: {
10324
- ecmaFeatures: {
10325
- impliedStrict: true
10326
- }
10327
- }
10328
- },
10329
- name: "jsse:markdown:rules",
10280
+ files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
10281
+ name: "jsse:scripts-overrides",
10330
10282
  rules: {
10331
- "@typescript-eslint/consistent-type-imports": "off",
10332
- "@typescript-eslint/no-namespace": "off",
10333
- "@typescript-eslint/no-redeclare": "off",
10334
- "@typescript-eslint/no-require-imports": "off",
10335
- "@typescript-eslint/no-unused-vars": "off",
10336
- "@typescript-eslint/no-use-before-define": "off",
10337
- "@typescript-eslint/no-var-requires": "off",
10338
- "no-alert": "off",
10339
- "no-console": "off",
10340
- "no-undef": "off",
10341
- "no-unused-expressions": "off",
10342
- "no-unused-vars": "off",
10343
- "node/prefer-global/process": "off",
10344
- // Type aware rules
10345
- "object-curly-newline": "off",
10346
- "style/comma-dangle": "off",
10347
- "style/eol-last": "off",
10348
- "unicode-bom": "off",
10349
- "unused-imports/no-unused-imports": "off",
10350
- "unused-imports/no-unused-vars": "off",
10351
- ...tsRulesOff,
10352
- ...overrides
10283
+ "no-console": "off"
10353
10284
  }
10354
10285
  }
10355
10286
  ];
10356
10287
  };
10357
10288
 
10358
- // src/configs/comments.ts
10359
- var comments = async () => [
10360
- {
10361
- name: "jsse:eslint-comments",
10362
- plugins: {
10363
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10364
- "eslint-comments": import_eslint_plugin_eslint_comments.default
10365
- },
10366
- rules: {
10367
- "eslint-comments/no-aggregating-enable": "error",
10368
- "eslint-comments/no-duplicate-disable": "error",
10369
- "eslint-comments/no-unlimited-disable": "error",
10370
- "eslint-comments/no-unused-enable": "error"
10371
- }
10372
- }
10373
- ];
10374
-
10375
- // src/configs/ignores.ts
10376
- var ignores = async () => {
10289
+ // src/configs/jsdoc.ts
10290
+ var jsdoc = async () => {
10291
+ const { pluginJsdoc } = await importPluginJsdoc();
10377
10292
  return [
10378
10293
  {
10379
- ignores: GLOB_EXCLUDE
10294
+ name: "jsse:jsdoc",
10295
+ plugins: {
10296
+ jsdoc: pluginJsdoc
10297
+ },
10298
+ rules: {
10299
+ "jsdoc/check-access": "warn",
10300
+ "jsdoc/check-alignment": "warn",
10301
+ "jsdoc/check-param-names": "warn",
10302
+ "jsdoc/check-property-names": "warn",
10303
+ "jsdoc/check-types": "warn",
10304
+ "jsdoc/empty-tags": "warn",
10305
+ "jsdoc/implements-on-classes": "warn",
10306
+ "jsdoc/multiline-blocks": "warn",
10307
+ "jsdoc/no-defaults": "warn",
10308
+ "jsdoc/no-multi-asterisks": "warn",
10309
+ "jsdoc/require-param-name": "warn",
10310
+ "jsdoc/require-property": "warn",
10311
+ "jsdoc/require-property-description": "warn",
10312
+ "jsdoc/require-property-name": "warn",
10313
+ "jsdoc/require-returns-check": "warn",
10314
+ "jsdoc/require-returns-description": "warn",
10315
+ "jsdoc/require-yields-check": "warn"
10316
+ }
10380
10317
  }
10381
10318
  ];
10382
10319
  };
10383
10320
 
10384
- // src/configs/imports.ts
10385
- var imports = async (options) => {
10386
- const { stylistic: stylistic2 = true } = options ?? {};
10321
+ // src/configs/jsonc.ts
10322
+ var jsonc = async (options) => {
10323
+ const { overrides = {}, stylistic: stylistic2 = true } = options ?? {};
10324
+ const { indent = 2 } = typeof stylistic2 === "boolean" ? {} : stylistic2;
10325
+ const { parserJsonc, pluginJsonc } = await importJsoncLibs();
10387
10326
  return [
10388
10327
  {
10389
- name: "jsse:imports",
10328
+ name: "jsse:jsonc:setup",
10390
10329
  plugins: {
10391
- import: pluginImport
10330
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
10331
+ jsonc: pluginJsonc
10332
+ }
10333
+ },
10334
+ {
10335
+ files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
10336
+ ignores: ["*.min.json"],
10337
+ languageOptions: {
10338
+ parser: parserJsonc
10392
10339
  },
10340
+ name: "jsse:jsonc:rules",
10393
10341
  rules: {
10394
- "import/first": "error",
10395
- "import/no-duplicates": "error",
10396
- "import/no-mutable-exports": "error",
10397
- "import/no-named-default": "error",
10398
- "import/no-self-import": "error",
10399
- "import/no-webpack-loader-syntax": "error",
10400
- "import/order": "error",
10342
+ "jsonc/no-bigint-literals": "error",
10343
+ "jsonc/no-binary-expression": "error",
10344
+ "jsonc/no-binary-numeric-literals": "error",
10345
+ "jsonc/no-dupe-keys": "error",
10346
+ "jsonc/no-escape-sequence-in-identifier": "error",
10347
+ "jsonc/no-floating-decimal": "error",
10348
+ "jsonc/no-hexadecimal-numeric-literals": "error",
10349
+ "jsonc/no-infinity": "error",
10350
+ "jsonc/no-multi-str": "error",
10351
+ "jsonc/no-nan": "error",
10352
+ "jsonc/no-number-props": "error",
10353
+ "jsonc/no-numeric-separators": "error",
10354
+ "jsonc/no-octal": "error",
10355
+ "jsonc/no-octal-escape": "error",
10356
+ "jsonc/no-octal-numeric-literals": "error",
10357
+ "jsonc/no-parenthesized": "error",
10358
+ "jsonc/no-plus-sign": "error",
10359
+ "jsonc/no-regexp-literals": "error",
10360
+ "jsonc/no-sparse-arrays": "error",
10361
+ "jsonc/no-template-literals": "error",
10362
+ "jsonc/no-undefined-value": "error",
10363
+ "jsonc/no-unicode-codepoint-escapes": "error",
10364
+ "jsonc/no-useless-escape": "error",
10365
+ "jsonc/space-unary-ops": "error",
10366
+ "jsonc/valid-json-number": "error",
10367
+ "jsonc/vue-custom-block/no-parsing-error": "error",
10401
10368
  ...stylistic2 ? {
10402
- "import/newline-after-import": [
10369
+ "jsonc/array-bracket-spacing": ["error", "never"],
10370
+ "jsonc/comma-dangle": ["error", "never"],
10371
+ "jsonc/comma-style": ["error", "last"],
10372
+ "jsonc/indent": ["error", indent],
10373
+ "jsonc/key-spacing": [
10403
10374
  "error",
10404
- { considerComments: true, count: 1 }
10405
- ]
10406
- } : {}
10375
+ { afterColon: true, beforeColon: false }
10376
+ ],
10377
+ "jsonc/object-curly-newline": [
10378
+ "error",
10379
+ { consistent: true, multiline: true }
10380
+ ],
10381
+ "jsonc/object-curly-spacing": ["error", "always"],
10382
+ "jsonc/object-property-newline": [
10383
+ "error",
10384
+ { allowMultiplePropertiesPerLine: true }
10385
+ ],
10386
+ "jsonc/quote-props": "error",
10387
+ "jsonc/quotes": "error"
10388
+ } : {},
10389
+ ...overrides
10407
10390
  }
10408
10391
  }
10409
10392
  ];
10410
10393
  };
10411
10394
 
10412
- // src/configs/javascript.ts
10413
- var import_js = __toESM(require("@eslint/js"), 1);
10414
- var import_globals = __toESM(require_globals2(), 1);
10415
- var javascript = async (options) => {
10416
- const {
10417
- isInEditor: isInEditor2 = false,
10418
- overrides = {},
10419
- reportUnusedDisableDirectives = true
10420
- } = options ?? {};
10421
- return [
10422
- {
10423
- languageOptions: {
10424
- ecmaVersion: 2022,
10425
- globals: {
10426
- ...import_globals.default.browser,
10427
- ...import_globals.default.es2021,
10428
- ...import_globals.default.node,
10429
- document: "readonly",
10430
- navigator: "readonly",
10431
- window: "readonly"
10432
- },
10433
- parserOptions: {
10434
- ecmaFeatures: {
10435
- jsx: true
10436
- },
10437
- ecmaVersion: 2022,
10438
- sourceType: "module"
10439
- },
10440
- sourceType: "module"
10441
- },
10442
- linterOptions: {
10443
- reportUnusedDisableDirectives
10444
- },
10445
- name: "jsse:javascript",
10446
- plugins: {
10447
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10448
- "unused-imports": import_eslint_plugin_unused_imports.default
10395
+ // src/configs/ts/typescript-rules.ts
10396
+ function typescriptRulesTypeAware() {
10397
+ return {
10398
+ "@typescript-eslint/await-thenable": "error",
10399
+ "@typescript-eslint/no-for-in-array": "error",
10400
+ "no-implied-eval": "off",
10401
+ "@typescript-eslint/consistent-type-exports": [
10402
+ "error",
10403
+ {
10404
+ fixMixedExportsWithInlineTypeSpecifier: true
10405
+ }
10406
+ ],
10407
+ "dot-notation": "off",
10408
+ "@typescript-eslint/dot-notation": [
10409
+ "error",
10410
+ {
10411
+ allowPattern: "^_",
10412
+ allowKeywords: true
10413
+ }
10414
+ ],
10415
+ "@typescript-eslint/no-implied-eval": "error",
10416
+ "@typescript-eslint/no-misused-promises": "error",
10417
+ "@typescript-eslint/no-unnecessary-qualifier": "error",
10418
+ "@typescript-eslint/no-unnecessary-type-arguments": "off",
10419
+ "@typescript-eslint/no-unnecessary-type-assertion": "error",
10420
+ "@typescript-eslint/no-useless-template-literals": "error",
10421
+ "no-throw-literal": "off",
10422
+ "@typescript-eslint/no-throw-literal": "error",
10423
+ "@typescript-eslint/no-unsafe-argument": "error",
10424
+ "@typescript-eslint/no-unsafe-assignment": "error",
10425
+ "@typescript-eslint/no-unsafe-call": "error",
10426
+ "@typescript-eslint/no-unsafe-member-access": "error",
10427
+ "@typescript-eslint/no-unsafe-return": "error",
10428
+ "@typescript-eslint/restrict-plus-operands": "error",
10429
+ "@typescript-eslint/restrict-template-expressions": "error",
10430
+ "@typescript-eslint/unbound-method": "error",
10431
+ "@typescript-eslint/naming-convention": [
10432
+ "error",
10433
+ {
10434
+ selector: ["variable"],
10435
+ modifiers: ["global"],
10436
+ format: ["camelCase", "snake_case", "UPPER_CASE", "PascalCase"],
10437
+ leadingUnderscore: "allowSingleOrDouble",
10438
+ trailingUnderscore: "allow",
10439
+ filter: {
10440
+ regex: "[- ]",
10441
+ match: false
10442
+ }
10449
10443
  },
10450
- rules: {
10451
- ...import_js.default.configs.recommended.rules,
10452
- "accessor-pairs": [
10453
- "error",
10454
- { enforceForClassMembers: true, setWithoutGet: true }
10455
- ],
10456
- "array-callback-return": "error",
10457
- "arrow-parens": ["error", "as-needed", { requireForBlockBody: true }],
10458
- "block-scoped-var": "error",
10459
- "constructor-super": "error",
10460
- "default-case-last": "error",
10461
- "dot-notation": ["error", { allowKeywords: true }],
10462
- eqeqeq: ["error", "smart"],
10463
- "new-cap": [
10464
- "error",
10465
- { capIsNew: false, newIsCap: true, properties: true }
10444
+ {
10445
+ selector: [
10446
+ "classProperty",
10447
+ "objectLiteralProperty",
10448
+ "typeProperty",
10449
+ "classMethod",
10450
+ "objectLiteralMethod",
10451
+ "typeMethod",
10452
+ "accessor",
10453
+ "enumMember"
10466
10454
  ],
10467
- "no-alert": "error",
10468
- "no-array-constructor": "error",
10469
- "no-async-promise-executor": "error",
10470
- "no-caller": "error",
10471
- "no-case-declarations": "error",
10472
- "no-class-assign": "error",
10473
- "no-compare-neg-zero": "error",
10474
- "no-cond-assign": ["error", "always"],
10475
- "no-console": ["error", { allow: ["warn", "error"] }],
10476
- "no-const-assign": "error",
10477
- "no-control-regex": "error",
10478
- "no-debugger": "error",
10479
- "no-delete-var": "error",
10480
- "no-dupe-args": "error",
10481
- "no-dupe-class-members": "error",
10482
- "no-dupe-keys": "error",
10483
- "no-duplicate-case": "error",
10484
- "no-empty": ["error", { allowEmptyCatch: true }],
10485
- "no-empty-character-class": "error",
10486
- "no-empty-pattern": "error",
10487
- "no-eval": "error",
10488
- "no-ex-assign": "error",
10489
- "no-extend-native": "error",
10490
- "no-extra-bind": "error",
10491
- "no-extra-boolean-cast": "error",
10492
- "no-fallthrough": "error",
10493
- "no-func-assign": "error",
10494
- "no-global-assign": "error",
10495
- "no-implied-eval": "error",
10496
- "no-import-assign": "error",
10497
- "no-invalid-regexp": "error",
10498
- "no-invalid-this": "error",
10499
- "no-irregular-whitespace": "error",
10500
- "no-iterator": "error",
10501
- "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
10502
- "no-lone-blocks": "error",
10503
- "no-loss-of-precision": "error",
10504
- "no-misleading-character-class": "error",
10505
- "no-multi-str": "error",
10506
- "no-nested-ternary": "off",
10507
- "no-new": "error",
10508
- "no-new-func": "error",
10509
- "no-new-object": "error",
10510
- "no-new-symbol": "error",
10511
- "no-new-wrappers": "error",
10512
- "no-obj-calls": "error",
10513
- "no-octal": "error",
10514
- "no-octal-escape": "error",
10515
- "no-proto": "error",
10516
- "no-prototype-builtins": "error",
10517
- "no-redeclare": ["error", { builtinGlobals: false }],
10518
- "no-regex-spaces": "error",
10519
- "no-restricted-globals": [
10520
- "error",
10521
- { message: "Use `globalThis` instead.", name: "global" },
10522
- { message: "Use `globalThis` instead.", name: "self" }
10455
+ // eslint-disable-next-line unicorn/no-null
10456
+ format: null,
10457
+ modifiers: ["requiresQuotes"]
10458
+ },
10459
+ {
10460
+ selector: [
10461
+ "variable",
10462
+ "function",
10463
+ "classProperty",
10464
+ "objectLiteralProperty",
10465
+ "parameterProperty",
10466
+ "classMethod",
10467
+ "objectLiteralMethod",
10468
+ "typeMethod",
10469
+ "accessor"
10523
10470
  ],
10524
- "no-restricted-properties": [
10471
+ format: ["camelCase", "snake_case", "PascalCase"],
10472
+ leadingUnderscore: "allowSingleOrDouble",
10473
+ trailingUnderscore: "allow",
10474
+ filter: {
10475
+ // also allow when '/' is in object key
10476
+ regex: "^[0-9]|[- ]|[/]",
10477
+ match: false
10478
+ }
10479
+ },
10480
+ {
10481
+ selector: "typeLike",
10482
+ format: ["PascalCase"]
10483
+ },
10484
+ {
10485
+ selector: "variable",
10486
+ types: ["boolean"],
10487
+ format: ["PascalCase", "camelCase"],
10488
+ prefix: ["is", "has", "can", "should", "will", "did"]
10489
+ },
10490
+ {
10491
+ selector: "interface",
10492
+ format: ["PascalCase"]
10493
+ },
10494
+ {
10495
+ selector: "typeParameter",
10496
+ filter: "^T$|^[A-Z][a-zA-Z]+$",
10497
+ format: ["PascalCase"]
10498
+ }
10499
+ ],
10500
+ "@typescript-eslint/no-floating-promises": [
10501
+ "error",
10502
+ {
10503
+ ignoreVoid: true,
10504
+ ignoreIIFE: true
10505
+ }
10506
+ ]
10507
+ };
10508
+ }
10509
+ function typescriptRulesTypeOblivious() {
10510
+ return {
10511
+ eqeqeq: "error",
10512
+ camelcase: "off",
10513
+ yoda: "error",
10514
+ "arrow-parens": "off",
10515
+ "no-console": [
10516
+ "warn",
10517
+ {
10518
+ allow: [
10519
+ "log",
10520
+ "warn",
10521
+ "dir",
10522
+ "time",
10523
+ "timeEnd",
10524
+ "timeLog",
10525
+ "trace",
10526
+ "assert",
10527
+ "clear",
10528
+ "count",
10529
+ "countReset",
10530
+ "group",
10531
+ "groupEnd",
10532
+ "table",
10533
+ "debug",
10534
+ "info",
10535
+ "dirxml",
10525
10536
  "error",
10526
- {
10527
- message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",
10528
- property: "__proto__"
10537
+ "groupCollapsed",
10538
+ "Console",
10539
+ "profile",
10540
+ "profileEnd",
10541
+ "timeStamp",
10542
+ "context"
10543
+ ]
10544
+ }
10545
+ ],
10546
+ "object-curly-spacing": "off",
10547
+ "@typescript-eslint/object-curly-spacing": "off",
10548
+ "@typescript-eslint/no-inferrable-types": "off",
10549
+ "@typescript-eslint/prefer-ts-expect-error": "error",
10550
+ "@typescript-eslint/consistent-type-imports": [
10551
+ "error",
10552
+ {
10553
+ prefer: "type-imports",
10554
+ fixStyle: "separate-type-imports"
10555
+ }
10556
+ ],
10557
+ "@typescript-eslint/adjacent-overload-signatures": "error",
10558
+ "@typescript-eslint/ban-types": [
10559
+ "warn",
10560
+ {
10561
+ extendDefaults: false,
10562
+ types: {
10563
+ String: {
10564
+ message: 'Use "string" instead',
10565
+ fixWith: "string"
10529
10566
  },
10530
- {
10531
- message: "Use `Object.defineProperty` instead.",
10532
- property: "__defineGetter__"
10567
+ Boolean: {
10568
+ message: 'Use "boolean" instead',
10569
+ fixWith: "boolean"
10533
10570
  },
10534
- {
10535
- message: "Use `Object.defineProperty` instead.",
10536
- property: "__defineSetter__"
10571
+ Number: {
10572
+ message: 'Use "number" instead',
10573
+ fixWith: "number"
10537
10574
  },
10538
- {
10539
- message: "Use `Object.getOwnPropertyDescriptor` instead.",
10540
- property: "__lookupGetter__"
10575
+ BigInt: {
10576
+ message: "Use `bigint` instead.",
10577
+ fixWith: "bigint"
10541
10578
  },
10542
- {
10543
- message: "Use `Object.getOwnPropertyDescriptor` instead.",
10544
- property: "__lookupSetter__"
10545
- }
10546
- ],
10547
- "no-restricted-syntax": [
10548
- "error",
10549
- "DebuggerStatement",
10550
- "LabeledStatement",
10551
- "WithStatement",
10552
- "TSEnumDeclaration[const=true]",
10553
- "TSExportAssignment"
10554
- ],
10555
- "no-self-assign": ["error", { props: true }],
10556
- "no-self-compare": "error",
10557
- "no-sequences": "error",
10558
- "no-shadow-restricted-names": "error",
10559
- "no-sparse-arrays": "error",
10560
- "no-template-curly-in-string": "error",
10561
- "no-this-before-super": "error",
10562
- "no-throw-literal": "error",
10563
- "no-undef": "error",
10564
- "no-undef-init": "error",
10565
- "no-unexpected-multiline": "error",
10566
- "no-unmodified-loop-condition": "error",
10567
- "no-unneeded-ternary": ["error", { defaultAssignment: false }],
10568
- "no-unreachable": "error",
10569
- "no-unreachable-loop": "error",
10570
- "no-unsafe-finally": "error",
10571
- "no-unsafe-negation": "error",
10572
- "no-unused-expressions": [
10573
- "error",
10574
- {
10575
- allowShortCircuit: true,
10576
- allowTaggedTemplates: true,
10577
- allowTernary: true
10578
- }
10579
- ],
10580
- "no-unused-vars": [
10581
- "error",
10582
- {
10583
- args: "none",
10584
- caughtErrors: "none",
10585
- ignoreRestSiblings: true,
10586
- vars: "all"
10587
- }
10588
- ],
10589
- "no-use-before-define": [
10590
- "error",
10591
- { classes: false, functions: false, variables: true }
10592
- ],
10593
- "no-useless-backreference": "error",
10594
- "no-useless-call": "error",
10595
- "no-useless-catch": "error",
10596
- "no-useless-computed-key": "error",
10597
- "no-useless-constructor": "error",
10598
- "no-useless-rename": "error",
10599
- "no-useless-return": "error",
10600
- "no-var": "error",
10601
- "no-with": "error",
10602
- "object-shorthand": [
10603
- "error",
10604
- "always",
10605
- {
10606
- avoidQuotes: true,
10607
- ignoreConstructors: false
10608
- }
10609
- ],
10610
- "one-var": ["error", { initialized: "never" }],
10611
- "prefer-arrow-callback": [
10612
- "error",
10613
- {
10614
- allowNamedFunctions: false,
10615
- allowUnboundThis: true
10616
- }
10617
- ],
10618
- "prefer-const": [
10619
- "error",
10620
- {
10621
- destructuring: "all",
10622
- ignoreReadBeforeAssign: true
10623
- }
10624
- ],
10625
- "prefer-exponentiation-operator": "error",
10626
- "prefer-promise-reject-errors": "error",
10627
- "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
10628
- "prefer-rest-params": "error",
10629
- "prefer-spread": "error",
10630
- "prefer-template": "error",
10631
- "sort-imports": [
10632
- "error",
10633
- {
10634
- allowSeparatedGroups: false,
10635
- ignoreCase: false,
10636
- ignoreDeclarationSort: true,
10637
- ignoreMemberSort: false,
10638
- memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
10639
- }
10640
- ],
10641
- "symbol-description": "error",
10642
- "unicode-bom": ["error", "never"],
10643
- "unused-imports/no-unused-imports": isInEditor2 ? "off" : "error",
10644
- "unused-imports/no-unused-vars": [
10645
- "error",
10646
- {
10647
- args: "after-used",
10648
- argsIgnorePattern: "^_",
10649
- vars: "all",
10650
- varsIgnorePattern: "^_"
10651
- }
10652
- ],
10653
- "use-isnan": [
10654
- "error",
10655
- { enforceForIndexOf: true, enforceForSwitchCase: true }
10656
- ],
10657
- "valid-typeof": ["error", { requireStringLiterals: true }],
10658
- "vars-on-top": "error",
10659
- yoda: ["error", "never"],
10660
- ...overrides
10579
+ Object: {
10580
+ message: "The `Object` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead. See https://github.com/typescript-eslint/typescript-eslint/pull/848",
10581
+ fixWith: "Record<string, unknown>"
10582
+ },
10583
+ object: {
10584
+ message: "The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848",
10585
+ fixWith: "Record<string, unknown>"
10586
+ },
10587
+ Symbol: {
10588
+ message: 'Use "symbol" instead',
10589
+ fixWith: "symbol"
10590
+ },
10591
+ Function: {
10592
+ message: 'The "Function" type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with "new".\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.'
10593
+ },
10594
+ // eslint-disable-next-line @typescript-eslint/naming-convention
10595
+ "{}": {
10596
+ message: "The `{}` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead.",
10597
+ fixWith: "Record<string, unknown>"
10598
+ },
10599
+ // eslint-disable-next-line @typescript-eslint/naming-convention
10600
+ "[]": "Don't use the empty array type `[]`. It only allows empty arrays. Use `SomeType[]` instead.",
10601
+ // eslint-disable-next-line @typescript-eslint/naming-convention
10602
+ "[[]]": "Don't use `[[]]`. It only allows an array with a single element which is an empty array. Use `SomeType[][]` instead.",
10603
+ // eslint-disable-next-line @typescript-eslint/naming-convention
10604
+ "[[[]]]": "Don't use `[[[]]]`. Use `SomeType[][][]` instead."
10605
+ }
10606
+ }
10607
+ ],
10608
+ "@typescript-eslint/consistent-type-assertions": "error",
10609
+ "@typescript-eslint/consistent-type-definitions": ["error", "type"],
10610
+ "@typescript-eslint/member-ordering": [
10611
+ "warn",
10612
+ {
10613
+ default: "never",
10614
+ classes: ["field", "constructor", "method"]
10615
+ }
10616
+ ],
10617
+ "no-array-constructor": "off",
10618
+ "@typescript-eslint/no-array-constructor": "error",
10619
+ "@typescript-eslint/no-explicit-any": "error",
10620
+ "@typescript-eslint/no-misused-new": "error",
10621
+ "@typescript-eslint/no-namespace": [
10622
+ "error",
10623
+ {
10624
+ allowDeclarations: false,
10625
+ allowDefinitionFiles: false
10626
+ }
10627
+ ],
10628
+ "no-unused-vars": "off",
10629
+ "@typescript-eslint/no-unused-vars": [
10630
+ "warn",
10631
+ {
10632
+ vars: "all",
10633
+ args: "none",
10634
+ argsIgnorePattern: "^_",
10635
+ varsIgnorePattern: "^_",
10636
+ caughtErrorsIgnorePattern: "^_"
10661
10637
  }
10662
- },
10663
- {
10664
- files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
10665
- name: "jsse:scripts-overrides",
10666
- rules: {
10667
- "no-console": "off"
10638
+ ],
10639
+ "no-use-before-define": "off",
10640
+ "@typescript-eslint/no-use-before-define": [
10641
+ "error",
10642
+ {
10643
+ functions: true,
10644
+ classes: true,
10645
+ variables: true,
10646
+ enums: true,
10647
+ typedefs: true
10668
10648
  }
10669
- }
10670
- ];
10671
- };
10672
-
10673
- // src/configs/jsdoc.ts
10674
- var jsdoc = async () => {
10675
- return [
10676
- {
10677
- name: "jsse:jsdoc",
10678
- plugins: {
10679
- jsdoc: import_eslint_plugin_jsdoc.default
10680
- },
10681
- rules: {
10682
- "jsdoc/check-access": "warn",
10683
- "jsdoc/check-alignment": "warn",
10684
- "jsdoc/check-param-names": "warn",
10685
- "jsdoc/check-property-names": "warn",
10686
- "jsdoc/check-types": "warn",
10687
- "jsdoc/empty-tags": "warn",
10688
- "jsdoc/implements-on-classes": "warn",
10689
- "jsdoc/multiline-blocks": "warn",
10690
- "jsdoc/no-defaults": "warn",
10691
- "jsdoc/no-multi-asterisks": "warn",
10692
- "jsdoc/require-param-name": "warn",
10693
- "jsdoc/require-property": "warn",
10694
- "jsdoc/require-property-description": "warn",
10695
- "jsdoc/require-property-name": "warn",
10696
- "jsdoc/require-returns-check": "warn",
10697
- "jsdoc/require-returns-description": "warn",
10698
- "jsdoc/require-yields-check": "warn"
10649
+ ],
10650
+ "@typescript-eslint/prefer-namespace-keyword": "warn",
10651
+ "@typescript-eslint/typedef": [
10652
+ "warn",
10653
+ {
10654
+ arrayDestructuring: false,
10655
+ arrowParameter: false,
10656
+ memberVariableDeclaration: true,
10657
+ objectDestructuring: false,
10658
+ parameter: true,
10659
+ propertyDeclaration: true,
10660
+ variableDeclaration: false,
10661
+ variableDeclarationIgnoreFunction: true
10699
10662
  }
10700
- }
10701
- ];
10702
- };
10663
+ ],
10664
+ "accessor-pairs": "error",
10665
+ "for-direction": "warn",
10666
+ "guard-for-in": "error",
10667
+ "max-lines": [
10668
+ "warn",
10669
+ {
10670
+ max: 2e3
10671
+ }
10672
+ ],
10673
+ "no-async-promise-executor": "error",
10674
+ "no-bitwise": [
10675
+ "warn",
10676
+ {
10677
+ allow: ["^", "<<", ">>", ">>>", "^=", "<<=", ">>=", ">>>=", "~"]
10678
+ }
10679
+ ],
10680
+ "no-caller": "error",
10681
+ "no-compare-neg-zero": "error",
10682
+ "no-cond-assign": "error",
10683
+ "no-constant-condition": "warn",
10684
+ "no-control-regex": "error",
10685
+ "no-debugger": "warn",
10686
+ "no-delete-var": "error",
10687
+ "no-duplicate-case": "error",
10688
+ "no-empty": "warn",
10689
+ "no-empty-character-class": "error",
10690
+ "no-empty-pattern": "warn",
10691
+ "no-eval": "warn",
10692
+ "no-ex-assign": "error",
10693
+ "no-extend-native": "error",
10694
+ "no-extra-boolean-cast": "warn",
10695
+ "no-extra-label": "warn",
10696
+ "no-fallthrough": "error",
10697
+ "no-func-assign": "warn",
10698
+ "no-implied-eval": "error",
10699
+ "no-invalid-regexp": "error",
10700
+ "no-label-var": "error",
10701
+ "no-lone-blocks": "warn",
10702
+ "no-misleading-character-class": "error",
10703
+ "no-multi-str": "error",
10704
+ "no-new": "warn",
10705
+ "no-new-func": "error",
10706
+ "no-new-wrappers": "warn",
10707
+ "no-octal": "error",
10708
+ "no-octal-escape": "error",
10709
+ "no-regex-spaces": "error",
10710
+ "no-return-assign": "error",
10711
+ "no-script-url": "warn",
10712
+ "no-self-assign": "error",
10713
+ "no-self-compare": "error",
10714
+ "no-sequences": "error",
10715
+ "no-shadow-restricted-names": "error",
10716
+ "no-sparse-arrays": "error",
10717
+ "no-unmodified-loop-condition": "warn",
10718
+ "no-unsafe-finally": "error",
10719
+ "no-unused-expressions": "off",
10720
+ "@typescript-eslint/no-unused-expressions": "error",
10721
+ "no-unused-labels": "error",
10722
+ "no-useless-catch": "warn",
10723
+ "no-useless-concat": "error",
10724
+ "no-var": "error",
10725
+ "no-void": [
10726
+ "error",
10727
+ {
10728
+ allowAsStatement: true
10729
+ }
10730
+ ],
10731
+ "no-with": "error",
10732
+ "prefer-const": "error",
10733
+ "require-atomic-updates": "error",
10734
+ "require-yield": "warn",
10735
+ strict: ["error", "never"],
10736
+ "use-isnan": "error",
10737
+ "no-useless-constructor": "off",
10738
+ "@typescript-eslint/no-useless-constructor": "error",
10739
+ "@typescript-eslint/no-unnecessary-type-constraint": "error",
10740
+ "@typescript-eslint/brace-style": [
10741
+ "error",
10742
+ "1tbs",
10743
+ {
10744
+ allowSingleLine: false
10745
+ }
10746
+ ],
10747
+ "comma-spacing": "off",
10748
+ "@typescript-eslint/comma-spacing": [
10749
+ "error",
10750
+ {
10751
+ before: false,
10752
+ after: true
10753
+ }
10754
+ ],
10755
+ "default-param-last": "off",
10756
+ "@typescript-eslint/default-param-last": "error",
10757
+ "func-call-spacing": "off",
10758
+ "@typescript-eslint/func-call-spacing": ["error", "never"],
10759
+ "keyword-spacing": "off",
10760
+ "@typescript-eslint/keyword-spacing": "error",
10761
+ "lines-between-class-members": "off",
10762
+ "@typescript-eslint/lines-between-class-members": [
10763
+ "error",
10764
+ "always",
10765
+ {
10766
+ exceptAfterSingleLine: true
10767
+ }
10768
+ ],
10769
+ "no-dupe-class-members": "off",
10770
+ "@typescript-eslint/no-dupe-class-members": "error",
10771
+ "no-empty-function": "off",
10772
+ "@typescript-eslint/no-empty-function": "error",
10773
+ "no-extra-parens": "off",
10774
+ "no-extra-semi": "off",
10775
+ "@typescript-eslint/no-extra-semi": "error",
10776
+ "no-loop-func": "off",
10777
+ "@typescript-eslint/no-loop-func": "error",
10778
+ "no-loss-of-precision": "off",
10779
+ "@typescript-eslint/no-loss-of-precision": "error",
10780
+ "no-redeclare": "off",
10781
+ "@typescript-eslint/no-redeclare": "error",
10782
+ "no-restricted-imports": "off",
10783
+ "@typescript-eslint/no-restricted-imports": [
10784
+ "error",
10785
+ {
10786
+ paths: [
10787
+ "error",
10788
+ "domain",
10789
+ "freelist",
10790
+ "smalloc",
10791
+ "punycode",
10792
+ "sys",
10793
+ "querystring",
10794
+ "colors"
10795
+ ]
10796
+ }
10797
+ ],
10798
+ "padding-line-between-statements": "off",
10799
+ "@typescript-eslint/padding-line-between-statements": "off",
10800
+ quotes: "off",
10801
+ "@typescript-eslint/quotes": "off",
10802
+ "space-before-function-paren": "off",
10803
+ "@typescript-eslint/space-before-function-paren": "off",
10804
+ "space-infix-ops": "off",
10805
+ "@typescript-eslint/space-infix-ops": "error",
10806
+ semi: "off",
10807
+ "@typescript-eslint/semi": ["error", "always"],
10808
+ "space-before-blocks": "off",
10809
+ "@typescript-eslint/space-before-blocks": ["error", "always"],
10810
+ "no-undef": "off",
10811
+ "no-duplicate-imports": "off"
10812
+ };
10813
+ }
10814
+ function typescriptRules(props) {
10815
+ const { typeAware } = props ?? {};
10816
+ if (typeAware === true) {
10817
+ return {
10818
+ ...typescriptRulesTypeOblivious(),
10819
+ ...typescriptRulesTypeAware()
10820
+ };
10821
+ }
10822
+ return typescriptRulesTypeOblivious();
10823
+ }
10703
10824
 
10704
- // src/configs/jsonc.ts
10705
- var jsonc = async (options) => {
10706
- const { overrides = {}, stylistic: stylistic2 = true } = options ?? {};
10707
- const { indent = 2 } = typeof stylistic2 === "boolean" ? {} : stylistic2;
10825
+ // src/configs/markdown.ts
10826
+ var markdown = async (options) => {
10827
+ const { componentExts = [], overrides = {} } = options ?? {};
10828
+ const { pluginMarkdown } = await importPluginMarkdown();
10829
+ const tsRulesOff = Object.fromEntries(
10830
+ // @ts-expect-error - undefined
10831
+ Object.keys(typescriptRulesTypeAware()).map((key) => [
10832
+ `@typescript-eslint/${key}`,
10833
+ "off"
10834
+ ])
10835
+ );
10708
10836
  return [
10709
10837
  {
10710
- name: "jsse:jsonc:setup",
10838
+ name: "jsse:markdown:setup",
10711
10839
  plugins: {
10712
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
10713
- jsonc: pluginJsonc
10840
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10841
+ markdown: pluginMarkdown
10714
10842
  }
10715
10843
  },
10716
10844
  {
10717
- files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
10845
+ files: [GLOB_MARKDOWN],
10846
+ name: "jsse:markdown:processor",
10847
+ processor: "markdown/markdown"
10848
+ },
10849
+ {
10850
+ files: [
10851
+ GLOB_MARKDOWN_CODE,
10852
+ ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
10853
+ ],
10718
10854
  languageOptions: {
10719
- parser: import_jsonc_eslint_parser.default
10855
+ parserOptions: {
10856
+ ecmaFeatures: {
10857
+ impliedStrict: true
10858
+ }
10859
+ }
10720
10860
  },
10721
- name: "jsse:jsonc:rules",
10861
+ name: "jsse:markdown:rules",
10722
10862
  rules: {
10723
- "jsonc/no-bigint-literals": "error",
10724
- "jsonc/no-binary-expression": "error",
10725
- "jsonc/no-binary-numeric-literals": "error",
10726
- "jsonc/no-dupe-keys": "error",
10727
- "jsonc/no-escape-sequence-in-identifier": "error",
10728
- "jsonc/no-floating-decimal": "error",
10729
- "jsonc/no-hexadecimal-numeric-literals": "error",
10730
- "jsonc/no-infinity": "error",
10731
- "jsonc/no-multi-str": "error",
10732
- "jsonc/no-nan": "error",
10733
- "jsonc/no-number-props": "error",
10734
- "jsonc/no-numeric-separators": "error",
10735
- "jsonc/no-octal": "error",
10736
- "jsonc/no-octal-escape": "error",
10737
- "jsonc/no-octal-numeric-literals": "error",
10738
- "jsonc/no-parenthesized": "error",
10739
- "jsonc/no-plus-sign": "error",
10740
- "jsonc/no-regexp-literals": "error",
10741
- "jsonc/no-sparse-arrays": "error",
10742
- "jsonc/no-template-literals": "error",
10743
- "jsonc/no-undefined-value": "error",
10744
- "jsonc/no-unicode-codepoint-escapes": "error",
10745
- "jsonc/no-useless-escape": "error",
10746
- "jsonc/space-unary-ops": "error",
10747
- "jsonc/valid-json-number": "error",
10748
- "jsonc/vue-custom-block/no-parsing-error": "error",
10749
- ...stylistic2 ? {
10750
- "jsonc/array-bracket-spacing": ["error", "never"],
10751
- "jsonc/comma-dangle": ["error", "never"],
10752
- "jsonc/comma-style": ["error", "last"],
10753
- "jsonc/indent": ["error", indent],
10754
- "jsonc/key-spacing": [
10755
- "error",
10756
- { afterColon: true, beforeColon: false }
10757
- ],
10758
- "jsonc/object-curly-newline": [
10759
- "error",
10760
- { consistent: true, multiline: true }
10761
- ],
10762
- "jsonc/object-curly-spacing": ["error", "always"],
10763
- "jsonc/object-property-newline": [
10764
- "error",
10765
- { allowMultiplePropertiesPerLine: true }
10766
- ],
10767
- "jsonc/quote-props": "error",
10768
- "jsonc/quotes": "error"
10769
- } : {},
10863
+ "@typescript-eslint/consistent-type-imports": "off",
10864
+ "@typescript-eslint/no-namespace": "off",
10865
+ "@typescript-eslint/no-redeclare": "off",
10866
+ "@typescript-eslint/no-require-imports": "off",
10867
+ "@typescript-eslint/no-unused-vars": "off",
10868
+ "@typescript-eslint/no-use-before-define": "off",
10869
+ "@typescript-eslint/no-var-requires": "off",
10870
+ "no-alert": "off",
10871
+ "no-console": "off",
10872
+ "no-undef": "off",
10873
+ "no-unused-expressions": "off",
10874
+ "no-unused-vars": "off",
10875
+ "node/prefer-global/process": "off",
10876
+ // Type aware rules
10877
+ "object-curly-newline": "off",
10878
+ "style/comma-dangle": "off",
10879
+ "style/eol-last": "off",
10880
+ "unicode-bom": "off",
10881
+ "unused-imports/no-unused-imports": "off",
10882
+ "unused-imports/no-unused-vars": "off",
10883
+ ...tsRulesOff,
10770
10884
  ...overrides
10771
10885
  }
10772
10886
  }
@@ -10934,7 +11048,7 @@ var prettier = async () => {
10934
11048
  };
10935
11049
 
10936
11050
  // src/configs/ts/typescript-language-options.ts
10937
- var import_node_process3 = __toESM(require("process"), 1);
11051
+ var import_node_process4 = __toESM(require("process"), 1);
10938
11052
  function typescriptLanguageOptions(options) {
10939
11053
  const {
10940
11054
  componentExts = [],
@@ -10944,7 +11058,7 @@ function typescriptLanguageOptions(options) {
10944
11058
  } = options || {};
10945
11059
  const tsOptions = tsconfig ? {
10946
11060
  project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
10947
- tsconfigRootDir: import_node_process3.default.cwd()
11061
+ tsconfigRootDir: import_node_process4.default.cwd()
10948
11062
  } : {};
10949
11063
  const parserOptions = {
10950
11064
  ecmaFeatures: react2 ? { jsx: true, modules: true } : void 0,
@@ -11130,20 +11244,18 @@ function reactRules() {
11130
11244
  "react/void-dom-elements-no-children": "error"
11131
11245
  };
11132
11246
  }
11133
- function reactRefreshFlatConfigs() {
11247
+ function reactRefreshFlatConfigRules() {
11134
11248
  return [
11135
11249
  {
11136
11250
  files: [GLOB_SRC],
11137
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11138
- plugins: { "react-refresh": pluginReactRefresh },
11251
+ name: "jsse:react:refresh",
11139
11252
  rules: {
11140
11253
  "react-refresh/only-export-components": "error"
11141
11254
  }
11142
11255
  },
11143
11256
  {
11144
11257
  files: ["**/*.stories.tsx"],
11145
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11146
- plugins: { "react-refresh": pluginReactRefresh },
11258
+ name: "jsse:react:refresh:stories",
11147
11259
  rules: {
11148
11260
  "react-refresh/only-export-components": "off"
11149
11261
  }
@@ -11185,6 +11297,8 @@ var react = async (options) => {
11185
11297
  reactRefresh,
11186
11298
  tsconfig
11187
11299
  } = options ?? {};
11300
+ const reactPlugins = await importReactPlugins();
11301
+ const { pluginReact, pluginReactHooks, pluginReactRefresh } = reactPlugins;
11188
11302
  const config = [
11189
11303
  {
11190
11304
  files: [GLOB_SRC],
@@ -11197,9 +11311,11 @@ var react = async (options) => {
11197
11311
  name: "jsse:react:setup",
11198
11312
  plugins: {
11199
11313
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11200
- react: import_eslint_plugin_react.default,
11314
+ react: pluginReact,
11201
11315
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11202
- "react-hooks": import_eslint_plugin_react_hooks.default
11316
+ "react-hooks": pluginReactHooks,
11317
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11318
+ "react-refresh": pluginReactRefresh
11203
11319
  }
11204
11320
  },
11205
11321
  {
@@ -11208,7 +11324,7 @@ var react = async (options) => {
11208
11324
  rules: {
11209
11325
  ...reactRecomendedRules(),
11210
11326
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
11211
- ...import_eslint_plugin_react.default.configs["jsx-runtime"].rules,
11327
+ ...pluginReact.configs["jsx-runtime"].rules,
11212
11328
  ...reactRules()
11213
11329
  },
11214
11330
  settings: {
@@ -11219,74 +11335,17 @@ var react = async (options) => {
11219
11335
  }
11220
11336
  ];
11221
11337
  if (reactRefresh) {
11222
- config.push(...reactRefreshFlatConfigs());
11338
+ config.push(...reactRefreshFlatConfigRules());
11223
11339
  }
11224
11340
  return config;
11225
11341
  };
11226
11342
 
11227
- // src/configs/stylistic.ts
11228
- function jsxStylistic({
11229
- indent
11230
- }) {
11231
- return {
11232
- "@stylistic/jsx-curly-brace-presence": [
11233
- "error",
11234
- { propElementValues: "always" }
11235
- ],
11236
- "@stylistic/jsx-indent": [
11237
- "error",
11238
- indent,
11239
- { checkAttributes: true, indentLogicalExpressions: true }
11240
- ],
11241
- "@stylistic/jsx-quotes": "error"
11242
- };
11243
- }
11244
- var stylistic = async (options) => {
11245
- const { indent = 2, jsx = true, quotes = "double" } = options ?? {};
11246
- return [
11247
- {
11248
- name: "jsse:stylistic",
11249
- plugins: {
11250
- // eslint-disable-next-line @typescript-eslint/naming-convention
11251
- "@stylistic": import_eslint_plugin.default
11252
- },
11253
- rules: {
11254
- "@stylistic/quote-props": ["error", "as-needed"],
11255
- "@stylistic/quotes": [
11256
- "error",
11257
- quotes,
11258
- { allowTemplateLiterals: false, avoidEscape: true }
11259
- ],
11260
- ...jsx ? jsxStylistic({ indent }) : {}
11261
- }
11262
- }
11263
- ];
11264
- };
11265
-
11266
- // src/configs/tailwind.ts
11267
- var tailwind = async () => {
11268
- return [
11269
- {
11270
- name: "jsse:tailwind",
11271
- plugins: {
11272
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11273
- tailwindcss: import_eslint_plugin_tailwindcss.default
11274
- },
11275
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11276
- rules: {
11277
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
11278
- ...import_eslint_plugin_tailwindcss.default.configs.recommended.rules
11279
- }
11280
- }
11281
- ];
11282
- };
11283
-
11284
- // src/configs/sort.ts
11343
+ // src/configs/sort-package-json.ts
11285
11344
  var sortPackageJson = async () => {
11286
11345
  return [
11287
11346
  {
11288
11347
  files: ["**/package.json"],
11289
- name: "jsse:sort-package-json",
11348
+ name: "jsse:sort:package-json",
11290
11349
  rules: {
11291
11350
  "jsonc/sort-array-values": [
11292
11351
  "error",
@@ -11366,11 +11425,13 @@ var sortPackageJson = async () => {
11366
11425
  }
11367
11426
  ];
11368
11427
  };
11428
+
11429
+ // src/configs/sort-tsconfig.ts
11369
11430
  var sortTsconfig = async () => {
11370
11431
  return [
11371
11432
  {
11372
11433
  files: ["**/tsconfig.json", "**/tsconfig.*.json"],
11373
- name: "jsse:sort-tsconfig",
11434
+ name: "jsse:sort:tsconfig",
11374
11435
  rules: {
11375
11436
  "jsonc/sort-keys": [
11376
11437
  "error",
@@ -11492,67 +11553,111 @@ var sortTsconfig = async () => {
11492
11553
  ];
11493
11554
  };
11494
11555
 
11495
- // src/utils.ts
11496
- var import_node_process4 = __toESM(require("process"), 1);
11497
- async function combine(...configs) {
11498
- const resolved = await Promise.all(configs);
11499
- return resolved.flat();
11500
- }
11501
- async function combineAsync(...configs) {
11502
- const resolved = await Promise.all(configs);
11503
- return resolved.flatMap(
11504
- (config) => Array.isArray(config) ? config : [config]
11505
- );
11556
+ // src/configs/stylistic.ts
11557
+ function jsxStylistic({
11558
+ indent
11559
+ }) {
11560
+ return {
11561
+ "@stylistic/jsx-curly-brace-presence": [
11562
+ "error",
11563
+ { propElementValues: "always" }
11564
+ ],
11565
+ "@stylistic/jsx-indent": [
11566
+ "error",
11567
+ indent,
11568
+ { checkAttributes: true, indentLogicalExpressions: true }
11569
+ ],
11570
+ "@stylistic/jsx-quotes": "error"
11571
+ };
11506
11572
  }
11507
- function renameRules(rules, from, to) {
11508
- if (from === to) {
11509
- return rules;
11510
- }
11511
- return Object.fromEntries(
11512
- Object.entries(rules).map(([key, value]) => {
11513
- if (key.startsWith(from)) {
11514
- return [to + key.slice(from.length), value];
11573
+ var stylistic = async (options) => {
11574
+ const { indent = 2, jsx = true, quotes = "double" } = options ?? {};
11575
+ const { pluginStylistic } = await importPluginStylistic();
11576
+ return [
11577
+ {
11578
+ name: "jsse:stylistic",
11579
+ plugins: {
11580
+ // eslint-disable-next-line @typescript-eslint/naming-convention
11581
+ "@stylistic": pluginStylistic
11582
+ },
11583
+ rules: {
11584
+ "@stylistic/quote-props": ["error", "as-needed"],
11585
+ "@stylistic/quotes": [
11586
+ "error",
11587
+ quotes,
11588
+ { allowTemplateLiterals: false, avoidEscape: true }
11589
+ ],
11590
+ ...jsx ? jsxStylistic({ indent }) : {}
11515
11591
  }
11516
- return [key, value];
11517
- })
11518
- );
11519
- }
11520
- async function interopDefault2(m) {
11521
- const resolved = await m;
11522
- return resolved.default || resolved;
11523
- }
11524
- function isCI() {
11525
- return !!import_node_process4.default.env.CI;
11526
- }
11527
- function isInEditor() {
11528
- return !!((import_node_process4.default.env.VSCODE_PID || import_node_process4.default.env.JETBRAINS_IDE) && !isCI());
11592
+ }
11593
+ ];
11594
+ };
11595
+
11596
+ // src/configs/tailwind.ts
11597
+ var TAILWIND_ESLINT_SETTINGS_DEFAULT = {
11598
+ // These are the default values but feel free to customize
11599
+ callees: ["classnames", "clsx", "ctl", "cn", "cx", "twMerge", "twJoin"],
11600
+ classRegex: "^class(Name)?$",
11601
+ // can be modified to support custom attributes. E.g. "^tw$" for `twin.macro`
11602
+ config: "tailwind.config.js",
11603
+ // returned from `loadConfig()` utility if not provided
11604
+ cssFiles: ["**/*.css", "!**/node_modules", "!**/.*", "!**/dist", "!**/build"],
11605
+ cssFilesRefreshRate: 5e3,
11606
+ removeDuplicates: true,
11607
+ skipClassAttribute: false,
11608
+ tags: [],
11609
+ // can be set to e.g. ['tw'] for use in tw`bg-blue`
11610
+ whitelist: []
11611
+ };
11612
+ function tailwindSettings(options) {
11613
+ if (typeof options === "boolean") {
11614
+ return TAILWIND_ESLINT_SETTINGS_DEFAULT;
11615
+ }
11616
+ return { ...TAILWIND_ESLINT_SETTINGS_DEFAULT, ...options };
11529
11617
  }
11618
+ var tailwind = async (options) => {
11619
+ const { pluginTailwind } = await importPluginTailwind();
11620
+ return [
11621
+ {
11622
+ files: [GLOB_SRC],
11623
+ name: "jsse:tailwind:rules",
11624
+ plugins: {
11625
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11626
+ tailwindcss: pluginTailwind
11627
+ },
11628
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11629
+ rules: {
11630
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
11631
+ ...pluginTailwind.configs.recommended.rules
11632
+ },
11633
+ settings: {
11634
+ tailwindcss: tailwindSettings(options)
11635
+ }
11636
+ }
11637
+ ];
11638
+ };
11530
11639
 
11531
11640
  // src/configs/test.ts
11532
- var test = async (options = {}) => {
11641
+ var noOnlyTests = async (options = {}) => {
11533
11642
  const { isInEditor: isInEditor2 = false, overrides = {} } = options;
11643
+ const pluginNoOnlyTests = await interopDefault2(
11644
+ // @ts-expect-error - types are incorrect/missing
11645
+ import("eslint-plugin-no-only-tests")
11646
+ );
11534
11647
  return [
11535
11648
  {
11536
- name: "jsse:test:setup",
11649
+ name: "jsse:no-only-tests:setup",
11537
11650
  plugins: {
11538
11651
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11539
- "no-only-tests": import_eslint_plugin_no_only_tests.default,
11540
- vitest: import_eslint_plugin_vitest.default
11652
+ "no-only-tests": pluginNoOnlyTests
11541
11653
  }
11542
11654
  },
11543
11655
  {
11544
11656
  files: GLOB_TESTS,
11545
- name: "jsse:test:rules",
11657
+ name: "jsse:no-only-tests:rules",
11546
11658
  rules: {
11547
11659
  "no-only-tests/no-only-tests": isInEditor2 ? "off" : isCI() ? "error" : "warn",
11548
11660
  "unicorn/no-null": "off",
11549
- "vitest/consistent-test-it": [
11550
- "error",
11551
- { fn: "test", withinDescribe: "test" }
11552
- ],
11553
- "vitest/no-identical-title": "error",
11554
- "vitest/prefer-hooks-in-order": "error",
11555
- "vitest/prefer-lowercase-title": "error",
11556
11661
  ...overrides
11557
11662
  }
11558
11663
  }
@@ -11574,9 +11679,9 @@ var typescript = async (options) => {
11574
11679
  const tsPrefixTo = prefix?.to ?? "@typescript-eslint";
11575
11680
  const tsrules = {
11576
11681
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11577
- ...import_eslint_plugin2.default.configs["eslint-recommended"].overrides[0].rules,
11682
+ ...import_eslint_plugin.default.configs["eslint-recommended"].overrides[0].rules,
11578
11683
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11579
- ...import_eslint_plugin2.default.configs.strict.rules,
11684
+ ...import_eslint_plugin.default.configs.strict.rules,
11580
11685
  "no-invalid-this": "off",
11581
11686
  ...typescriptRules(
11582
11687
  typeAware !== false && tsconfigPath ? { typeAware: true } : { typeAware: false }
@@ -11589,7 +11694,7 @@ var typescript = async (options) => {
11589
11694
  name: "jsse:typescript:setup",
11590
11695
  plugins: {
11591
11696
  import: pluginImport,
11592
- [tsPrefixTo]: import_eslint_plugin2.default
11697
+ [tsPrefixTo]: import_eslint_plugin.default
11593
11698
  }
11594
11699
  },
11595
11700
  // ...tseslint.configs.recommended,
@@ -11737,6 +11842,42 @@ var unicorn = async () => {
11737
11842
  // Use new when throwing error
11738
11843
  "unicorn/throw-new-error": "error"
11739
11844
  }
11845
+ },
11846
+ {
11847
+ files: GLOB_TESTS,
11848
+ name: "jsse:unicorn:tests",
11849
+ rules: {
11850
+ "unicorn/no-null": "off",
11851
+ "unicorn/no-unused-properties": "off"
11852
+ }
11853
+ }
11854
+ ];
11855
+ };
11856
+
11857
+ // src/configs/vitest.ts
11858
+ var vitest = async (options = {}) => {
11859
+ const { overrides = {} } = options;
11860
+ const pluginVitest = await interopDefault2(import("eslint-plugin-vitest"));
11861
+ return [
11862
+ {
11863
+ name: "jsse:vitest:setup",
11864
+ plugins: {
11865
+ vitest: pluginVitest
11866
+ }
11867
+ },
11868
+ {
11869
+ files: GLOB_TESTS,
11870
+ name: "jsse:vitest:rules",
11871
+ rules: {
11872
+ "vitest/consistent-test-it": [
11873
+ "error",
11874
+ { fn: "test", withinDescribe: "test" }
11875
+ ],
11876
+ "vitest/no-identical-title": "error",
11877
+ "vitest/prefer-hooks-in-order": "error",
11878
+ "vitest/prefer-lowercase-title": "error",
11879
+ ...overrides
11880
+ }
11740
11881
  }
11741
11882
  ];
11742
11883
  };
@@ -11884,7 +12025,7 @@ async function jsse(options = {}, ...userConfigs) {
11884
12025
  const configs = [];
11885
12026
  if (enableGitignore) {
11886
12027
  if (typeof enableGitignore === "boolean") {
11887
- if (import_node_fs3.default.existsSync(".gitignore"))
12028
+ if (import_node_fs3.default.existsSync(".gitignore")) {
11888
12029
  configs.push(
11889
12030
  interopDefault2(import("eslint-config-flat-gitignore")).then((r2) => {
11890
12031
  const res = r2();
@@ -11892,6 +12033,7 @@ async function jsse(options = {}, ...userConfigs) {
11892
12033
  return [res];
11893
12034
  })
11894
12035
  );
12036
+ }
11895
12037
  } else {
11896
12038
  configs.push(
11897
12039
  interopDefault2(import("eslint-config-flat-gitignore")).then((r2) => {
@@ -11957,7 +12099,11 @@ async function jsse(options = {}, ...userConfigs) {
11957
12099
  }
11958
12100
  if (normalizedOptions.test) {
11959
12101
  configs.push(
11960
- test({
12102
+ vitest({
12103
+ isInEditor: isInEditor2,
12104
+ overrides: overrides.test
12105
+ }),
12106
+ noOnlyTests({
11961
12107
  isInEditor: isInEditor2,
11962
12108
  overrides: overrides.test
11963
12109
  })
@@ -11974,7 +12120,15 @@ async function jsse(options = {}, ...userConfigs) {
11974
12120
  );
11975
12121
  }
11976
12122
  if (normalizedOptions.tailwind) {
11977
- configs.push(tailwind());
12123
+ try {
12124
+ configs.push(
12125
+ tailwind(
12126
+ normalizedOptions.tailwind === true ? {} : normalizedOptions.tailwind
12127
+ )
12128
+ );
12129
+ } catch (e) {
12130
+ log.error("Tailwind config failed", e);
12131
+ }
11978
12132
  }
11979
12133
  const fusedConfig = flatConfigProps.reduce((acc, key) => {
11980
12134
  if (key in options) {
@@ -12073,38 +12227,40 @@ function jsseReact() {
12073
12227
  GLOB_SRC_EXT,
12074
12228
  GLOB_STYLE,
12075
12229
  GLOB_TESTS,
12230
+ GLOB_TOML,
12076
12231
  GLOB_TS,
12077
12232
  GLOB_TSX,
12078
12233
  GLOB_YAML,
12079
12234
  combine,
12080
12235
  combineAsync,
12236
+ importJsoncLibs,
12237
+ importParserJsonc,
12238
+ importPluginJsdoc,
12239
+ importPluginJsonc,
12240
+ importPluginMarkdown,
12241
+ importPluginReact,
12242
+ importPluginReactHooks,
12243
+ importPluginReactRefresh,
12244
+ importPluginStylistic,
12245
+ importPluginTailwind,
12246
+ importReactPlugins,
12247
+ importYmlLibs,
12081
12248
  interopDefault,
12082
12249
  isCI,
12083
12250
  isInEditor,
12084
12251
  jsse,
12085
12252
  jsseReact,
12086
12253
  jssestd,
12087
- parserJsonc,
12088
12254
  parserTs,
12089
12255
  pluginAntfu,
12090
12256
  pluginEslintComments,
12091
12257
  pluginImport,
12092
- pluginJsdoc,
12093
- pluginJsonc,
12094
- pluginMarkdown,
12095
12258
  pluginN,
12096
- pluginNoOnlyTests,
12097
12259
  pluginPerfectionist,
12098
- pluginReact,
12099
- pluginReactHooks,
12100
- pluginReactRefresh,
12101
12260
  pluginSortKeys,
12102
- pluginStylistic,
12103
- pluginTailwind,
12104
12261
  pluginTs,
12105
12262
  pluginUnicorn,
12106
12263
  pluginUnusedImports,
12107
- pluginVitest,
12108
12264
  renameRules
12109
12265
  });
12110
12266
  /*! Bundled license information: