@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.js CHANGED
@@ -9594,6 +9594,83 @@ function resolvePackage(name, options = {}) {
9594
9594
  }
9595
9595
  }
9596
9596
 
9597
+ // src/lager.ts
9598
+ var levels = {
9599
+ trace: 10,
9600
+ debug: 20,
9601
+ info: 30,
9602
+ warn: 40,
9603
+ error: 50,
9604
+ fatal: 60
9605
+ };
9606
+ function isLagerLevel(level) {
9607
+ return level === "trace" || level === "debug" || level === "info" || level === "warn" || level === "error" || level === "fatal";
9608
+ }
9609
+ var Lager = class {
9610
+ constructor(options) {
9611
+ this._level = "info";
9612
+ this.id = "lager";
9613
+ this.levelNo = levels[this._level];
9614
+ const { level, id } = {
9615
+ level: "info",
9616
+ id: "lager",
9617
+ ...options
9618
+ };
9619
+ this.id = id;
9620
+ this._level = isLagerLevel(level) ? level : "info";
9621
+ this.levelNo = levels[this._level];
9622
+ this.log = this.log.bind(this);
9623
+ this.debug = this.debug.bind(this);
9624
+ }
9625
+ get level() {
9626
+ return this._level;
9627
+ }
9628
+ set level(level) {
9629
+ this._level = level;
9630
+ this.levelNo = levels[level];
9631
+ }
9632
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9633
+ log(...args) {
9634
+ console.log(...args);
9635
+ }
9636
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9637
+ trace(...args) {
9638
+ if (this.levelNo > levels.trace) {
9639
+ return;
9640
+ }
9641
+ console.trace(...args);
9642
+ }
9643
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9644
+ debug(...args) {
9645
+ if (this.levelNo > levels.debug) {
9646
+ return;
9647
+ }
9648
+ console.debug(...args);
9649
+ }
9650
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9651
+ info(...args) {
9652
+ if (this.levelNo > levels.info) {
9653
+ return;
9654
+ }
9655
+ console.info(...args);
9656
+ }
9657
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9658
+ warn(...args) {
9659
+ if (this.levelNo > levels.warn) {
9660
+ return;
9661
+ }
9662
+ console.warn(...args);
9663
+ }
9664
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9665
+ error(...args) {
9666
+ if (this.levelNo > levels.error) {
9667
+ return;
9668
+ }
9669
+ console.error(...args);
9670
+ }
9671
+ };
9672
+ var log = new Lager();
9673
+
9597
9674
  // src/globs.ts
9598
9675
  var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
9599
9676
  var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
@@ -9608,6 +9685,7 @@ var GLOB_SCSS = "**/*.scss";
9608
9685
  var GLOB_JSON = "**/*.json";
9609
9686
  var GLOB_JSON5 = "**/*.json5";
9610
9687
  var GLOB_JSONC = "**/*.jsonc";
9688
+ var GLOB_TOML = "**/*.toml";
9611
9689
  var GLOB_MARKDOWN = "**/*.md";
9612
9690
  var GLOB_YAML = "**/*.y?(a)ml";
9613
9691
  var GLOB_HTML = "**/*.htm?(l)";
@@ -9662,28 +9740,135 @@ var GLOB_EXCLUDE = [
9662
9740
  "**/yarn.lock"
9663
9741
  ];
9664
9742
 
9743
+ // src/utils.ts
9744
+ import process3 from "process";
9745
+ async function combine(...configs) {
9746
+ const resolved = await Promise.all(configs);
9747
+ return resolved.flat();
9748
+ }
9749
+ async function combineAsync(...configs) {
9750
+ const resolved = await Promise.all(configs);
9751
+ return resolved.flatMap(
9752
+ (config) => Array.isArray(config) ? config : [config]
9753
+ );
9754
+ }
9755
+ function renameRules(rules, from, to) {
9756
+ if (from === to) {
9757
+ return rules;
9758
+ }
9759
+ return Object.fromEntries(
9760
+ Object.entries(rules).map(([key, value]) => {
9761
+ if (key.startsWith(from)) {
9762
+ return [to + key.slice(from.length), value];
9763
+ }
9764
+ return [key, value];
9765
+ })
9766
+ );
9767
+ }
9768
+ async function interopDefault2(m) {
9769
+ const resolved = await m;
9770
+ return resolved.default || resolved;
9771
+ }
9772
+ function isCI() {
9773
+ return !!process3.env.CI;
9774
+ }
9775
+ function isInEditor() {
9776
+ return !!((process3.env.VSCODE_PID || process3.env.JETBRAINS_IDE) && !isCI());
9777
+ }
9778
+
9665
9779
  // src/plugins.ts
9666
9780
  var pluginSortKeys = __toESM(require_eslint_plugin_sort_keys(), 1);
9667
- import { default as default2 } from "@stylistic/eslint-plugin";
9668
- import { default as default3 } from "@typescript-eslint/eslint-plugin";
9669
- import * as parserTs from "@typescript-eslint/parser";
9670
- import { default as default4 } from "eslint-plugin-antfu";
9671
- import { default as default5 } from "eslint-plugin-eslint-comments";
9781
+ import { default as default2 } from "eslint-plugin-antfu";
9782
+ import { default as default3 } from "eslint-plugin-eslint-comments";
9672
9783
  import * as pluginImport from "eslint-plugin-import-x";
9673
- import { default as default6 } from "eslint-plugin-jsdoc";
9674
- import * as pluginJsonc from "eslint-plugin-jsonc";
9675
- import { default as default7 } from "eslint-plugin-markdown";
9676
- import { default as default8 } from "eslint-plugin-n";
9677
- import { default as default9 } from "eslint-plugin-no-only-tests";
9678
- import { default as default10 } from "eslint-plugin-perfectionist";
9679
- import { default as default11 } from "eslint-plugin-react";
9680
- import { default as default12 } from "eslint-plugin-react-hooks";
9681
- import * as pluginReactRefresh from "eslint-plugin-react-refresh";
9682
- import { default as default13 } from "eslint-plugin-tailwindcss";
9683
- import { default as default14 } from "eslint-plugin-unicorn";
9684
- import { default as default15 } from "eslint-plugin-unused-imports";
9685
- import { default as default16 } from "eslint-plugin-vitest";
9686
- import { default as default17 } from "jsonc-eslint-parser";
9784
+ import { default as default4 } from "eslint-plugin-n";
9785
+ import { default as default5 } from "eslint-plugin-perfectionist";
9786
+ import { default as default6 } from "eslint-plugin-unicorn";
9787
+ import { default as default7 } from "eslint-plugin-unused-imports";
9788
+ import { default as default8 } from "@typescript-eslint/eslint-plugin";
9789
+ import * as parserTs from "@typescript-eslint/parser";
9790
+ async function importPluginReact() {
9791
+ const pluginReact = await interopDefault2(import("eslint-plugin-react"));
9792
+ return {
9793
+ pluginReact
9794
+ };
9795
+ }
9796
+ async function importPluginReactHooks() {
9797
+ const pluginReactHooks = await interopDefault2(
9798
+ import("eslint-plugin-react-hooks")
9799
+ );
9800
+ return {
9801
+ pluginReactHooks
9802
+ };
9803
+ }
9804
+ async function importPluginReactRefresh() {
9805
+ const pluginReactRefresh = await interopDefault2(
9806
+ import("eslint-plugin-react-refresh")
9807
+ );
9808
+ return {
9809
+ pluginReactRefresh
9810
+ };
9811
+ }
9812
+ async function importReactPlugins() {
9813
+ const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
9814
+ [
9815
+ interopDefault2(import("eslint-plugin-react")),
9816
+ interopDefault2(import("eslint-plugin-react-hooks")),
9817
+ interopDefault2(import("eslint-plugin-react-refresh"))
9818
+ ]
9819
+ );
9820
+ return { pluginReact, pluginReactHooks, pluginReactRefresh };
9821
+ }
9822
+ async function importParserJsonc() {
9823
+ const parserJsonc = await interopDefault2(import("jsonc-eslint-parser"));
9824
+ return {
9825
+ parserJsonc
9826
+ };
9827
+ }
9828
+ async function importPluginJsonc() {
9829
+ const pluginJsonc = await interopDefault2(import("eslint-plugin-jsonc"));
9830
+ return {
9831
+ pluginJsonc
9832
+ };
9833
+ }
9834
+ async function importJsoncLibs() {
9835
+ const [{ parserJsonc }, { pluginJsonc }] = await Promise.all([
9836
+ importParserJsonc(),
9837
+ importPluginJsonc()
9838
+ ]);
9839
+ return { parserJsonc, pluginJsonc };
9840
+ }
9841
+ async function importYmlLibs() {
9842
+ const [pluginYaml, parserYaml] = await Promise.all([
9843
+ interopDefault2(import("eslint-plugin-yml")),
9844
+ interopDefault2(import("yaml-eslint-parser"))
9845
+ ]);
9846
+ return { parserYaml, pluginYaml };
9847
+ }
9848
+ async function importPluginMarkdown() {
9849
+ const pluginMarkdown = await interopDefault2(import("eslint-plugin-markdown"));
9850
+ return {
9851
+ pluginMarkdown
9852
+ };
9853
+ }
9854
+ async function importPluginJsdoc() {
9855
+ const pluginJsdoc = await interopDefault2(import("eslint-plugin-jsdoc"));
9856
+ return {
9857
+ pluginJsdoc
9858
+ };
9859
+ }
9860
+ async function importPluginStylistic() {
9861
+ const pluginStylistic = await interopDefault2(
9862
+ import("@stylistic/eslint-plugin")
9863
+ );
9864
+ return { pluginStylistic };
9865
+ }
9866
+ async function importPluginTailwind() {
9867
+ const pluginTailwind = await interopDefault2(
9868
+ import("eslint-plugin-tailwindcss")
9869
+ );
9870
+ return { pluginTailwind };
9871
+ }
9687
9872
 
9688
9873
  // src/configs/antfu.ts
9689
9874
  var antfu = async () => {
@@ -9691,7 +9876,7 @@ var antfu = async () => {
9691
9876
  {
9692
9877
  name: "jsse:antfu",
9693
9878
  plugins: {
9694
- antfu: default4
9879
+ antfu: default2
9695
9880
  },
9696
9881
  // @ts-expect-error - antfu plugin types err
9697
9882
  rules: {
@@ -9701,7 +9886,7 @@ var antfu = async () => {
9701
9886
  },
9702
9887
  {
9703
9888
  files: ["**/src/**/*"],
9704
- name: "jsse:antfu:bin",
9889
+ name: "jsse:antfu:src",
9705
9890
  // @ts-expect-error - antfu plugin types err
9706
9891
  rules: {
9707
9892
  "antfu/no-import-dist": "error"
@@ -9718,989 +9903,916 @@ var antfu = async () => {
9718
9903
  ];
9719
9904
  };
9720
9905
 
9721
- // src/lager.ts
9722
- var levels = {
9723
- trace: 10,
9724
- debug: 20,
9725
- info: 30,
9726
- warn: 40,
9727
- error: 50,
9728
- fatal: 60
9729
- };
9730
- function isLagerLevel(level) {
9731
- return level === "trace" || level === "debug" || level === "info" || level === "warn" || level === "error" || level === "fatal";
9732
- }
9733
- var Lager = class {
9734
- constructor(options) {
9735
- this._level = "info";
9736
- this.id = "lager";
9737
- this.levelNo = levels[this._level];
9738
- const { level, id } = {
9739
- level: "info",
9740
- id: "lager",
9741
- ...options
9742
- };
9743
- this.id = id;
9744
- this._level = isLagerLevel(level) ? level : "info";
9745
- this.levelNo = levels[this._level];
9746
- this.log = this.log.bind(this);
9747
- this.debug = this.debug.bind(this);
9748
- }
9749
- get level() {
9750
- return this._level;
9751
- }
9752
- set level(level) {
9753
- this._level = level;
9754
- this.levelNo = levels[level];
9755
- }
9756
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9757
- log(...args) {
9758
- console.log(...args);
9759
- }
9760
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9761
- trace(...args) {
9762
- if (this.levelNo > levels.trace) {
9763
- return;
9764
- }
9765
- console.trace(...args);
9766
- }
9767
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9768
- debug(...args) {
9769
- if (this.levelNo > levels.debug) {
9770
- return;
9771
- }
9772
- console.debug(...args);
9773
- }
9774
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9775
- info(...args) {
9776
- if (this.levelNo > levels.info) {
9777
- return;
9778
- }
9779
- console.info(...args);
9780
- }
9781
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9782
- warn(...args) {
9783
- if (this.levelNo > levels.warn) {
9784
- return;
9906
+ // src/configs/comments.ts
9907
+ var comments = async () => [
9908
+ {
9909
+ name: "jsse:eslint-comments",
9910
+ plugins: {
9911
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
9912
+ "eslint-comments": default3
9913
+ },
9914
+ rules: {
9915
+ "eslint-comments/no-aggregating-enable": "error",
9916
+ "eslint-comments/no-duplicate-disable": "error",
9917
+ "eslint-comments/no-unlimited-disable": "error",
9918
+ "eslint-comments/no-unused-enable": "error"
9785
9919
  }
9786
- console.warn(...args);
9787
9920
  }
9788
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9789
- error(...args) {
9790
- if (this.levelNo > levels.error) {
9791
- return;
9921
+ ];
9922
+
9923
+ // src/configs/ignores.ts
9924
+ var ignores = async () => {
9925
+ return [
9926
+ {
9927
+ ignores: GLOB_EXCLUDE
9792
9928
  }
9793
- console.error(...args);
9794
- }
9929
+ ];
9795
9930
  };
9796
- var log = new Lager();
9797
9931
 
9798
- // src/configs/ts/typescript-rules.ts
9799
- function typescriptRulesTypeAware() {
9800
- return {
9801
- "@typescript-eslint/await-thenable": "error",
9802
- "@typescript-eslint/no-for-in-array": "error",
9803
- "no-implied-eval": "off",
9804
- "@typescript-eslint/consistent-type-exports": [
9805
- "error",
9806
- {
9807
- fixMixedExportsWithInlineTypeSpecifier: true
9808
- }
9809
- ],
9810
- "dot-notation": "off",
9811
- "@typescript-eslint/dot-notation": [
9812
- "error",
9813
- {
9814
- allowPattern: "^_",
9815
- allowKeywords: true
9816
- }
9817
- ],
9818
- "@typescript-eslint/no-implied-eval": "error",
9819
- "@typescript-eslint/no-misused-promises": "error",
9820
- "@typescript-eslint/no-unnecessary-qualifier": "error",
9821
- "@typescript-eslint/no-unnecessary-type-arguments": "off",
9822
- "@typescript-eslint/no-unnecessary-type-assertion": "error",
9823
- "@typescript-eslint/no-useless-template-literals": "error",
9824
- "no-throw-literal": "off",
9825
- "@typescript-eslint/no-throw-literal": "error",
9826
- "@typescript-eslint/no-unsafe-argument": "error",
9827
- "@typescript-eslint/no-unsafe-assignment": "error",
9828
- "@typescript-eslint/no-unsafe-call": "error",
9829
- "@typescript-eslint/no-unsafe-member-access": "error",
9830
- "@typescript-eslint/no-unsafe-return": "error",
9831
- "@typescript-eslint/restrict-plus-operands": "error",
9832
- "@typescript-eslint/restrict-template-expressions": "error",
9833
- "@typescript-eslint/unbound-method": "error",
9834
- "@typescript-eslint/naming-convention": [
9835
- "error",
9836
- {
9837
- selector: ["variable"],
9838
- modifiers: ["global"],
9839
- format: ["camelCase", "snake_case", "UPPER_CASE", "PascalCase"],
9840
- leadingUnderscore: "allowSingleOrDouble",
9841
- trailingUnderscore: "allow",
9842
- filter: {
9843
- regex: "[- ]",
9844
- match: false
9845
- }
9846
- },
9847
- {
9848
- selector: [
9849
- "classProperty",
9850
- "objectLiteralProperty",
9851
- "typeProperty",
9852
- "classMethod",
9853
- "objectLiteralMethod",
9854
- "typeMethod",
9855
- "accessor",
9856
- "enumMember"
9857
- ],
9858
- // eslint-disable-next-line unicorn/no-null
9859
- format: null,
9860
- modifiers: ["requiresQuotes"]
9861
- },
9862
- {
9863
- selector: [
9864
- "variable",
9865
- "function",
9866
- "classProperty",
9867
- "objectLiteralProperty",
9868
- "parameterProperty",
9869
- "classMethod",
9870
- "objectLiteralMethod",
9871
- "typeMethod",
9872
- "accessor"
9873
- ],
9874
- format: ["camelCase", "snake_case", "PascalCase"],
9875
- leadingUnderscore: "allowSingleOrDouble",
9876
- trailingUnderscore: "allow",
9877
- filter: {
9878
- // also allow when '/' is in object key
9879
- regex: "^[0-9]|[- ]|[/]",
9880
- match: false
9881
- }
9932
+ // src/configs/imports.ts
9933
+ var imports = async (options) => {
9934
+ const { stylistic: stylistic2 = true } = options ?? {};
9935
+ return [
9936
+ {
9937
+ name: "jsse:import",
9938
+ plugins: {
9939
+ import: pluginImport
9882
9940
  },
9883
- {
9884
- selector: "typeLike",
9885
- format: ["PascalCase"]
9941
+ rules: {
9942
+ "import/first": "error",
9943
+ "import/no-duplicates": "error",
9944
+ "import/no-mutable-exports": "error",
9945
+ "import/no-named-default": "error",
9946
+ "import/no-self-import": "error",
9947
+ "import/no-webpack-loader-syntax": "error",
9948
+ "import/order": "error",
9949
+ ...stylistic2 ? {
9950
+ "import/newline-after-import": [
9951
+ "error",
9952
+ { considerComments: true, count: 1 }
9953
+ ]
9954
+ } : {}
9955
+ }
9956
+ }
9957
+ ];
9958
+ };
9959
+
9960
+ // src/configs/javascript.ts
9961
+ var import_globals = __toESM(require_globals2(), 1);
9962
+ import eslintjs from "@eslint/js";
9963
+ var javascript = async (options) => {
9964
+ const {
9965
+ isInEditor: isInEditor2 = false,
9966
+ overrides = {},
9967
+ reportUnusedDisableDirectives = true
9968
+ } = options ?? {};
9969
+ return [
9970
+ {
9971
+ languageOptions: {
9972
+ ecmaVersion: 2022,
9973
+ globals: {
9974
+ ...import_globals.default.browser,
9975
+ ...import_globals.default.es2021,
9976
+ ...import_globals.default.node,
9977
+ document: "readonly",
9978
+ navigator: "readonly",
9979
+ window: "readonly"
9980
+ },
9981
+ parserOptions: {
9982
+ ecmaFeatures: {
9983
+ jsx: true
9984
+ },
9985
+ ecmaVersion: 2022,
9986
+ sourceType: "module"
9987
+ },
9988
+ sourceType: "module"
9886
9989
  },
9887
- {
9888
- selector: "variable",
9889
- types: ["boolean"],
9890
- format: ["PascalCase", "camelCase"],
9891
- prefix: ["is", "has", "can", "should", "will", "did"]
9990
+ linterOptions: {
9991
+ reportUnusedDisableDirectives
9892
9992
  },
9893
- {
9894
- selector: "interface",
9895
- format: ["PascalCase"]
9993
+ name: "jsse:javascript",
9994
+ plugins: {
9995
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
9996
+ "unused-imports": default7
9896
9997
  },
9897
- {
9898
- selector: "typeParameter",
9899
- filter: "^T$|^[A-Z][a-zA-Z]+$",
9900
- format: ["PascalCase"]
9901
- }
9902
- ],
9903
- "@typescript-eslint/no-floating-promises": [
9904
- "error",
9905
- {
9906
- ignoreVoid: true,
9907
- ignoreIIFE: true
9908
- }
9909
- ]
9910
- };
9911
- }
9912
- function typescriptRulesTypeOblivious() {
9913
- return {
9914
- eqeqeq: "error",
9915
- camelcase: "off",
9916
- yoda: "error",
9917
- "arrow-parens": "off",
9918
- "no-console": [
9919
- "warn",
9920
- {
9921
- allow: [
9922
- "log",
9923
- "warn",
9924
- "dir",
9925
- "time",
9926
- "timeEnd",
9927
- "timeLog",
9928
- "trace",
9929
- "assert",
9930
- "clear",
9931
- "count",
9932
- "countReset",
9933
- "group",
9934
- "groupEnd",
9935
- "table",
9936
- "debug",
9937
- "info",
9938
- "dirxml",
9998
+ rules: {
9999
+ ...eslintjs.configs.recommended.rules,
10000
+ "accessor-pairs": [
9939
10001
  "error",
9940
- "groupCollapsed",
9941
- "Console",
9942
- "profile",
9943
- "profileEnd",
9944
- "timeStamp",
9945
- "context"
9946
- ]
9947
- }
9948
- ],
9949
- "object-curly-spacing": "off",
9950
- "@typescript-eslint/object-curly-spacing": "off",
9951
- "@typescript-eslint/no-inferrable-types": "off",
9952
- "@typescript-eslint/prefer-ts-expect-error": "error",
9953
- "@typescript-eslint/consistent-type-imports": [
9954
- "error",
9955
- {
9956
- prefer: "type-imports",
9957
- fixStyle: "separate-type-imports"
9958
- }
9959
- ],
9960
- "@typescript-eslint/adjacent-overload-signatures": "error",
9961
- "@typescript-eslint/ban-types": [
9962
- "warn",
9963
- {
9964
- extendDefaults: false,
9965
- types: {
9966
- String: {
9967
- message: 'Use "string" instead',
9968
- fixWith: "string"
9969
- },
9970
- Boolean: {
9971
- message: 'Use "boolean" instead',
9972
- fixWith: "boolean"
9973
- },
9974
- Number: {
9975
- message: 'Use "number" instead',
9976
- fixWith: "number"
9977
- },
9978
- BigInt: {
9979
- message: "Use `bigint` instead.",
9980
- fixWith: "bigint"
9981
- },
9982
- Object: {
9983
- 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",
9984
- fixWith: "Record<string, unknown>"
9985
- },
9986
- object: {
9987
- message: "The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848",
9988
- fixWith: "Record<string, unknown>"
9989
- },
9990
- Symbol: {
9991
- message: 'Use "symbol" instead',
9992
- fixWith: "symbol"
9993
- },
9994
- Function: {
9995
- 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.'
9996
- },
9997
- // eslint-disable-next-line @typescript-eslint/naming-convention
9998
- "{}": {
9999
- message: "The `{}` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead.",
10000
- fixWith: "Record<string, unknown>"
10001
- },
10002
- // eslint-disable-next-line @typescript-eslint/naming-convention
10003
- "[]": "Don't use the empty array type `[]`. It only allows empty arrays. Use `SomeType[]` instead.",
10004
- // eslint-disable-next-line @typescript-eslint/naming-convention
10005
- "[[]]": "Don't use `[[]]`. It only allows an array with a single element which is an empty array. Use `SomeType[][]` instead.",
10006
- // eslint-disable-next-line @typescript-eslint/naming-convention
10007
- "[[[]]]": "Don't use `[[[]]]`. Use `SomeType[][][]` instead."
10008
- }
10009
- }
10010
- ],
10011
- "@typescript-eslint/consistent-type-assertions": "error",
10012
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
10013
- "@typescript-eslint/member-ordering": [
10014
- "warn",
10015
- {
10016
- default: "never",
10017
- classes: ["field", "constructor", "method"]
10018
- }
10019
- ],
10020
- "no-array-constructor": "off",
10021
- "@typescript-eslint/no-array-constructor": "error",
10022
- "@typescript-eslint/no-explicit-any": "error",
10023
- "@typescript-eslint/no-misused-new": "error",
10024
- "@typescript-eslint/no-namespace": [
10025
- "error",
10026
- {
10027
- allowDeclarations: false,
10028
- allowDefinitionFiles: false
10029
- }
10030
- ],
10031
- "no-unused-vars": "off",
10032
- "@typescript-eslint/no-unused-vars": [
10033
- "warn",
10034
- {
10035
- vars: "all",
10036
- args: "none",
10037
- argsIgnorePattern: "^_",
10038
- varsIgnorePattern: "^_",
10039
- caughtErrorsIgnorePattern: "^_"
10040
- }
10041
- ],
10042
- "no-use-before-define": "off",
10043
- "@typescript-eslint/no-use-before-define": [
10044
- "error",
10045
- {
10046
- functions: true,
10047
- classes: true,
10048
- variables: true,
10049
- enums: true,
10050
- typedefs: true
10051
- }
10052
- ],
10053
- "@typescript-eslint/prefer-namespace-keyword": "warn",
10054
- "@typescript-eslint/typedef": [
10055
- "warn",
10056
- {
10057
- arrayDestructuring: false,
10058
- arrowParameter: false,
10059
- memberVariableDeclaration: true,
10060
- objectDestructuring: false,
10061
- parameter: true,
10062
- propertyDeclaration: true,
10063
- variableDeclaration: false,
10064
- variableDeclarationIgnoreFunction: true
10065
- }
10066
- ],
10067
- "accessor-pairs": "error",
10068
- "for-direction": "warn",
10069
- "guard-for-in": "error",
10070
- "max-lines": [
10071
- "warn",
10072
- {
10073
- max: 2e3
10074
- }
10075
- ],
10076
- "no-async-promise-executor": "error",
10077
- "no-bitwise": [
10078
- "warn",
10079
- {
10080
- allow: ["^", "<<", ">>", ">>>", "^=", "<<=", ">>=", ">>>=", "~"]
10081
- }
10082
- ],
10083
- "no-caller": "error",
10084
- "no-compare-neg-zero": "error",
10085
- "no-cond-assign": "error",
10086
- "no-constant-condition": "warn",
10087
- "no-control-regex": "error",
10088
- "no-debugger": "warn",
10089
- "no-delete-var": "error",
10090
- "no-duplicate-case": "error",
10091
- "no-empty": "warn",
10092
- "no-empty-character-class": "error",
10093
- "no-empty-pattern": "warn",
10094
- "no-eval": "warn",
10095
- "no-ex-assign": "error",
10096
- "no-extend-native": "error",
10097
- "no-extra-boolean-cast": "warn",
10098
- "no-extra-label": "warn",
10099
- "no-fallthrough": "error",
10100
- "no-func-assign": "warn",
10101
- "no-implied-eval": "error",
10102
- "no-invalid-regexp": "error",
10103
- "no-label-var": "error",
10104
- "no-lone-blocks": "warn",
10105
- "no-misleading-character-class": "error",
10106
- "no-multi-str": "error",
10107
- "no-new": "warn",
10108
- "no-new-func": "error",
10109
- "no-new-wrappers": "warn",
10110
- "no-octal": "error",
10111
- "no-octal-escape": "error",
10112
- "no-regex-spaces": "error",
10113
- "no-return-assign": "error",
10114
- "no-script-url": "warn",
10115
- "no-self-assign": "error",
10116
- "no-self-compare": "error",
10117
- "no-sequences": "error",
10118
- "no-shadow-restricted-names": "error",
10119
- "no-sparse-arrays": "error",
10120
- "no-unmodified-loop-condition": "warn",
10121
- "no-unsafe-finally": "error",
10122
- "no-unused-expressions": "off",
10123
- "@typescript-eslint/no-unused-expressions": "error",
10124
- "no-unused-labels": "error",
10125
- "no-useless-catch": "warn",
10126
- "no-useless-concat": "error",
10127
- "no-var": "error",
10128
- "no-void": [
10129
- "error",
10130
- {
10131
- allowAsStatement: true
10132
- }
10133
- ],
10134
- "no-with": "error",
10135
- "prefer-const": "error",
10136
- "require-atomic-updates": "error",
10137
- "require-yield": "warn",
10138
- strict: ["error", "never"],
10139
- "use-isnan": "error",
10140
- "no-useless-constructor": "off",
10141
- "@typescript-eslint/no-useless-constructor": "error",
10142
- "@typescript-eslint/no-unnecessary-type-constraint": "error",
10143
- "@typescript-eslint/brace-style": [
10144
- "error",
10145
- "1tbs",
10146
- {
10147
- allowSingleLine: false
10148
- }
10149
- ],
10150
- "comma-spacing": "off",
10151
- "@typescript-eslint/comma-spacing": [
10152
- "error",
10153
- {
10154
- before: false,
10155
- after: true
10156
- }
10157
- ],
10158
- "default-param-last": "off",
10159
- "@typescript-eslint/default-param-last": "error",
10160
- "func-call-spacing": "off",
10161
- "@typescript-eslint/func-call-spacing": ["error", "never"],
10162
- "keyword-spacing": "off",
10163
- "@typescript-eslint/keyword-spacing": "error",
10164
- "lines-between-class-members": "off",
10165
- "@typescript-eslint/lines-between-class-members": [
10166
- "error",
10167
- "always",
10168
- {
10169
- exceptAfterSingleLine: true
10170
- }
10171
- ],
10172
- "no-dupe-class-members": "off",
10173
- "@typescript-eslint/no-dupe-class-members": "error",
10174
- "no-empty-function": "off",
10175
- "@typescript-eslint/no-empty-function": "error",
10176
- "no-extra-parens": "off",
10177
- "no-extra-semi": "off",
10178
- "@typescript-eslint/no-extra-semi": "error",
10179
- "no-loop-func": "off",
10180
- "@typescript-eslint/no-loop-func": "error",
10181
- "no-loss-of-precision": "off",
10182
- "@typescript-eslint/no-loss-of-precision": "error",
10183
- "no-redeclare": "off",
10184
- "@typescript-eslint/no-redeclare": "error",
10185
- "no-restricted-imports": "off",
10186
- "@typescript-eslint/no-restricted-imports": [
10187
- "error",
10188
- {
10189
- paths: [
10002
+ { enforceForClassMembers: true, setWithoutGet: true }
10003
+ ],
10004
+ "array-callback-return": "error",
10005
+ "arrow-parens": ["error", "as-needed", { requireForBlockBody: true }],
10006
+ "block-scoped-var": "error",
10007
+ "constructor-super": "error",
10008
+ "default-case-last": "error",
10009
+ "dot-notation": ["error", { allowKeywords: true }],
10010
+ eqeqeq: ["error", "smart"],
10011
+ "new-cap": [
10012
+ "error",
10013
+ { capIsNew: false, newIsCap: true, properties: true }
10014
+ ],
10015
+ "no-alert": "error",
10016
+ "no-array-constructor": "error",
10017
+ "no-async-promise-executor": "error",
10018
+ "no-caller": "error",
10019
+ "no-case-declarations": "error",
10020
+ "no-class-assign": "error",
10021
+ "no-compare-neg-zero": "error",
10022
+ "no-cond-assign": ["error", "always"],
10023
+ "no-console": ["error", { allow: ["warn", "error"] }],
10024
+ "no-const-assign": "error",
10025
+ "no-control-regex": "error",
10026
+ "no-debugger": "error",
10027
+ "no-delete-var": "error",
10028
+ "no-dupe-args": "error",
10029
+ "no-dupe-class-members": "error",
10030
+ "no-dupe-keys": "error",
10031
+ "no-duplicate-case": "error",
10032
+ "no-empty": ["error", { allowEmptyCatch: true }],
10033
+ "no-empty-character-class": "error",
10034
+ "no-empty-pattern": "error",
10035
+ "no-eval": "error",
10036
+ "no-ex-assign": "error",
10037
+ "no-extend-native": "error",
10038
+ "no-extra-bind": "error",
10039
+ "no-extra-boolean-cast": "error",
10040
+ "no-fallthrough": "error",
10041
+ "no-func-assign": "error",
10042
+ "no-global-assign": "error",
10043
+ "no-implied-eval": "error",
10044
+ "no-import-assign": "error",
10045
+ "no-invalid-regexp": "error",
10046
+ "no-invalid-this": "error",
10047
+ "no-irregular-whitespace": "error",
10048
+ "no-iterator": "error",
10049
+ "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
10050
+ "no-lone-blocks": "error",
10051
+ "no-loss-of-precision": "error",
10052
+ "no-misleading-character-class": "error",
10053
+ "no-multi-str": "error",
10054
+ "no-nested-ternary": "off",
10055
+ "no-new": "error",
10056
+ "no-new-func": "error",
10057
+ "no-new-object": "error",
10058
+ "no-new-symbol": "error",
10059
+ "no-new-wrappers": "error",
10060
+ "no-obj-calls": "error",
10061
+ "no-octal": "error",
10062
+ "no-octal-escape": "error",
10063
+ "no-proto": "error",
10064
+ "no-prototype-builtins": "error",
10065
+ "no-redeclare": ["error", { builtinGlobals: false }],
10066
+ "no-regex-spaces": "error",
10067
+ "no-restricted-globals": [
10068
+ "error",
10069
+ { message: "Use `globalThis` instead.", name: "global" },
10070
+ { message: "Use `globalThis` instead.", name: "self" }
10071
+ ],
10072
+ "no-restricted-properties": [
10073
+ "error",
10074
+ {
10075
+ message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",
10076
+ property: "__proto__"
10077
+ },
10078
+ {
10079
+ message: "Use `Object.defineProperty` instead.",
10080
+ property: "__defineGetter__"
10081
+ },
10082
+ {
10083
+ message: "Use `Object.defineProperty` instead.",
10084
+ property: "__defineSetter__"
10085
+ },
10086
+ {
10087
+ message: "Use `Object.getOwnPropertyDescriptor` instead.",
10088
+ property: "__lookupGetter__"
10089
+ },
10090
+ {
10091
+ message: "Use `Object.getOwnPropertyDescriptor` instead.",
10092
+ property: "__lookupSetter__"
10093
+ }
10094
+ ],
10095
+ "no-restricted-syntax": [
10096
+ "error",
10097
+ "DebuggerStatement",
10098
+ "LabeledStatement",
10099
+ "WithStatement",
10100
+ "TSEnumDeclaration[const=true]",
10101
+ "TSExportAssignment"
10102
+ ],
10103
+ "no-self-assign": ["error", { props: true }],
10104
+ "no-self-compare": "error",
10105
+ "no-sequences": "error",
10106
+ "no-shadow-restricted-names": "error",
10107
+ "no-sparse-arrays": "error",
10108
+ "no-template-curly-in-string": "error",
10109
+ "no-this-before-super": "error",
10110
+ "no-throw-literal": "error",
10111
+ "no-undef": "error",
10112
+ "no-undef-init": "error",
10113
+ "no-unexpected-multiline": "error",
10114
+ "no-unmodified-loop-condition": "error",
10115
+ "no-unneeded-ternary": ["error", { defaultAssignment: false }],
10116
+ "no-unreachable": "error",
10117
+ "no-unreachable-loop": "error",
10118
+ "no-unsafe-finally": "error",
10119
+ "no-unsafe-negation": "error",
10120
+ "no-unused-expressions": [
10121
+ "error",
10122
+ {
10123
+ allowShortCircuit: true,
10124
+ allowTaggedTemplates: true,
10125
+ allowTernary: true
10126
+ }
10127
+ ],
10128
+ "no-unused-vars": [
10190
10129
  "error",
10191
- "domain",
10192
- "freelist",
10193
- "smalloc",
10194
- "punycode",
10195
- "sys",
10196
- "querystring",
10197
- "colors"
10198
- ]
10199
- }
10200
- ],
10201
- "padding-line-between-statements": "off",
10202
- "@typescript-eslint/padding-line-between-statements": "off",
10203
- quotes: "off",
10204
- "@typescript-eslint/quotes": "off",
10205
- "space-before-function-paren": "off",
10206
- "@typescript-eslint/space-before-function-paren": "off",
10207
- "space-infix-ops": "off",
10208
- "@typescript-eslint/space-infix-ops": "error",
10209
- semi: "off",
10210
- "@typescript-eslint/semi": ["error", "always"],
10211
- "space-before-blocks": "off",
10212
- "@typescript-eslint/space-before-blocks": ["error", "always"],
10213
- "no-undef": "off",
10214
- "no-duplicate-imports": "off"
10215
- };
10216
- }
10217
- function typescriptRules(props) {
10218
- const { typeAware } = props ?? {};
10219
- if (typeAware === true) {
10220
- return {
10221
- ...typescriptRulesTypeOblivious(),
10222
- ...typescriptRulesTypeAware()
10223
- };
10224
- }
10225
- return typescriptRulesTypeOblivious();
10226
- }
10227
-
10228
- // src/configs/markdown.ts
10229
- var markdown = async (options) => {
10230
- const { componentExts = [], overrides = {} } = options ?? {};
10231
- const tsRulesOff = Object.fromEntries(
10232
- // @ts-expect-error - undefined
10233
- Object.keys(typescriptRulesTypeAware()).map((key) => [
10234
- `@typescript-eslint/${key}`,
10235
- "off"
10236
- ])
10237
- );
10238
- return [
10239
- {
10240
- name: "jsse:markdown:setup",
10241
- plugins: {
10242
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10243
- markdown: default7
10130
+ {
10131
+ args: "none",
10132
+ caughtErrors: "none",
10133
+ ignoreRestSiblings: true,
10134
+ vars: "all"
10135
+ }
10136
+ ],
10137
+ "no-use-before-define": [
10138
+ "error",
10139
+ { classes: false, functions: false, variables: true }
10140
+ ],
10141
+ "no-useless-backreference": "error",
10142
+ "no-useless-call": "error",
10143
+ "no-useless-catch": "error",
10144
+ "no-useless-computed-key": "error",
10145
+ "no-useless-constructor": "error",
10146
+ "no-useless-rename": "error",
10147
+ "no-useless-return": "error",
10148
+ "no-var": "error",
10149
+ "no-with": "error",
10150
+ "object-shorthand": [
10151
+ "error",
10152
+ "always",
10153
+ {
10154
+ avoidQuotes: true,
10155
+ ignoreConstructors: false
10156
+ }
10157
+ ],
10158
+ "one-var": ["error", { initialized: "never" }],
10159
+ "prefer-arrow-callback": [
10160
+ "error",
10161
+ {
10162
+ allowNamedFunctions: false,
10163
+ allowUnboundThis: true
10164
+ }
10165
+ ],
10166
+ "prefer-const": [
10167
+ "error",
10168
+ {
10169
+ destructuring: "all",
10170
+ ignoreReadBeforeAssign: true
10171
+ }
10172
+ ],
10173
+ "prefer-exponentiation-operator": "error",
10174
+ "prefer-promise-reject-errors": "error",
10175
+ "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
10176
+ "prefer-rest-params": "error",
10177
+ "prefer-spread": "error",
10178
+ "prefer-template": "error",
10179
+ "sort-imports": [
10180
+ "error",
10181
+ {
10182
+ allowSeparatedGroups: false,
10183
+ ignoreCase: false,
10184
+ ignoreDeclarationSort: true,
10185
+ ignoreMemberSort: false,
10186
+ memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
10187
+ }
10188
+ ],
10189
+ "symbol-description": "error",
10190
+ "unicode-bom": ["error", "never"],
10191
+ "unused-imports/no-unused-imports": isInEditor2 ? "off" : "error",
10192
+ "unused-imports/no-unused-vars": [
10193
+ "error",
10194
+ {
10195
+ args: "after-used",
10196
+ argsIgnorePattern: "^_",
10197
+ vars: "all",
10198
+ varsIgnorePattern: "^_"
10199
+ }
10200
+ ],
10201
+ "use-isnan": [
10202
+ "error",
10203
+ { enforceForIndexOf: true, enforceForSwitchCase: true }
10204
+ ],
10205
+ "valid-typeof": ["error", { requireStringLiterals: true }],
10206
+ "vars-on-top": "error",
10207
+ yoda: ["error", "never"],
10208
+ ...overrides
10244
10209
  }
10245
10210
  },
10246
10211
  {
10247
- files: [GLOB_MARKDOWN],
10248
- name: "jsse:markdown:processor",
10249
- processor: "markdown/markdown"
10250
- },
10251
- {
10252
- files: [
10253
- GLOB_MARKDOWN_CODE,
10254
- ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
10255
- ],
10256
- languageOptions: {
10257
- parserOptions: {
10258
- ecmaFeatures: {
10259
- impliedStrict: true
10260
- }
10261
- }
10262
- },
10263
- name: "jsse:markdown:rules",
10212
+ files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
10213
+ name: "jsse:scripts-overrides",
10264
10214
  rules: {
10265
- "@typescript-eslint/consistent-type-imports": "off",
10266
- "@typescript-eslint/no-namespace": "off",
10267
- "@typescript-eslint/no-redeclare": "off",
10268
- "@typescript-eslint/no-require-imports": "off",
10269
- "@typescript-eslint/no-unused-vars": "off",
10270
- "@typescript-eslint/no-use-before-define": "off",
10271
- "@typescript-eslint/no-var-requires": "off",
10272
- "no-alert": "off",
10273
- "no-console": "off",
10274
- "no-undef": "off",
10275
- "no-unused-expressions": "off",
10276
- "no-unused-vars": "off",
10277
- "node/prefer-global/process": "off",
10278
- // Type aware rules
10279
- "object-curly-newline": "off",
10280
- "style/comma-dangle": "off",
10281
- "style/eol-last": "off",
10282
- "unicode-bom": "off",
10283
- "unused-imports/no-unused-imports": "off",
10284
- "unused-imports/no-unused-vars": "off",
10285
- ...tsRulesOff,
10286
- ...overrides
10215
+ "no-console": "off"
10287
10216
  }
10288
10217
  }
10289
10218
  ];
10290
10219
  };
10291
10220
 
10292
- // src/configs/comments.ts
10293
- var comments = async () => [
10294
- {
10295
- name: "jsse:eslint-comments",
10296
- plugins: {
10297
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10298
- "eslint-comments": default5
10299
- },
10300
- rules: {
10301
- "eslint-comments/no-aggregating-enable": "error",
10302
- "eslint-comments/no-duplicate-disable": "error",
10303
- "eslint-comments/no-unlimited-disable": "error",
10304
- "eslint-comments/no-unused-enable": "error"
10305
- }
10306
- }
10307
- ];
10308
-
10309
- // src/configs/ignores.ts
10310
- var ignores = async () => {
10221
+ // src/configs/jsdoc.ts
10222
+ var jsdoc = async () => {
10223
+ const { pluginJsdoc } = await importPluginJsdoc();
10311
10224
  return [
10312
10225
  {
10313
- ignores: GLOB_EXCLUDE
10226
+ name: "jsse:jsdoc",
10227
+ plugins: {
10228
+ jsdoc: pluginJsdoc
10229
+ },
10230
+ rules: {
10231
+ "jsdoc/check-access": "warn",
10232
+ "jsdoc/check-alignment": "warn",
10233
+ "jsdoc/check-param-names": "warn",
10234
+ "jsdoc/check-property-names": "warn",
10235
+ "jsdoc/check-types": "warn",
10236
+ "jsdoc/empty-tags": "warn",
10237
+ "jsdoc/implements-on-classes": "warn",
10238
+ "jsdoc/multiline-blocks": "warn",
10239
+ "jsdoc/no-defaults": "warn",
10240
+ "jsdoc/no-multi-asterisks": "warn",
10241
+ "jsdoc/require-param-name": "warn",
10242
+ "jsdoc/require-property": "warn",
10243
+ "jsdoc/require-property-description": "warn",
10244
+ "jsdoc/require-property-name": "warn",
10245
+ "jsdoc/require-returns-check": "warn",
10246
+ "jsdoc/require-returns-description": "warn",
10247
+ "jsdoc/require-yields-check": "warn"
10248
+ }
10314
10249
  }
10315
10250
  ];
10316
10251
  };
10317
10252
 
10318
- // src/configs/imports.ts
10319
- var imports = async (options) => {
10320
- const { stylistic: stylistic2 = true } = options ?? {};
10253
+ // src/configs/jsonc.ts
10254
+ var jsonc = async (options) => {
10255
+ const { overrides = {}, stylistic: stylistic2 = true } = options ?? {};
10256
+ const { indent = 2 } = typeof stylistic2 === "boolean" ? {} : stylistic2;
10257
+ const { parserJsonc, pluginJsonc } = await importJsoncLibs();
10321
10258
  return [
10322
10259
  {
10323
- name: "jsse:imports",
10260
+ name: "jsse:jsonc:setup",
10324
10261
  plugins: {
10325
- import: pluginImport
10262
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
10263
+ jsonc: pluginJsonc
10264
+ }
10265
+ },
10266
+ {
10267
+ files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
10268
+ ignores: ["*.min.json"],
10269
+ languageOptions: {
10270
+ parser: parserJsonc
10326
10271
  },
10272
+ name: "jsse:jsonc:rules",
10327
10273
  rules: {
10328
- "import/first": "error",
10329
- "import/no-duplicates": "error",
10330
- "import/no-mutable-exports": "error",
10331
- "import/no-named-default": "error",
10332
- "import/no-self-import": "error",
10333
- "import/no-webpack-loader-syntax": "error",
10334
- "import/order": "error",
10274
+ "jsonc/no-bigint-literals": "error",
10275
+ "jsonc/no-binary-expression": "error",
10276
+ "jsonc/no-binary-numeric-literals": "error",
10277
+ "jsonc/no-dupe-keys": "error",
10278
+ "jsonc/no-escape-sequence-in-identifier": "error",
10279
+ "jsonc/no-floating-decimal": "error",
10280
+ "jsonc/no-hexadecimal-numeric-literals": "error",
10281
+ "jsonc/no-infinity": "error",
10282
+ "jsonc/no-multi-str": "error",
10283
+ "jsonc/no-nan": "error",
10284
+ "jsonc/no-number-props": "error",
10285
+ "jsonc/no-numeric-separators": "error",
10286
+ "jsonc/no-octal": "error",
10287
+ "jsonc/no-octal-escape": "error",
10288
+ "jsonc/no-octal-numeric-literals": "error",
10289
+ "jsonc/no-parenthesized": "error",
10290
+ "jsonc/no-plus-sign": "error",
10291
+ "jsonc/no-regexp-literals": "error",
10292
+ "jsonc/no-sparse-arrays": "error",
10293
+ "jsonc/no-template-literals": "error",
10294
+ "jsonc/no-undefined-value": "error",
10295
+ "jsonc/no-unicode-codepoint-escapes": "error",
10296
+ "jsonc/no-useless-escape": "error",
10297
+ "jsonc/space-unary-ops": "error",
10298
+ "jsonc/valid-json-number": "error",
10299
+ "jsonc/vue-custom-block/no-parsing-error": "error",
10335
10300
  ...stylistic2 ? {
10336
- "import/newline-after-import": [
10301
+ "jsonc/array-bracket-spacing": ["error", "never"],
10302
+ "jsonc/comma-dangle": ["error", "never"],
10303
+ "jsonc/comma-style": ["error", "last"],
10304
+ "jsonc/indent": ["error", indent],
10305
+ "jsonc/key-spacing": [
10337
10306
  "error",
10338
- { considerComments: true, count: 1 }
10339
- ]
10340
- } : {}
10307
+ { afterColon: true, beforeColon: false }
10308
+ ],
10309
+ "jsonc/object-curly-newline": [
10310
+ "error",
10311
+ { consistent: true, multiline: true }
10312
+ ],
10313
+ "jsonc/object-curly-spacing": ["error", "always"],
10314
+ "jsonc/object-property-newline": [
10315
+ "error",
10316
+ { allowMultiplePropertiesPerLine: true }
10317
+ ],
10318
+ "jsonc/quote-props": "error",
10319
+ "jsonc/quotes": "error"
10320
+ } : {},
10321
+ ...overrides
10341
10322
  }
10342
10323
  }
10343
10324
  ];
10344
10325
  };
10345
10326
 
10346
- // src/configs/javascript.ts
10347
- var import_globals = __toESM(require_globals2(), 1);
10348
- import eslintjs from "@eslint/js";
10349
- var javascript = async (options) => {
10350
- const {
10351
- isInEditor: isInEditor2 = false,
10352
- overrides = {},
10353
- reportUnusedDisableDirectives = true
10354
- } = options ?? {};
10355
- return [
10356
- {
10357
- languageOptions: {
10358
- ecmaVersion: 2022,
10359
- globals: {
10360
- ...import_globals.default.browser,
10361
- ...import_globals.default.es2021,
10362
- ...import_globals.default.node,
10363
- document: "readonly",
10364
- navigator: "readonly",
10365
- window: "readonly"
10366
- },
10367
- parserOptions: {
10368
- ecmaFeatures: {
10369
- jsx: true
10370
- },
10371
- ecmaVersion: 2022,
10372
- sourceType: "module"
10373
- },
10374
- sourceType: "module"
10375
- },
10376
- linterOptions: {
10377
- reportUnusedDisableDirectives
10378
- },
10379
- name: "jsse:javascript",
10380
- plugins: {
10381
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10382
- "unused-imports": default15
10327
+ // src/configs/ts/typescript-rules.ts
10328
+ function typescriptRulesTypeAware() {
10329
+ return {
10330
+ "@typescript-eslint/await-thenable": "error",
10331
+ "@typescript-eslint/no-for-in-array": "error",
10332
+ "no-implied-eval": "off",
10333
+ "@typescript-eslint/consistent-type-exports": [
10334
+ "error",
10335
+ {
10336
+ fixMixedExportsWithInlineTypeSpecifier: true
10337
+ }
10338
+ ],
10339
+ "dot-notation": "off",
10340
+ "@typescript-eslint/dot-notation": [
10341
+ "error",
10342
+ {
10343
+ allowPattern: "^_",
10344
+ allowKeywords: true
10345
+ }
10346
+ ],
10347
+ "@typescript-eslint/no-implied-eval": "error",
10348
+ "@typescript-eslint/no-misused-promises": "error",
10349
+ "@typescript-eslint/no-unnecessary-qualifier": "error",
10350
+ "@typescript-eslint/no-unnecessary-type-arguments": "off",
10351
+ "@typescript-eslint/no-unnecessary-type-assertion": "error",
10352
+ "@typescript-eslint/no-useless-template-literals": "error",
10353
+ "no-throw-literal": "off",
10354
+ "@typescript-eslint/no-throw-literal": "error",
10355
+ "@typescript-eslint/no-unsafe-argument": "error",
10356
+ "@typescript-eslint/no-unsafe-assignment": "error",
10357
+ "@typescript-eslint/no-unsafe-call": "error",
10358
+ "@typescript-eslint/no-unsafe-member-access": "error",
10359
+ "@typescript-eslint/no-unsafe-return": "error",
10360
+ "@typescript-eslint/restrict-plus-operands": "error",
10361
+ "@typescript-eslint/restrict-template-expressions": "error",
10362
+ "@typescript-eslint/unbound-method": "error",
10363
+ "@typescript-eslint/naming-convention": [
10364
+ "error",
10365
+ {
10366
+ selector: ["variable"],
10367
+ modifiers: ["global"],
10368
+ format: ["camelCase", "snake_case", "UPPER_CASE", "PascalCase"],
10369
+ leadingUnderscore: "allowSingleOrDouble",
10370
+ trailingUnderscore: "allow",
10371
+ filter: {
10372
+ regex: "[- ]",
10373
+ match: false
10374
+ }
10383
10375
  },
10384
- rules: {
10385
- ...eslintjs.configs.recommended.rules,
10386
- "accessor-pairs": [
10387
- "error",
10388
- { enforceForClassMembers: true, setWithoutGet: true }
10389
- ],
10390
- "array-callback-return": "error",
10391
- "arrow-parens": ["error", "as-needed", { requireForBlockBody: true }],
10392
- "block-scoped-var": "error",
10393
- "constructor-super": "error",
10394
- "default-case-last": "error",
10395
- "dot-notation": ["error", { allowKeywords: true }],
10396
- eqeqeq: ["error", "smart"],
10397
- "new-cap": [
10398
- "error",
10399
- { capIsNew: false, newIsCap: true, properties: true }
10376
+ {
10377
+ selector: [
10378
+ "classProperty",
10379
+ "objectLiteralProperty",
10380
+ "typeProperty",
10381
+ "classMethod",
10382
+ "objectLiteralMethod",
10383
+ "typeMethod",
10384
+ "accessor",
10385
+ "enumMember"
10400
10386
  ],
10401
- "no-alert": "error",
10402
- "no-array-constructor": "error",
10403
- "no-async-promise-executor": "error",
10404
- "no-caller": "error",
10405
- "no-case-declarations": "error",
10406
- "no-class-assign": "error",
10407
- "no-compare-neg-zero": "error",
10408
- "no-cond-assign": ["error", "always"],
10409
- "no-console": ["error", { allow: ["warn", "error"] }],
10410
- "no-const-assign": "error",
10411
- "no-control-regex": "error",
10412
- "no-debugger": "error",
10413
- "no-delete-var": "error",
10414
- "no-dupe-args": "error",
10415
- "no-dupe-class-members": "error",
10416
- "no-dupe-keys": "error",
10417
- "no-duplicate-case": "error",
10418
- "no-empty": ["error", { allowEmptyCatch: true }],
10419
- "no-empty-character-class": "error",
10420
- "no-empty-pattern": "error",
10421
- "no-eval": "error",
10422
- "no-ex-assign": "error",
10423
- "no-extend-native": "error",
10424
- "no-extra-bind": "error",
10425
- "no-extra-boolean-cast": "error",
10426
- "no-fallthrough": "error",
10427
- "no-func-assign": "error",
10428
- "no-global-assign": "error",
10429
- "no-implied-eval": "error",
10430
- "no-import-assign": "error",
10431
- "no-invalid-regexp": "error",
10432
- "no-invalid-this": "error",
10433
- "no-irregular-whitespace": "error",
10434
- "no-iterator": "error",
10435
- "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
10436
- "no-lone-blocks": "error",
10437
- "no-loss-of-precision": "error",
10438
- "no-misleading-character-class": "error",
10439
- "no-multi-str": "error",
10440
- "no-nested-ternary": "off",
10441
- "no-new": "error",
10442
- "no-new-func": "error",
10443
- "no-new-object": "error",
10444
- "no-new-symbol": "error",
10445
- "no-new-wrappers": "error",
10446
- "no-obj-calls": "error",
10447
- "no-octal": "error",
10448
- "no-octal-escape": "error",
10449
- "no-proto": "error",
10450
- "no-prototype-builtins": "error",
10451
- "no-redeclare": ["error", { builtinGlobals: false }],
10452
- "no-regex-spaces": "error",
10453
- "no-restricted-globals": [
10454
- "error",
10455
- { message: "Use `globalThis` instead.", name: "global" },
10456
- { message: "Use `globalThis` instead.", name: "self" }
10387
+ // eslint-disable-next-line unicorn/no-null
10388
+ format: null,
10389
+ modifiers: ["requiresQuotes"]
10390
+ },
10391
+ {
10392
+ selector: [
10393
+ "variable",
10394
+ "function",
10395
+ "classProperty",
10396
+ "objectLiteralProperty",
10397
+ "parameterProperty",
10398
+ "classMethod",
10399
+ "objectLiteralMethod",
10400
+ "typeMethod",
10401
+ "accessor"
10457
10402
  ],
10458
- "no-restricted-properties": [
10403
+ format: ["camelCase", "snake_case", "PascalCase"],
10404
+ leadingUnderscore: "allowSingleOrDouble",
10405
+ trailingUnderscore: "allow",
10406
+ filter: {
10407
+ // also allow when '/' is in object key
10408
+ regex: "^[0-9]|[- ]|[/]",
10409
+ match: false
10410
+ }
10411
+ },
10412
+ {
10413
+ selector: "typeLike",
10414
+ format: ["PascalCase"]
10415
+ },
10416
+ {
10417
+ selector: "variable",
10418
+ types: ["boolean"],
10419
+ format: ["PascalCase", "camelCase"],
10420
+ prefix: ["is", "has", "can", "should", "will", "did"]
10421
+ },
10422
+ {
10423
+ selector: "interface",
10424
+ format: ["PascalCase"]
10425
+ },
10426
+ {
10427
+ selector: "typeParameter",
10428
+ filter: "^T$|^[A-Z][a-zA-Z]+$",
10429
+ format: ["PascalCase"]
10430
+ }
10431
+ ],
10432
+ "@typescript-eslint/no-floating-promises": [
10433
+ "error",
10434
+ {
10435
+ ignoreVoid: true,
10436
+ ignoreIIFE: true
10437
+ }
10438
+ ]
10439
+ };
10440
+ }
10441
+ function typescriptRulesTypeOblivious() {
10442
+ return {
10443
+ eqeqeq: "error",
10444
+ camelcase: "off",
10445
+ yoda: "error",
10446
+ "arrow-parens": "off",
10447
+ "no-console": [
10448
+ "warn",
10449
+ {
10450
+ allow: [
10451
+ "log",
10452
+ "warn",
10453
+ "dir",
10454
+ "time",
10455
+ "timeEnd",
10456
+ "timeLog",
10457
+ "trace",
10458
+ "assert",
10459
+ "clear",
10460
+ "count",
10461
+ "countReset",
10462
+ "group",
10463
+ "groupEnd",
10464
+ "table",
10465
+ "debug",
10466
+ "info",
10467
+ "dirxml",
10459
10468
  "error",
10460
- {
10461
- message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",
10462
- property: "__proto__"
10469
+ "groupCollapsed",
10470
+ "Console",
10471
+ "profile",
10472
+ "profileEnd",
10473
+ "timeStamp",
10474
+ "context"
10475
+ ]
10476
+ }
10477
+ ],
10478
+ "object-curly-spacing": "off",
10479
+ "@typescript-eslint/object-curly-spacing": "off",
10480
+ "@typescript-eslint/no-inferrable-types": "off",
10481
+ "@typescript-eslint/prefer-ts-expect-error": "error",
10482
+ "@typescript-eslint/consistent-type-imports": [
10483
+ "error",
10484
+ {
10485
+ prefer: "type-imports",
10486
+ fixStyle: "separate-type-imports"
10487
+ }
10488
+ ],
10489
+ "@typescript-eslint/adjacent-overload-signatures": "error",
10490
+ "@typescript-eslint/ban-types": [
10491
+ "warn",
10492
+ {
10493
+ extendDefaults: false,
10494
+ types: {
10495
+ String: {
10496
+ message: 'Use "string" instead',
10497
+ fixWith: "string"
10463
10498
  },
10464
- {
10465
- message: "Use `Object.defineProperty` instead.",
10466
- property: "__defineGetter__"
10499
+ Boolean: {
10500
+ message: 'Use "boolean" instead',
10501
+ fixWith: "boolean"
10467
10502
  },
10468
- {
10469
- message: "Use `Object.defineProperty` instead.",
10470
- property: "__defineSetter__"
10503
+ Number: {
10504
+ message: 'Use "number" instead',
10505
+ fixWith: "number"
10471
10506
  },
10472
- {
10473
- message: "Use `Object.getOwnPropertyDescriptor` instead.",
10474
- property: "__lookupGetter__"
10507
+ BigInt: {
10508
+ message: "Use `bigint` instead.",
10509
+ fixWith: "bigint"
10475
10510
  },
10476
- {
10477
- message: "Use `Object.getOwnPropertyDescriptor` instead.",
10478
- property: "__lookupSetter__"
10479
- }
10480
- ],
10481
- "no-restricted-syntax": [
10482
- "error",
10483
- "DebuggerStatement",
10484
- "LabeledStatement",
10485
- "WithStatement",
10486
- "TSEnumDeclaration[const=true]",
10487
- "TSExportAssignment"
10488
- ],
10489
- "no-self-assign": ["error", { props: true }],
10490
- "no-self-compare": "error",
10491
- "no-sequences": "error",
10492
- "no-shadow-restricted-names": "error",
10493
- "no-sparse-arrays": "error",
10494
- "no-template-curly-in-string": "error",
10495
- "no-this-before-super": "error",
10496
- "no-throw-literal": "error",
10497
- "no-undef": "error",
10498
- "no-undef-init": "error",
10499
- "no-unexpected-multiline": "error",
10500
- "no-unmodified-loop-condition": "error",
10501
- "no-unneeded-ternary": ["error", { defaultAssignment: false }],
10502
- "no-unreachable": "error",
10503
- "no-unreachable-loop": "error",
10504
- "no-unsafe-finally": "error",
10505
- "no-unsafe-negation": "error",
10506
- "no-unused-expressions": [
10507
- "error",
10508
- {
10509
- allowShortCircuit: true,
10510
- allowTaggedTemplates: true,
10511
- allowTernary: true
10512
- }
10513
- ],
10514
- "no-unused-vars": [
10515
- "error",
10516
- {
10517
- args: "none",
10518
- caughtErrors: "none",
10519
- ignoreRestSiblings: true,
10520
- vars: "all"
10521
- }
10522
- ],
10523
- "no-use-before-define": [
10524
- "error",
10525
- { classes: false, functions: false, variables: true }
10526
- ],
10527
- "no-useless-backreference": "error",
10528
- "no-useless-call": "error",
10529
- "no-useless-catch": "error",
10530
- "no-useless-computed-key": "error",
10531
- "no-useless-constructor": "error",
10532
- "no-useless-rename": "error",
10533
- "no-useless-return": "error",
10534
- "no-var": "error",
10535
- "no-with": "error",
10536
- "object-shorthand": [
10537
- "error",
10538
- "always",
10539
- {
10540
- avoidQuotes: true,
10541
- ignoreConstructors: false
10542
- }
10543
- ],
10544
- "one-var": ["error", { initialized: "never" }],
10545
- "prefer-arrow-callback": [
10546
- "error",
10547
- {
10548
- allowNamedFunctions: false,
10549
- allowUnboundThis: true
10550
- }
10551
- ],
10552
- "prefer-const": [
10553
- "error",
10554
- {
10555
- destructuring: "all",
10556
- ignoreReadBeforeAssign: true
10557
- }
10558
- ],
10559
- "prefer-exponentiation-operator": "error",
10560
- "prefer-promise-reject-errors": "error",
10561
- "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
10562
- "prefer-rest-params": "error",
10563
- "prefer-spread": "error",
10564
- "prefer-template": "error",
10565
- "sort-imports": [
10566
- "error",
10567
- {
10568
- allowSeparatedGroups: false,
10569
- ignoreCase: false,
10570
- ignoreDeclarationSort: true,
10571
- ignoreMemberSort: false,
10572
- memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
10573
- }
10574
- ],
10575
- "symbol-description": "error",
10576
- "unicode-bom": ["error", "never"],
10577
- "unused-imports/no-unused-imports": isInEditor2 ? "off" : "error",
10578
- "unused-imports/no-unused-vars": [
10579
- "error",
10580
- {
10581
- args: "after-used",
10582
- argsIgnorePattern: "^_",
10583
- vars: "all",
10584
- varsIgnorePattern: "^_"
10585
- }
10586
- ],
10587
- "use-isnan": [
10588
- "error",
10589
- { enforceForIndexOf: true, enforceForSwitchCase: true }
10590
- ],
10591
- "valid-typeof": ["error", { requireStringLiterals: true }],
10592
- "vars-on-top": "error",
10593
- yoda: ["error", "never"],
10594
- ...overrides
10511
+ Object: {
10512
+ 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",
10513
+ fixWith: "Record<string, unknown>"
10514
+ },
10515
+ object: {
10516
+ message: "The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848",
10517
+ fixWith: "Record<string, unknown>"
10518
+ },
10519
+ Symbol: {
10520
+ message: 'Use "symbol" instead',
10521
+ fixWith: "symbol"
10522
+ },
10523
+ Function: {
10524
+ 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.'
10525
+ },
10526
+ // eslint-disable-next-line @typescript-eslint/naming-convention
10527
+ "{}": {
10528
+ message: "The `{}` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead.",
10529
+ fixWith: "Record<string, unknown>"
10530
+ },
10531
+ // eslint-disable-next-line @typescript-eslint/naming-convention
10532
+ "[]": "Don't use the empty array type `[]`. It only allows empty arrays. Use `SomeType[]` instead.",
10533
+ // eslint-disable-next-line @typescript-eslint/naming-convention
10534
+ "[[]]": "Don't use `[[]]`. It only allows an array with a single element which is an empty array. Use `SomeType[][]` instead.",
10535
+ // eslint-disable-next-line @typescript-eslint/naming-convention
10536
+ "[[[]]]": "Don't use `[[[]]]`. Use `SomeType[][][]` instead."
10537
+ }
10538
+ }
10539
+ ],
10540
+ "@typescript-eslint/consistent-type-assertions": "error",
10541
+ "@typescript-eslint/consistent-type-definitions": ["error", "type"],
10542
+ "@typescript-eslint/member-ordering": [
10543
+ "warn",
10544
+ {
10545
+ default: "never",
10546
+ classes: ["field", "constructor", "method"]
10547
+ }
10548
+ ],
10549
+ "no-array-constructor": "off",
10550
+ "@typescript-eslint/no-array-constructor": "error",
10551
+ "@typescript-eslint/no-explicit-any": "error",
10552
+ "@typescript-eslint/no-misused-new": "error",
10553
+ "@typescript-eslint/no-namespace": [
10554
+ "error",
10555
+ {
10556
+ allowDeclarations: false,
10557
+ allowDefinitionFiles: false
10558
+ }
10559
+ ],
10560
+ "no-unused-vars": "off",
10561
+ "@typescript-eslint/no-unused-vars": [
10562
+ "warn",
10563
+ {
10564
+ vars: "all",
10565
+ args: "none",
10566
+ argsIgnorePattern: "^_",
10567
+ varsIgnorePattern: "^_",
10568
+ caughtErrorsIgnorePattern: "^_"
10595
10569
  }
10596
- },
10597
- {
10598
- files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
10599
- name: "jsse:scripts-overrides",
10600
- rules: {
10601
- "no-console": "off"
10570
+ ],
10571
+ "no-use-before-define": "off",
10572
+ "@typescript-eslint/no-use-before-define": [
10573
+ "error",
10574
+ {
10575
+ functions: true,
10576
+ classes: true,
10577
+ variables: true,
10578
+ enums: true,
10579
+ typedefs: true
10602
10580
  }
10603
- }
10604
- ];
10605
- };
10606
-
10607
- // src/configs/jsdoc.ts
10608
- var jsdoc = async () => {
10609
- return [
10610
- {
10611
- name: "jsse:jsdoc",
10612
- plugins: {
10613
- jsdoc: default6
10614
- },
10615
- rules: {
10616
- "jsdoc/check-access": "warn",
10617
- "jsdoc/check-alignment": "warn",
10618
- "jsdoc/check-param-names": "warn",
10619
- "jsdoc/check-property-names": "warn",
10620
- "jsdoc/check-types": "warn",
10621
- "jsdoc/empty-tags": "warn",
10622
- "jsdoc/implements-on-classes": "warn",
10623
- "jsdoc/multiline-blocks": "warn",
10624
- "jsdoc/no-defaults": "warn",
10625
- "jsdoc/no-multi-asterisks": "warn",
10626
- "jsdoc/require-param-name": "warn",
10627
- "jsdoc/require-property": "warn",
10628
- "jsdoc/require-property-description": "warn",
10629
- "jsdoc/require-property-name": "warn",
10630
- "jsdoc/require-returns-check": "warn",
10631
- "jsdoc/require-returns-description": "warn",
10632
- "jsdoc/require-yields-check": "warn"
10581
+ ],
10582
+ "@typescript-eslint/prefer-namespace-keyword": "warn",
10583
+ "@typescript-eslint/typedef": [
10584
+ "warn",
10585
+ {
10586
+ arrayDestructuring: false,
10587
+ arrowParameter: false,
10588
+ memberVariableDeclaration: true,
10589
+ objectDestructuring: false,
10590
+ parameter: true,
10591
+ propertyDeclaration: true,
10592
+ variableDeclaration: false,
10593
+ variableDeclarationIgnoreFunction: true
10633
10594
  }
10634
- }
10635
- ];
10636
- };
10595
+ ],
10596
+ "accessor-pairs": "error",
10597
+ "for-direction": "warn",
10598
+ "guard-for-in": "error",
10599
+ "max-lines": [
10600
+ "warn",
10601
+ {
10602
+ max: 2e3
10603
+ }
10604
+ ],
10605
+ "no-async-promise-executor": "error",
10606
+ "no-bitwise": [
10607
+ "warn",
10608
+ {
10609
+ allow: ["^", "<<", ">>", ">>>", "^=", "<<=", ">>=", ">>>=", "~"]
10610
+ }
10611
+ ],
10612
+ "no-caller": "error",
10613
+ "no-compare-neg-zero": "error",
10614
+ "no-cond-assign": "error",
10615
+ "no-constant-condition": "warn",
10616
+ "no-control-regex": "error",
10617
+ "no-debugger": "warn",
10618
+ "no-delete-var": "error",
10619
+ "no-duplicate-case": "error",
10620
+ "no-empty": "warn",
10621
+ "no-empty-character-class": "error",
10622
+ "no-empty-pattern": "warn",
10623
+ "no-eval": "warn",
10624
+ "no-ex-assign": "error",
10625
+ "no-extend-native": "error",
10626
+ "no-extra-boolean-cast": "warn",
10627
+ "no-extra-label": "warn",
10628
+ "no-fallthrough": "error",
10629
+ "no-func-assign": "warn",
10630
+ "no-implied-eval": "error",
10631
+ "no-invalid-regexp": "error",
10632
+ "no-label-var": "error",
10633
+ "no-lone-blocks": "warn",
10634
+ "no-misleading-character-class": "error",
10635
+ "no-multi-str": "error",
10636
+ "no-new": "warn",
10637
+ "no-new-func": "error",
10638
+ "no-new-wrappers": "warn",
10639
+ "no-octal": "error",
10640
+ "no-octal-escape": "error",
10641
+ "no-regex-spaces": "error",
10642
+ "no-return-assign": "error",
10643
+ "no-script-url": "warn",
10644
+ "no-self-assign": "error",
10645
+ "no-self-compare": "error",
10646
+ "no-sequences": "error",
10647
+ "no-shadow-restricted-names": "error",
10648
+ "no-sparse-arrays": "error",
10649
+ "no-unmodified-loop-condition": "warn",
10650
+ "no-unsafe-finally": "error",
10651
+ "no-unused-expressions": "off",
10652
+ "@typescript-eslint/no-unused-expressions": "error",
10653
+ "no-unused-labels": "error",
10654
+ "no-useless-catch": "warn",
10655
+ "no-useless-concat": "error",
10656
+ "no-var": "error",
10657
+ "no-void": [
10658
+ "error",
10659
+ {
10660
+ allowAsStatement: true
10661
+ }
10662
+ ],
10663
+ "no-with": "error",
10664
+ "prefer-const": "error",
10665
+ "require-atomic-updates": "error",
10666
+ "require-yield": "warn",
10667
+ strict: ["error", "never"],
10668
+ "use-isnan": "error",
10669
+ "no-useless-constructor": "off",
10670
+ "@typescript-eslint/no-useless-constructor": "error",
10671
+ "@typescript-eslint/no-unnecessary-type-constraint": "error",
10672
+ "@typescript-eslint/brace-style": [
10673
+ "error",
10674
+ "1tbs",
10675
+ {
10676
+ allowSingleLine: false
10677
+ }
10678
+ ],
10679
+ "comma-spacing": "off",
10680
+ "@typescript-eslint/comma-spacing": [
10681
+ "error",
10682
+ {
10683
+ before: false,
10684
+ after: true
10685
+ }
10686
+ ],
10687
+ "default-param-last": "off",
10688
+ "@typescript-eslint/default-param-last": "error",
10689
+ "func-call-spacing": "off",
10690
+ "@typescript-eslint/func-call-spacing": ["error", "never"],
10691
+ "keyword-spacing": "off",
10692
+ "@typescript-eslint/keyword-spacing": "error",
10693
+ "lines-between-class-members": "off",
10694
+ "@typescript-eslint/lines-between-class-members": [
10695
+ "error",
10696
+ "always",
10697
+ {
10698
+ exceptAfterSingleLine: true
10699
+ }
10700
+ ],
10701
+ "no-dupe-class-members": "off",
10702
+ "@typescript-eslint/no-dupe-class-members": "error",
10703
+ "no-empty-function": "off",
10704
+ "@typescript-eslint/no-empty-function": "error",
10705
+ "no-extra-parens": "off",
10706
+ "no-extra-semi": "off",
10707
+ "@typescript-eslint/no-extra-semi": "error",
10708
+ "no-loop-func": "off",
10709
+ "@typescript-eslint/no-loop-func": "error",
10710
+ "no-loss-of-precision": "off",
10711
+ "@typescript-eslint/no-loss-of-precision": "error",
10712
+ "no-redeclare": "off",
10713
+ "@typescript-eslint/no-redeclare": "error",
10714
+ "no-restricted-imports": "off",
10715
+ "@typescript-eslint/no-restricted-imports": [
10716
+ "error",
10717
+ {
10718
+ paths: [
10719
+ "error",
10720
+ "domain",
10721
+ "freelist",
10722
+ "smalloc",
10723
+ "punycode",
10724
+ "sys",
10725
+ "querystring",
10726
+ "colors"
10727
+ ]
10728
+ }
10729
+ ],
10730
+ "padding-line-between-statements": "off",
10731
+ "@typescript-eslint/padding-line-between-statements": "off",
10732
+ quotes: "off",
10733
+ "@typescript-eslint/quotes": "off",
10734
+ "space-before-function-paren": "off",
10735
+ "@typescript-eslint/space-before-function-paren": "off",
10736
+ "space-infix-ops": "off",
10737
+ "@typescript-eslint/space-infix-ops": "error",
10738
+ semi: "off",
10739
+ "@typescript-eslint/semi": ["error", "always"],
10740
+ "space-before-blocks": "off",
10741
+ "@typescript-eslint/space-before-blocks": ["error", "always"],
10742
+ "no-undef": "off",
10743
+ "no-duplicate-imports": "off"
10744
+ };
10745
+ }
10746
+ function typescriptRules(props) {
10747
+ const { typeAware } = props ?? {};
10748
+ if (typeAware === true) {
10749
+ return {
10750
+ ...typescriptRulesTypeOblivious(),
10751
+ ...typescriptRulesTypeAware()
10752
+ };
10753
+ }
10754
+ return typescriptRulesTypeOblivious();
10755
+ }
10637
10756
 
10638
- // src/configs/jsonc.ts
10639
- var jsonc = async (options) => {
10640
- const { overrides = {}, stylistic: stylistic2 = true } = options ?? {};
10641
- const { indent = 2 } = typeof stylistic2 === "boolean" ? {} : stylistic2;
10757
+ // src/configs/markdown.ts
10758
+ var markdown = async (options) => {
10759
+ const { componentExts = [], overrides = {} } = options ?? {};
10760
+ const { pluginMarkdown } = await importPluginMarkdown();
10761
+ const tsRulesOff = Object.fromEntries(
10762
+ // @ts-expect-error - undefined
10763
+ Object.keys(typescriptRulesTypeAware()).map((key) => [
10764
+ `@typescript-eslint/${key}`,
10765
+ "off"
10766
+ ])
10767
+ );
10642
10768
  return [
10643
10769
  {
10644
- name: "jsse:jsonc:setup",
10770
+ name: "jsse:markdown:setup",
10645
10771
  plugins: {
10646
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
10647
- jsonc: pluginJsonc
10772
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10773
+ markdown: pluginMarkdown
10648
10774
  }
10649
10775
  },
10650
10776
  {
10651
- files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
10777
+ files: [GLOB_MARKDOWN],
10778
+ name: "jsse:markdown:processor",
10779
+ processor: "markdown/markdown"
10780
+ },
10781
+ {
10782
+ files: [
10783
+ GLOB_MARKDOWN_CODE,
10784
+ ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
10785
+ ],
10652
10786
  languageOptions: {
10653
- parser: default17
10787
+ parserOptions: {
10788
+ ecmaFeatures: {
10789
+ impliedStrict: true
10790
+ }
10791
+ }
10654
10792
  },
10655
- name: "jsse:jsonc:rules",
10793
+ name: "jsse:markdown:rules",
10656
10794
  rules: {
10657
- "jsonc/no-bigint-literals": "error",
10658
- "jsonc/no-binary-expression": "error",
10659
- "jsonc/no-binary-numeric-literals": "error",
10660
- "jsonc/no-dupe-keys": "error",
10661
- "jsonc/no-escape-sequence-in-identifier": "error",
10662
- "jsonc/no-floating-decimal": "error",
10663
- "jsonc/no-hexadecimal-numeric-literals": "error",
10664
- "jsonc/no-infinity": "error",
10665
- "jsonc/no-multi-str": "error",
10666
- "jsonc/no-nan": "error",
10667
- "jsonc/no-number-props": "error",
10668
- "jsonc/no-numeric-separators": "error",
10669
- "jsonc/no-octal": "error",
10670
- "jsonc/no-octal-escape": "error",
10671
- "jsonc/no-octal-numeric-literals": "error",
10672
- "jsonc/no-parenthesized": "error",
10673
- "jsonc/no-plus-sign": "error",
10674
- "jsonc/no-regexp-literals": "error",
10675
- "jsonc/no-sparse-arrays": "error",
10676
- "jsonc/no-template-literals": "error",
10677
- "jsonc/no-undefined-value": "error",
10678
- "jsonc/no-unicode-codepoint-escapes": "error",
10679
- "jsonc/no-useless-escape": "error",
10680
- "jsonc/space-unary-ops": "error",
10681
- "jsonc/valid-json-number": "error",
10682
- "jsonc/vue-custom-block/no-parsing-error": "error",
10683
- ...stylistic2 ? {
10684
- "jsonc/array-bracket-spacing": ["error", "never"],
10685
- "jsonc/comma-dangle": ["error", "never"],
10686
- "jsonc/comma-style": ["error", "last"],
10687
- "jsonc/indent": ["error", indent],
10688
- "jsonc/key-spacing": [
10689
- "error",
10690
- { afterColon: true, beforeColon: false }
10691
- ],
10692
- "jsonc/object-curly-newline": [
10693
- "error",
10694
- { consistent: true, multiline: true }
10695
- ],
10696
- "jsonc/object-curly-spacing": ["error", "always"],
10697
- "jsonc/object-property-newline": [
10698
- "error",
10699
- { allowMultiplePropertiesPerLine: true }
10700
- ],
10701
- "jsonc/quote-props": "error",
10702
- "jsonc/quotes": "error"
10703
- } : {},
10795
+ "@typescript-eslint/consistent-type-imports": "off",
10796
+ "@typescript-eslint/no-namespace": "off",
10797
+ "@typescript-eslint/no-redeclare": "off",
10798
+ "@typescript-eslint/no-require-imports": "off",
10799
+ "@typescript-eslint/no-unused-vars": "off",
10800
+ "@typescript-eslint/no-use-before-define": "off",
10801
+ "@typescript-eslint/no-var-requires": "off",
10802
+ "no-alert": "off",
10803
+ "no-console": "off",
10804
+ "no-undef": "off",
10805
+ "no-unused-expressions": "off",
10806
+ "no-unused-vars": "off",
10807
+ "node/prefer-global/process": "off",
10808
+ // Type aware rules
10809
+ "object-curly-newline": "off",
10810
+ "style/comma-dangle": "off",
10811
+ "style/eol-last": "off",
10812
+ "unicode-bom": "off",
10813
+ "unused-imports/no-unused-imports": "off",
10814
+ "unused-imports/no-unused-vars": "off",
10815
+ ...tsRulesOff,
10704
10816
  ...overrides
10705
10817
  }
10706
10818
  }
@@ -10714,7 +10826,7 @@ var n = async () => {
10714
10826
  name: "jsse:n",
10715
10827
  plugins: {
10716
10828
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10717
- n: default8
10829
+ n: default4
10718
10830
  },
10719
10831
  rules: {
10720
10832
  "n/handle-callback-err": ["error", "^(err|error)$"],
@@ -10737,7 +10849,7 @@ var perfectionist = async () => {
10737
10849
  name: "jsse:perfectionist",
10738
10850
  plugins: {
10739
10851
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10740
- perfectionist: default10
10852
+ perfectionist: default5
10741
10853
  }
10742
10854
  }
10743
10855
  ];
@@ -10868,7 +10980,7 @@ var prettier = async () => {
10868
10980
  };
10869
10981
 
10870
10982
  // src/configs/ts/typescript-language-options.ts
10871
- import process3 from "process";
10983
+ import process4 from "process";
10872
10984
  function typescriptLanguageOptions(options) {
10873
10985
  const {
10874
10986
  componentExts = [],
@@ -10878,7 +10990,7 @@ function typescriptLanguageOptions(options) {
10878
10990
  } = options || {};
10879
10991
  const tsOptions = tsconfig ? {
10880
10992
  project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
10881
- tsconfigRootDir: process3.cwd()
10993
+ tsconfigRootDir: process4.cwd()
10882
10994
  } : {};
10883
10995
  const parserOptions = {
10884
10996
  ecmaFeatures: react2 ? { jsx: true, modules: true } : void 0,
@@ -11064,20 +11176,18 @@ function reactRules() {
11064
11176
  "react/void-dom-elements-no-children": "error"
11065
11177
  };
11066
11178
  }
11067
- function reactRefreshFlatConfigs() {
11179
+ function reactRefreshFlatConfigRules() {
11068
11180
  return [
11069
11181
  {
11070
11182
  files: [GLOB_SRC],
11071
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11072
- plugins: { "react-refresh": pluginReactRefresh },
11183
+ name: "jsse:react:refresh",
11073
11184
  rules: {
11074
11185
  "react-refresh/only-export-components": "error"
11075
11186
  }
11076
11187
  },
11077
11188
  {
11078
11189
  files: ["**/*.stories.tsx"],
11079
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11080
- plugins: { "react-refresh": pluginReactRefresh },
11190
+ name: "jsse:react:refresh:stories",
11081
11191
  rules: {
11082
11192
  "react-refresh/only-export-components": "off"
11083
11193
  }
@@ -11119,6 +11229,8 @@ var react = async (options) => {
11119
11229
  reactRefresh,
11120
11230
  tsconfig
11121
11231
  } = options ?? {};
11232
+ const reactPlugins = await importReactPlugins();
11233
+ const { pluginReact, pluginReactHooks, pluginReactRefresh } = reactPlugins;
11122
11234
  const config = [
11123
11235
  {
11124
11236
  files: [GLOB_SRC],
@@ -11131,9 +11243,11 @@ var react = async (options) => {
11131
11243
  name: "jsse:react:setup",
11132
11244
  plugins: {
11133
11245
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11134
- react: default11,
11246
+ react: pluginReact,
11135
11247
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11136
- "react-hooks": default12
11248
+ "react-hooks": pluginReactHooks,
11249
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11250
+ "react-refresh": pluginReactRefresh
11137
11251
  }
11138
11252
  },
11139
11253
  {
@@ -11142,7 +11256,7 @@ var react = async (options) => {
11142
11256
  rules: {
11143
11257
  ...reactRecomendedRules(),
11144
11258
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
11145
- ...default11.configs["jsx-runtime"].rules,
11259
+ ...pluginReact.configs["jsx-runtime"].rules,
11146
11260
  ...reactRules()
11147
11261
  },
11148
11262
  settings: {
@@ -11153,74 +11267,17 @@ var react = async (options) => {
11153
11267
  }
11154
11268
  ];
11155
11269
  if (reactRefresh) {
11156
- config.push(...reactRefreshFlatConfigs());
11270
+ config.push(...reactRefreshFlatConfigRules());
11157
11271
  }
11158
11272
  return config;
11159
11273
  };
11160
11274
 
11161
- // src/configs/stylistic.ts
11162
- function jsxStylistic({
11163
- indent
11164
- }) {
11165
- return {
11166
- "@stylistic/jsx-curly-brace-presence": [
11167
- "error",
11168
- { propElementValues: "always" }
11169
- ],
11170
- "@stylistic/jsx-indent": [
11171
- "error",
11172
- indent,
11173
- { checkAttributes: true, indentLogicalExpressions: true }
11174
- ],
11175
- "@stylistic/jsx-quotes": "error"
11176
- };
11177
- }
11178
- var stylistic = async (options) => {
11179
- const { indent = 2, jsx = true, quotes = "double" } = options ?? {};
11180
- return [
11181
- {
11182
- name: "jsse:stylistic",
11183
- plugins: {
11184
- // eslint-disable-next-line @typescript-eslint/naming-convention
11185
- "@stylistic": default2
11186
- },
11187
- rules: {
11188
- "@stylistic/quote-props": ["error", "as-needed"],
11189
- "@stylistic/quotes": [
11190
- "error",
11191
- quotes,
11192
- { allowTemplateLiterals: false, avoidEscape: true }
11193
- ],
11194
- ...jsx ? jsxStylistic({ indent }) : {}
11195
- }
11196
- }
11197
- ];
11198
- };
11199
-
11200
- // src/configs/tailwind.ts
11201
- var tailwind = async () => {
11202
- return [
11203
- {
11204
- name: "jsse:tailwind",
11205
- plugins: {
11206
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11207
- tailwindcss: default13
11208
- },
11209
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11210
- rules: {
11211
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
11212
- ...default13.configs.recommended.rules
11213
- }
11214
- }
11215
- ];
11216
- };
11217
-
11218
- // src/configs/sort.ts
11275
+ // src/configs/sort-package-json.ts
11219
11276
  var sortPackageJson = async () => {
11220
11277
  return [
11221
11278
  {
11222
11279
  files: ["**/package.json"],
11223
- name: "jsse:sort-package-json",
11280
+ name: "jsse:sort:package-json",
11224
11281
  rules: {
11225
11282
  "jsonc/sort-array-values": [
11226
11283
  "error",
@@ -11300,11 +11357,13 @@ var sortPackageJson = async () => {
11300
11357
  }
11301
11358
  ];
11302
11359
  };
11360
+
11361
+ // src/configs/sort-tsconfig.ts
11303
11362
  var sortTsconfig = async () => {
11304
11363
  return [
11305
11364
  {
11306
11365
  files: ["**/tsconfig.json", "**/tsconfig.*.json"],
11307
- name: "jsse:sort-tsconfig",
11366
+ name: "jsse:sort:tsconfig",
11308
11367
  rules: {
11309
11368
  "jsonc/sort-keys": [
11310
11369
  "error",
@@ -11426,67 +11485,111 @@ var sortTsconfig = async () => {
11426
11485
  ];
11427
11486
  };
11428
11487
 
11429
- // src/utils.ts
11430
- import process4 from "process";
11431
- async function combine(...configs) {
11432
- const resolved = await Promise.all(configs);
11433
- return resolved.flat();
11434
- }
11435
- async function combineAsync(...configs) {
11436
- const resolved = await Promise.all(configs);
11437
- return resolved.flatMap(
11438
- (config) => Array.isArray(config) ? config : [config]
11439
- );
11488
+ // src/configs/stylistic.ts
11489
+ function jsxStylistic({
11490
+ indent
11491
+ }) {
11492
+ return {
11493
+ "@stylistic/jsx-curly-brace-presence": [
11494
+ "error",
11495
+ { propElementValues: "always" }
11496
+ ],
11497
+ "@stylistic/jsx-indent": [
11498
+ "error",
11499
+ indent,
11500
+ { checkAttributes: true, indentLogicalExpressions: true }
11501
+ ],
11502
+ "@stylistic/jsx-quotes": "error"
11503
+ };
11440
11504
  }
11441
- function renameRules(rules, from, to) {
11442
- if (from === to) {
11443
- return rules;
11444
- }
11445
- return Object.fromEntries(
11446
- Object.entries(rules).map(([key, value]) => {
11447
- if (key.startsWith(from)) {
11448
- return [to + key.slice(from.length), value];
11505
+ var stylistic = async (options) => {
11506
+ const { indent = 2, jsx = true, quotes = "double" } = options ?? {};
11507
+ const { pluginStylistic } = await importPluginStylistic();
11508
+ return [
11509
+ {
11510
+ name: "jsse:stylistic",
11511
+ plugins: {
11512
+ // eslint-disable-next-line @typescript-eslint/naming-convention
11513
+ "@stylistic": pluginStylistic
11514
+ },
11515
+ rules: {
11516
+ "@stylistic/quote-props": ["error", "as-needed"],
11517
+ "@stylistic/quotes": [
11518
+ "error",
11519
+ quotes,
11520
+ { allowTemplateLiterals: false, avoidEscape: true }
11521
+ ],
11522
+ ...jsx ? jsxStylistic({ indent }) : {}
11449
11523
  }
11450
- return [key, value];
11451
- })
11452
- );
11453
- }
11454
- async function interopDefault2(m) {
11455
- const resolved = await m;
11456
- return resolved.default || resolved;
11457
- }
11458
- function isCI() {
11459
- return !!process4.env.CI;
11460
- }
11461
- function isInEditor() {
11462
- return !!((process4.env.VSCODE_PID || process4.env.JETBRAINS_IDE) && !isCI());
11524
+ }
11525
+ ];
11526
+ };
11527
+
11528
+ // src/configs/tailwind.ts
11529
+ var TAILWIND_ESLINT_SETTINGS_DEFAULT = {
11530
+ // These are the default values but feel free to customize
11531
+ callees: ["classnames", "clsx", "ctl", "cn", "cx", "twMerge", "twJoin"],
11532
+ classRegex: "^class(Name)?$",
11533
+ // can be modified to support custom attributes. E.g. "^tw$" for `twin.macro`
11534
+ config: "tailwind.config.js",
11535
+ // returned from `loadConfig()` utility if not provided
11536
+ cssFiles: ["**/*.css", "!**/node_modules", "!**/.*", "!**/dist", "!**/build"],
11537
+ cssFilesRefreshRate: 5e3,
11538
+ removeDuplicates: true,
11539
+ skipClassAttribute: false,
11540
+ tags: [],
11541
+ // can be set to e.g. ['tw'] for use in tw`bg-blue`
11542
+ whitelist: []
11543
+ };
11544
+ function tailwindSettings(options) {
11545
+ if (typeof options === "boolean") {
11546
+ return TAILWIND_ESLINT_SETTINGS_DEFAULT;
11547
+ }
11548
+ return { ...TAILWIND_ESLINT_SETTINGS_DEFAULT, ...options };
11463
11549
  }
11550
+ var tailwind = async (options) => {
11551
+ const { pluginTailwind } = await importPluginTailwind();
11552
+ return [
11553
+ {
11554
+ files: [GLOB_SRC],
11555
+ name: "jsse:tailwind:rules",
11556
+ plugins: {
11557
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11558
+ tailwindcss: pluginTailwind
11559
+ },
11560
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11561
+ rules: {
11562
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
11563
+ ...pluginTailwind.configs.recommended.rules
11564
+ },
11565
+ settings: {
11566
+ tailwindcss: tailwindSettings(options)
11567
+ }
11568
+ }
11569
+ ];
11570
+ };
11464
11571
 
11465
11572
  // src/configs/test.ts
11466
- var test = async (options = {}) => {
11573
+ var noOnlyTests = async (options = {}) => {
11467
11574
  const { isInEditor: isInEditor2 = false, overrides = {} } = options;
11575
+ const pluginNoOnlyTests = await interopDefault2(
11576
+ // @ts-expect-error - types are incorrect/missing
11577
+ import("eslint-plugin-no-only-tests")
11578
+ );
11468
11579
  return [
11469
11580
  {
11470
- name: "jsse:test:setup",
11581
+ name: "jsse:no-only-tests:setup",
11471
11582
  plugins: {
11472
11583
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11473
- "no-only-tests": default9,
11474
- vitest: default16
11584
+ "no-only-tests": pluginNoOnlyTests
11475
11585
  }
11476
11586
  },
11477
11587
  {
11478
11588
  files: GLOB_TESTS,
11479
- name: "jsse:test:rules",
11589
+ name: "jsse:no-only-tests:rules",
11480
11590
  rules: {
11481
11591
  "no-only-tests/no-only-tests": isInEditor2 ? "off" : isCI() ? "error" : "warn",
11482
11592
  "unicorn/no-null": "off",
11483
- "vitest/consistent-test-it": [
11484
- "error",
11485
- { fn: "test", withinDescribe: "test" }
11486
- ],
11487
- "vitest/no-identical-title": "error",
11488
- "vitest/prefer-hooks-in-order": "error",
11489
- "vitest/prefer-lowercase-title": "error",
11490
11593
  ...overrides
11491
11594
  }
11492
11595
  }
@@ -11508,9 +11611,9 @@ var typescript = async (options) => {
11508
11611
  const tsPrefixTo = prefix?.to ?? "@typescript-eslint";
11509
11612
  const tsrules = {
11510
11613
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11511
- ...default3.configs["eslint-recommended"].overrides[0].rules,
11614
+ ...default8.configs["eslint-recommended"].overrides[0].rules,
11512
11615
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11513
- ...default3.configs.strict.rules,
11616
+ ...default8.configs.strict.rules,
11514
11617
  "no-invalid-this": "off",
11515
11618
  ...typescriptRules(
11516
11619
  typeAware !== false && tsconfigPath ? { typeAware: true } : { typeAware: false }
@@ -11523,7 +11626,7 @@ var typescript = async (options) => {
11523
11626
  name: "jsse:typescript:setup",
11524
11627
  plugins: {
11525
11628
  import: pluginImport,
11526
- [tsPrefixTo]: default3
11629
+ [tsPrefixTo]: default8
11527
11630
  }
11528
11631
  },
11529
11632
  // ...tseslint.configs.recommended,
@@ -11589,7 +11692,7 @@ function unicornOff() {
11589
11692
  };
11590
11693
  }
11591
11694
  function unicornRecommended() {
11592
- return default14.configs.recommended.rules;
11695
+ return default6.configs.recommended.rules;
11593
11696
  }
11594
11697
  var unicorn = async () => {
11595
11698
  return [
@@ -11597,7 +11700,7 @@ var unicorn = async () => {
11597
11700
  name: "jsse:unicorn",
11598
11701
  plugins: {
11599
11702
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11600
- unicorn: default14
11703
+ unicorn: default6
11601
11704
  },
11602
11705
  rules: {
11603
11706
  ...unicornRecommended(),
@@ -11671,6 +11774,42 @@ var unicorn = async () => {
11671
11774
  // Use new when throwing error
11672
11775
  "unicorn/throw-new-error": "error"
11673
11776
  }
11777
+ },
11778
+ {
11779
+ files: GLOB_TESTS,
11780
+ name: "jsse:unicorn:tests",
11781
+ rules: {
11782
+ "unicorn/no-null": "off",
11783
+ "unicorn/no-unused-properties": "off"
11784
+ }
11785
+ }
11786
+ ];
11787
+ };
11788
+
11789
+ // src/configs/vitest.ts
11790
+ var vitest = async (options = {}) => {
11791
+ const { overrides = {} } = options;
11792
+ const pluginVitest = await interopDefault2(import("eslint-plugin-vitest"));
11793
+ return [
11794
+ {
11795
+ name: "jsse:vitest:setup",
11796
+ plugins: {
11797
+ vitest: pluginVitest
11798
+ }
11799
+ },
11800
+ {
11801
+ files: GLOB_TESTS,
11802
+ name: "jsse:vitest:rules",
11803
+ rules: {
11804
+ "vitest/consistent-test-it": [
11805
+ "error",
11806
+ { fn: "test", withinDescribe: "test" }
11807
+ ],
11808
+ "vitest/no-identical-title": "error",
11809
+ "vitest/prefer-hooks-in-order": "error",
11810
+ "vitest/prefer-lowercase-title": "error",
11811
+ ...overrides
11812
+ }
11674
11813
  }
11675
11814
  ];
11676
11815
  };
@@ -11818,7 +11957,7 @@ async function jsse(options = {}, ...userConfigs) {
11818
11957
  const configs = [];
11819
11958
  if (enableGitignore) {
11820
11959
  if (typeof enableGitignore === "boolean") {
11821
- if (fs2.existsSync(".gitignore"))
11960
+ if (fs2.existsSync(".gitignore")) {
11822
11961
  configs.push(
11823
11962
  interopDefault2(import("eslint-config-flat-gitignore")).then((r2) => {
11824
11963
  const res = r2();
@@ -11826,6 +11965,7 @@ async function jsse(options = {}, ...userConfigs) {
11826
11965
  return [res];
11827
11966
  })
11828
11967
  );
11968
+ }
11829
11969
  } else {
11830
11970
  configs.push(
11831
11971
  interopDefault2(import("eslint-config-flat-gitignore")).then((r2) => {
@@ -11891,7 +12031,11 @@ async function jsse(options = {}, ...userConfigs) {
11891
12031
  }
11892
12032
  if (normalizedOptions.test) {
11893
12033
  configs.push(
11894
- test({
12034
+ vitest({
12035
+ isInEditor: isInEditor2,
12036
+ overrides: overrides.test
12037
+ }),
12038
+ noOnlyTests({
11895
12039
  isInEditor: isInEditor2,
11896
12040
  overrides: overrides.test
11897
12041
  })
@@ -11908,7 +12052,15 @@ async function jsse(options = {}, ...userConfigs) {
11908
12052
  );
11909
12053
  }
11910
12054
  if (normalizedOptions.tailwind) {
11911
- configs.push(tailwind());
12055
+ try {
12056
+ configs.push(
12057
+ tailwind(
12058
+ normalizedOptions.tailwind === true ? {} : normalizedOptions.tailwind
12059
+ )
12060
+ );
12061
+ } catch (e) {
12062
+ log.error("Tailwind config failed", e);
12063
+ }
11912
12064
  }
11913
12065
  const fusedConfig = flatConfigProps.reduce((acc, key) => {
11914
12066
  if (key in options) {
@@ -12006,39 +12158,41 @@ export {
12006
12158
  GLOB_SRC_EXT,
12007
12159
  GLOB_STYLE,
12008
12160
  GLOB_TESTS,
12161
+ GLOB_TOML,
12009
12162
  GLOB_TS,
12010
12163
  GLOB_TSX,
12011
12164
  GLOB_YAML,
12012
12165
  combine,
12013
12166
  combineAsync,
12014
12167
  jsse as default,
12168
+ importJsoncLibs,
12169
+ importParserJsonc,
12170
+ importPluginJsdoc,
12171
+ importPluginJsonc,
12172
+ importPluginMarkdown,
12173
+ importPluginReact,
12174
+ importPluginReactHooks,
12175
+ importPluginReactRefresh,
12176
+ importPluginStylistic,
12177
+ importPluginTailwind,
12178
+ importReactPlugins,
12179
+ importYmlLibs,
12015
12180
  interopDefault2 as interopDefault,
12016
12181
  isCI,
12017
12182
  isInEditor,
12018
12183
  jsse,
12019
12184
  jsseReact,
12020
12185
  jssestd,
12021
- default17 as parserJsonc,
12022
12186
  parserTs,
12023
- default4 as pluginAntfu,
12024
- default5 as pluginEslintComments,
12187
+ default2 as pluginAntfu,
12188
+ default3 as pluginEslintComments,
12025
12189
  pluginImport,
12026
- default6 as pluginJsdoc,
12027
- pluginJsonc,
12028
- default7 as pluginMarkdown,
12029
- default8 as pluginN,
12030
- default9 as pluginNoOnlyTests,
12031
- default10 as pluginPerfectionist,
12032
- default11 as pluginReact,
12033
- default12 as pluginReactHooks,
12034
- pluginReactRefresh,
12190
+ default4 as pluginN,
12191
+ default5 as pluginPerfectionist,
12035
12192
  pluginSortKeys,
12036
- default2 as pluginStylistic,
12037
- default13 as pluginTailwind,
12038
- default3 as pluginTs,
12039
- default14 as pluginUnicorn,
12040
- default15 as pluginUnusedImports,
12041
- default16 as pluginVitest,
12193
+ default8 as pluginTs,
12194
+ default6 as pluginUnicorn,
12195
+ default7 as pluginUnusedImports,
12042
12196
  renameRules
12043
12197
  };
12044
12198
  /*! Bundled license information: