@jsse/eslint-config 0.1.7 → 0.1.9

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
@@ -9685,6 +9685,7 @@ var GLOB_SCSS = "**/*.scss";
9685
9685
  var GLOB_JSON = "**/*.json";
9686
9686
  var GLOB_JSON5 = "**/*.json5";
9687
9687
  var GLOB_JSONC = "**/*.jsonc";
9688
+ var GLOB_TOML = "**/*.toml";
9688
9689
  var GLOB_MARKDOWN = "**/*.md";
9689
9690
  var GLOB_YAML = "**/*.y?(a)ml";
9690
9691
  var GLOB_HTML = "**/*.htm?(l)";
@@ -9778,12 +9779,12 @@ function isInEditor() {
9778
9779
  // src/plugins.ts
9779
9780
  var pluginSortKeys = __toESM(require_eslint_plugin_sort_keys(), 1);
9780
9781
  import { default as default2 } from "eslint-plugin-antfu";
9782
+ import { default as default3 } from "eslint-plugin-eslint-comments";
9781
9783
  import * as pluginImport from "eslint-plugin-import-x";
9782
- import { default as default3 } from "eslint-plugin-n";
9783
- import { default as default4 } from "eslint-plugin-unicorn";
9784
- import { default as default5 } from "eslint-plugin-unused-imports";
9785
- import { default as default6 } from "eslint-plugin-perfectionist";
9786
- import { default as default7 } from "eslint-plugin-eslint-comments";
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";
9787
9788
  import { default as default8 } from "@typescript-eslint/eslint-plugin";
9788
9789
  import * as parserTs from "@typescript-eslint/parser";
9789
9790
  async function importPluginReact() {
@@ -9902,915 +9903,932 @@ var antfu = async () => {
9902
9903
  ];
9903
9904
  };
9904
9905
 
9905
- // src/configs/ts/typescript-rules.ts
9906
- function typescriptRulesTypeAware() {
9907
- return {
9908
- "@typescript-eslint/await-thenable": "error",
9909
- "@typescript-eslint/no-for-in-array": "error",
9910
- "no-implied-eval": "off",
9911
- "@typescript-eslint/consistent-type-exports": [
9912
- "error",
9913
- {
9914
- fixMixedExportsWithInlineTypeSpecifier: true
9915
- }
9916
- ],
9917
- "dot-notation": "off",
9918
- "@typescript-eslint/dot-notation": [
9919
- "error",
9920
- {
9921
- allowPattern: "^_",
9922
- allowKeywords: true
9923
- }
9924
- ],
9925
- "@typescript-eslint/no-implied-eval": "error",
9926
- "@typescript-eslint/no-misused-promises": "error",
9927
- "@typescript-eslint/no-unnecessary-qualifier": "error",
9928
- "@typescript-eslint/no-unnecessary-type-arguments": "off",
9929
- "@typescript-eslint/no-unnecessary-type-assertion": "error",
9930
- "@typescript-eslint/no-useless-template-literals": "error",
9931
- "no-throw-literal": "off",
9932
- "@typescript-eslint/no-throw-literal": "error",
9933
- "@typescript-eslint/no-unsafe-argument": "error",
9934
- "@typescript-eslint/no-unsafe-assignment": "error",
9935
- "@typescript-eslint/no-unsafe-call": "error",
9936
- "@typescript-eslint/no-unsafe-member-access": "error",
9937
- "@typescript-eslint/no-unsafe-return": "error",
9938
- "@typescript-eslint/restrict-plus-operands": "error",
9939
- "@typescript-eslint/restrict-template-expressions": "error",
9940
- "@typescript-eslint/unbound-method": "error",
9941
- "@typescript-eslint/naming-convention": [
9942
- "error",
9943
- {
9944
- selector: ["variable"],
9945
- modifiers: ["global"],
9946
- format: ["camelCase", "snake_case", "UPPER_CASE", "PascalCase"],
9947
- leadingUnderscore: "allowSingleOrDouble",
9948
- trailingUnderscore: "allow",
9949
- filter: {
9950
- regex: "[- ]",
9951
- match: false
9952
- }
9953
- },
9954
- {
9955
- selector: [
9956
- "classProperty",
9957
- "objectLiteralProperty",
9958
- "typeProperty",
9959
- "classMethod",
9960
- "objectLiteralMethod",
9961
- "typeMethod",
9962
- "accessor",
9963
- "enumMember"
9964
- ],
9965
- // eslint-disable-next-line unicorn/no-null
9966
- format: null,
9967
- modifiers: ["requiresQuotes"]
9968
- },
9969
- {
9970
- selector: [
9971
- "variable",
9972
- "function",
9973
- "classProperty",
9974
- "objectLiteralProperty",
9975
- "parameterProperty",
9976
- "classMethod",
9977
- "objectLiteralMethod",
9978
- "typeMethod",
9979
- "accessor"
9980
- ],
9981
- format: ["camelCase", "snake_case", "PascalCase"],
9982
- leadingUnderscore: "allowSingleOrDouble",
9983
- trailingUnderscore: "allow",
9984
- filter: {
9985
- // also allow when '/' is in object key
9986
- regex: "^[0-9]|[- ]|[/]",
9987
- match: false
9988
- }
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"
9919
+ }
9920
+ }
9921
+ ];
9922
+
9923
+ // src/configs/ignores.ts
9924
+ var ignores = async () => {
9925
+ return [
9926
+ {
9927
+ ignores: GLOB_EXCLUDE
9928
+ }
9929
+ ];
9930
+ };
9931
+
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
9989
9940
  },
9990
- {
9991
- selector: "typeLike",
9992
- 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"
9993
9989
  },
9994
- {
9995
- selector: "variable",
9996
- types: ["boolean"],
9997
- format: ["PascalCase", "camelCase"],
9998
- prefix: ["is", "has", "can", "should", "will", "did"]
9990
+ linterOptions: {
9991
+ reportUnusedDisableDirectives
9999
9992
  },
10000
- {
10001
- selector: "interface",
10002
- format: ["PascalCase"]
9993
+ name: "jsse:javascript",
9994
+ plugins: {
9995
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
9996
+ "unused-imports": default7
10003
9997
  },
10004
- {
10005
- selector: "typeParameter",
10006
- filter: "^T$|^[A-Z][a-zA-Z]+$",
10007
- format: ["PascalCase"]
10008
- }
10009
- ],
10010
- "@typescript-eslint/no-floating-promises": [
10011
- "error",
10012
- {
10013
- ignoreVoid: true,
10014
- ignoreIIFE: true
10015
- }
10016
- ]
10017
- };
10018
- }
10019
- function typescriptRulesTypeOblivious() {
10020
- return {
10021
- eqeqeq: "error",
10022
- camelcase: "off",
10023
- yoda: "error",
10024
- "arrow-parens": "off",
10025
- "no-console": [
10026
- "warn",
10027
- {
10028
- allow: [
10029
- "log",
10030
- "warn",
10031
- "dir",
10032
- "time",
10033
- "timeEnd",
10034
- "timeLog",
10035
- "trace",
10036
- "assert",
10037
- "clear",
10038
- "count",
10039
- "countReset",
10040
- "group",
10041
- "groupEnd",
10042
- "table",
10043
- "debug",
10044
- "info",
10045
- "dirxml",
9998
+ rules: {
9999
+ ...eslintjs.configs.recommended.rules,
10000
+ "accessor-pairs": [
10046
10001
  "error",
10047
- "groupCollapsed",
10048
- "Console",
10049
- "profile",
10050
- "profileEnd",
10051
- "timeStamp",
10052
- "context"
10053
- ]
10054
- }
10055
- ],
10056
- "object-curly-spacing": "off",
10057
- "@typescript-eslint/object-curly-spacing": "off",
10058
- "@typescript-eslint/no-inferrable-types": "off",
10059
- "@typescript-eslint/prefer-ts-expect-error": "error",
10060
- "@typescript-eslint/consistent-type-imports": [
10061
- "error",
10062
- {
10063
- prefer: "type-imports",
10064
- fixStyle: "separate-type-imports"
10065
- }
10066
- ],
10067
- "@typescript-eslint/adjacent-overload-signatures": "error",
10068
- "@typescript-eslint/ban-types": [
10069
- "warn",
10070
- {
10071
- extendDefaults: false,
10072
- types: {
10073
- String: {
10074
- message: 'Use "string" instead',
10075
- fixWith: "string"
10076
- },
10077
- Boolean: {
10078
- message: 'Use "boolean" instead',
10079
- fixWith: "boolean"
10080
- },
10081
- Number: {
10082
- message: 'Use "number" instead',
10083
- fixWith: "number"
10084
- },
10085
- BigInt: {
10086
- message: "Use `bigint` instead.",
10087
- fixWith: "bigint"
10088
- },
10089
- Object: {
10090
- 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",
10091
- fixWith: "Record<string, unknown>"
10092
- },
10093
- object: {
10094
- message: "The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848",
10095
- fixWith: "Record<string, unknown>"
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__"
10096
10077
  },
10097
- Symbol: {
10098
- message: 'Use "symbol" instead',
10099
- fixWith: "symbol"
10078
+ {
10079
+ message: "Use `Object.defineProperty` instead.",
10080
+ property: "__defineGetter__"
10100
10081
  },
10101
- Function: {
10102
- 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.'
10082
+ {
10083
+ message: "Use `Object.defineProperty` instead.",
10084
+ property: "__defineSetter__"
10103
10085
  },
10104
- // eslint-disable-next-line @typescript-eslint/naming-convention
10105
- "{}": {
10106
- message: "The `{}` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead.",
10107
- fixWith: "Record<string, unknown>"
10086
+ {
10087
+ message: "Use `Object.getOwnPropertyDescriptor` instead.",
10088
+ property: "__lookupGetter__"
10108
10089
  },
10109
- // eslint-disable-next-line @typescript-eslint/naming-convention
10110
- "[]": "Don't use the empty array type `[]`. It only allows empty arrays. Use `SomeType[]` instead.",
10111
- // eslint-disable-next-line @typescript-eslint/naming-convention
10112
- "[[]]": "Don't use `[[]]`. It only allows an array with a single element which is an empty array. Use `SomeType[][]` instead.",
10113
- // eslint-disable-next-line @typescript-eslint/naming-convention
10114
- "[[[]]]": "Don't use `[[[]]]`. Use `SomeType[][][]` instead."
10115
- }
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": [
10129
+ "error",
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
10116
10209
  }
10117
- ],
10118
- "@typescript-eslint/consistent-type-assertions": "error",
10119
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
10120
- "@typescript-eslint/member-ordering": [
10121
- "warn",
10122
- {
10123
- default: "never",
10124
- classes: ["field", "constructor", "method"]
10210
+ },
10211
+ {
10212
+ files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
10213
+ name: "jsse:scripts-overrides",
10214
+ rules: {
10215
+ "no-console": "off"
10125
10216
  }
10126
- ],
10127
- "no-array-constructor": "off",
10128
- "@typescript-eslint/no-array-constructor": "error",
10129
- "@typescript-eslint/no-explicit-any": "error",
10130
- "@typescript-eslint/no-misused-new": "error",
10131
- "@typescript-eslint/no-namespace": [
10217
+ }
10218
+ ];
10219
+ };
10220
+
10221
+ // src/configs/jsdoc.ts
10222
+ var jsdoc = async () => {
10223
+ const { pluginJsdoc } = await importPluginJsdoc();
10224
+ return [
10225
+ {
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
+ }
10249
+ }
10250
+ ];
10251
+ };
10252
+
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();
10258
+ return [
10259
+ {
10260
+ name: "jsse:jsonc:setup",
10261
+ plugins: {
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
10271
+ },
10272
+ name: "jsse:jsonc:rules",
10273
+ rules: {
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",
10300
+ ...stylistic2 ? {
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": [
10306
+ "error",
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
10322
+ }
10323
+ }
10324
+ ];
10325
+ };
10326
+
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": [
10132
10334
  "error",
10133
10335
  {
10134
- allowDeclarations: false,
10135
- allowDefinitionFiles: false
10336
+ fixMixedExportsWithInlineTypeSpecifier: true
10136
10337
  }
10137
10338
  ],
10138
- "no-unused-vars": "off",
10139
- "@typescript-eslint/no-unused-vars": [
10140
- "warn",
10339
+ "dot-notation": "off",
10340
+ "@typescript-eslint/dot-notation": [
10341
+ "error",
10141
10342
  {
10142
- vars: "all",
10143
- args: "none",
10144
- argsIgnorePattern: "^_",
10145
- varsIgnorePattern: "^_",
10146
- caughtErrorsIgnorePattern: "^_"
10343
+ allowPattern: "^_",
10344
+ allowKeywords: true
10147
10345
  }
10148
10346
  ],
10149
- "no-use-before-define": "off",
10150
- "@typescript-eslint/no-use-before-define": [
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": [
10151
10364
  "error",
10152
10365
  {
10153
- functions: true,
10154
- classes: true,
10155
- variables: true,
10156
- enums: true,
10157
- typedefs: true
10158
- }
10159
- ],
10160
- "@typescript-eslint/prefer-namespace-keyword": "warn",
10161
- "@typescript-eslint/typedef": [
10162
- "warn",
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
+ }
10375
+ },
10163
10376
  {
10164
- arrayDestructuring: false,
10165
- arrowParameter: false,
10166
- memberVariableDeclaration: true,
10167
- objectDestructuring: false,
10168
- parameter: true,
10169
- propertyDeclaration: true,
10170
- variableDeclaration: false,
10171
- variableDeclarationIgnoreFunction: true
10172
- }
10173
- ],
10174
- "accessor-pairs": "error",
10175
- "for-direction": "warn",
10176
- "guard-for-in": "error",
10177
- "max-lines": [
10178
- "warn",
10377
+ selector: [
10378
+ "classProperty",
10379
+ "objectLiteralProperty",
10380
+ "typeProperty",
10381
+ "classMethod",
10382
+ "objectLiteralMethod",
10383
+ "typeMethod",
10384
+ "accessor",
10385
+ "enumMember"
10386
+ ],
10387
+ // eslint-disable-next-line unicorn/no-null
10388
+ format: null,
10389
+ modifiers: ["requiresQuotes"]
10390
+ },
10179
10391
  {
10180
- max: 2e3
10392
+ selector: [
10393
+ "variable",
10394
+ "function",
10395
+ "classProperty",
10396
+ "objectLiteralProperty",
10397
+ "parameterProperty",
10398
+ "classMethod",
10399
+ "objectLiteralMethod",
10400
+ "typeMethod",
10401
+ "accessor"
10402
+ ],
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"]
10181
10430
  }
10182
10431
  ],
10183
- "no-async-promise-executor": "error",
10184
- "no-bitwise": [
10185
- "warn",
10432
+ "@typescript-eslint/no-floating-promises": [
10433
+ "error",
10186
10434
  {
10187
- allow: ["^", "<<", ">>", ">>>", "^=", "<<=", ">>=", ">>>=", "~"]
10435
+ ignoreVoid: true,
10436
+ ignoreIIFE: true
10188
10437
  }
10189
- ],
10190
- "no-caller": "error",
10191
- "no-compare-neg-zero": "error",
10192
- "no-cond-assign": "error",
10193
- "no-constant-condition": "warn",
10194
- "no-control-regex": "error",
10195
- "no-debugger": "warn",
10196
- "no-delete-var": "error",
10197
- "no-duplicate-case": "error",
10198
- "no-empty": "warn",
10199
- "no-empty-character-class": "error",
10200
- "no-empty-pattern": "warn",
10201
- "no-eval": "warn",
10202
- "no-ex-assign": "error",
10203
- "no-extend-native": "error",
10204
- "no-extra-boolean-cast": "warn",
10205
- "no-extra-label": "warn",
10206
- "no-fallthrough": "error",
10207
- "no-func-assign": "warn",
10208
- "no-implied-eval": "error",
10209
- "no-invalid-regexp": "error",
10210
- "no-label-var": "error",
10211
- "no-lone-blocks": "warn",
10212
- "no-misleading-character-class": "error",
10213
- "no-multi-str": "error",
10214
- "no-new": "warn",
10215
- "no-new-func": "error",
10216
- "no-new-wrappers": "warn",
10217
- "no-octal": "error",
10218
- "no-octal-escape": "error",
10219
- "no-regex-spaces": "error",
10220
- "no-return-assign": "error",
10221
- "no-script-url": "warn",
10222
- "no-self-assign": "error",
10223
- "no-self-compare": "error",
10224
- "no-sequences": "error",
10225
- "no-shadow-restricted-names": "error",
10226
- "no-sparse-arrays": "error",
10227
- "no-unmodified-loop-condition": "warn",
10228
- "no-unsafe-finally": "error",
10229
- "no-unused-expressions": "off",
10230
- "@typescript-eslint/no-unused-expressions": "error",
10231
- "no-unused-labels": "error",
10232
- "no-useless-catch": "warn",
10233
- "no-useless-concat": "error",
10234
- "no-var": "error",
10235
- "no-void": [
10236
- "error",
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",
10237
10449
  {
10238
- allowAsStatement: true
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",
10468
+ "error",
10469
+ "groupCollapsed",
10470
+ "Console",
10471
+ "profile",
10472
+ "profileEnd",
10473
+ "timeStamp",
10474
+ "context"
10475
+ ]
10239
10476
  }
10240
10477
  ],
10241
- "no-with": "error",
10242
- "prefer-const": "error",
10243
- "require-atomic-updates": "error",
10244
- "require-yield": "warn",
10245
- strict: ["error", "never"],
10246
- "use-isnan": "error",
10247
- "no-useless-constructor": "off",
10248
- "@typescript-eslint/no-useless-constructor": "error",
10249
- "@typescript-eslint/no-unnecessary-type-constraint": "error",
10250
- "@typescript-eslint/brace-style": [
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": [
10251
10483
  "error",
10252
- "1tbs",
10253
10484
  {
10254
- allowSingleLine: false
10485
+ prefer: "type-imports",
10486
+ fixStyle: "separate-type-imports"
10255
10487
  }
10256
10488
  ],
10257
- "comma-spacing": "off",
10258
- "@typescript-eslint/comma-spacing": [
10259
- "error",
10489
+ "@typescript-eslint/adjacent-overload-signatures": "error",
10490
+ "@typescript-eslint/ban-types": [
10491
+ "warn",
10260
10492
  {
10261
- before: false,
10262
- after: true
10493
+ extendDefaults: false,
10494
+ types: {
10495
+ String: {
10496
+ message: 'Use "string" instead',
10497
+ fixWith: "string"
10498
+ },
10499
+ Boolean: {
10500
+ message: 'Use "boolean" instead',
10501
+ fixWith: "boolean"
10502
+ },
10503
+ Number: {
10504
+ message: 'Use "number" instead',
10505
+ fixWith: "number"
10506
+ },
10507
+ BigInt: {
10508
+ message: "Use `bigint` instead.",
10509
+ fixWith: "bigint"
10510
+ },
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
+ }
10263
10538
  }
10264
10539
  ],
10265
- "default-param-last": "off",
10266
- "@typescript-eslint/default-param-last": "error",
10267
- "func-call-spacing": "off",
10268
- "@typescript-eslint/func-call-spacing": ["error", "never"],
10269
- "keyword-spacing": "off",
10270
- "@typescript-eslint/keyword-spacing": "error",
10271
- "lines-between-class-members": "off",
10272
- "@typescript-eslint/lines-between-class-members": [
10273
- "error",
10274
- "always",
10540
+ "@typescript-eslint/consistent-type-assertions": "error",
10541
+ "@typescript-eslint/consistent-type-definitions": ["error", "type"],
10542
+ "@typescript-eslint/member-ordering": [
10543
+ "warn",
10275
10544
  {
10276
- exceptAfterSingleLine: true
10545
+ default: "never",
10546
+ classes: ["field", "constructor", "method"]
10277
10547
  }
10278
10548
  ],
10279
- "no-dupe-class-members": "off",
10280
- "@typescript-eslint/no-dupe-class-members": "error",
10281
- "no-empty-function": "off",
10282
- "@typescript-eslint/no-empty-function": "error",
10283
- "no-extra-parens": "off",
10284
- "no-extra-semi": "off",
10285
- "@typescript-eslint/no-extra-semi": "error",
10286
- "no-loop-func": "off",
10287
- "@typescript-eslint/no-loop-func": "error",
10288
- "no-loss-of-precision": "off",
10289
- "@typescript-eslint/no-loss-of-precision": "error",
10290
- "no-redeclare": "off",
10291
- "@typescript-eslint/no-redeclare": "error",
10292
- "no-restricted-imports": "off",
10293
- "@typescript-eslint/no-restricted-imports": [
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": [
10294
10554
  "error",
10295
10555
  {
10296
- paths: [
10297
- "error",
10298
- "domain",
10299
- "freelist",
10300
- "smalloc",
10301
- "punycode",
10302
- "sys",
10303
- "querystring",
10304
- "colors"
10305
- ]
10556
+ allowDeclarations: false,
10557
+ allowDefinitionFiles: false
10306
10558
  }
10307
10559
  ],
10308
- "padding-line-between-statements": "off",
10309
- "@typescript-eslint/padding-line-between-statements": "off",
10310
- quotes: "off",
10311
- "@typescript-eslint/quotes": "off",
10312
- "space-before-function-paren": "off",
10313
- "@typescript-eslint/space-before-function-paren": "off",
10314
- "space-infix-ops": "off",
10315
- "@typescript-eslint/space-infix-ops": "error",
10316
- semi: "off",
10317
- "@typescript-eslint/semi": ["error", "always"],
10318
- "space-before-blocks": "off",
10319
- "@typescript-eslint/space-before-blocks": ["error", "always"],
10320
- "no-undef": "off",
10321
- "no-duplicate-imports": "off"
10322
- };
10323
- }
10324
- function typescriptRules(props) {
10325
- const { typeAware } = props ?? {};
10326
- if (typeAware === true) {
10327
- return {
10328
- ...typescriptRulesTypeOblivious(),
10329
- ...typescriptRulesTypeAware()
10330
- };
10331
- }
10332
- return typescriptRulesTypeOblivious();
10333
- }
10334
-
10335
- // src/configs/markdown.ts
10336
- var markdown = async (options) => {
10337
- const { componentExts = [], overrides = {} } = options ?? {};
10338
- const { pluginMarkdown } = await importPluginMarkdown();
10339
- const tsRulesOff = Object.fromEntries(
10340
- // @ts-expect-error - undefined
10341
- Object.keys(typescriptRulesTypeAware()).map((key) => [
10342
- `@typescript-eslint/${key}`,
10343
- "off"
10344
- ])
10345
- );
10346
- return [
10347
- {
10348
- name: "jsse:markdown:setup",
10349
- plugins: {
10350
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10351
- markdown: pluginMarkdown
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: "^_"
10352
10569
  }
10353
- },
10354
- {
10355
- files: [GLOB_MARKDOWN],
10356
- name: "jsse:markdown:processor",
10357
- processor: "markdown/markdown"
10358
- },
10359
- {
10360
- files: [
10361
- GLOB_MARKDOWN_CODE,
10362
- ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
10363
- ],
10364
- languageOptions: {
10365
- parserOptions: {
10366
- ecmaFeatures: {
10367
- impliedStrict: true
10368
- }
10369
- }
10370
- },
10371
- name: "jsse:markdown:rules",
10372
- rules: {
10373
- "@typescript-eslint/consistent-type-imports": "off",
10374
- "@typescript-eslint/no-namespace": "off",
10375
- "@typescript-eslint/no-redeclare": "off",
10376
- "@typescript-eslint/no-require-imports": "off",
10377
- "@typescript-eslint/no-unused-vars": "off",
10378
- "@typescript-eslint/no-use-before-define": "off",
10379
- "@typescript-eslint/no-var-requires": "off",
10380
- "no-alert": "off",
10381
- "no-console": "off",
10382
- "no-undef": "off",
10383
- "no-unused-expressions": "off",
10384
- "no-unused-vars": "off",
10385
- "node/prefer-global/process": "off",
10386
- // Type aware rules
10387
- "object-curly-newline": "off",
10388
- "style/comma-dangle": "off",
10389
- "style/eol-last": "off",
10390
- "unicode-bom": "off",
10391
- "unused-imports/no-unused-imports": "off",
10392
- "unused-imports/no-unused-vars": "off",
10393
- ...tsRulesOff,
10394
- ...overrides
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
10395
10580
  }
10396
- }
10397
- ];
10398
- };
10399
-
10400
- // src/configs/comments.ts
10401
- var comments = async () => [
10402
- {
10403
- name: "jsse:eslint-comments",
10404
- plugins: {
10405
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10406
- "eslint-comments": default7
10407
- },
10408
- rules: {
10409
- "eslint-comments/no-aggregating-enable": "error",
10410
- "eslint-comments/no-duplicate-disable": "error",
10411
- "eslint-comments/no-unlimited-disable": "error",
10412
- "eslint-comments/no-unused-enable": "error"
10413
- }
10414
- }
10415
- ];
10416
-
10417
- // src/configs/ignores.ts
10418
- var ignores = async () => {
10419
- return [
10420
- {
10421
- ignores: GLOB_EXCLUDE
10422
- }
10423
- ];
10424
- };
10425
-
10426
- // src/configs/imports.ts
10427
- var imports = async (options) => {
10428
- const { stylistic: stylistic2 = true } = options ?? {};
10429
- return [
10430
- {
10431
- name: "jsse:import",
10432
- plugins: {
10433
- import: pluginImport
10434
- },
10435
- rules: {
10436
- "import/first": "error",
10437
- "import/no-duplicates": "error",
10438
- "import/no-mutable-exports": "error",
10439
- "import/no-named-default": "error",
10440
- "import/no-self-import": "error",
10441
- "import/no-webpack-loader-syntax": "error",
10442
- "import/order": "error",
10443
- ...stylistic2 ? {
10444
- "import/newline-after-import": [
10445
- "error",
10446
- { considerComments: true, count: 1 }
10447
- ]
10448
- } : {}
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
10449
10594
  }
10450
- }
10451
- ];
10452
- };
10453
-
10454
- // src/configs/javascript.ts
10455
- var import_globals = __toESM(require_globals2(), 1);
10456
- import eslintjs from "@eslint/js";
10457
- var javascript = async (options) => {
10458
- const {
10459
- isInEditor: isInEditor2 = false,
10460
- overrides = {},
10461
- reportUnusedDisableDirectives = true
10462
- } = options ?? {};
10463
- return [
10464
- {
10465
- languageOptions: {
10466
- ecmaVersion: 2022,
10467
- globals: {
10468
- ...import_globals.default.browser,
10469
- ...import_globals.default.es2021,
10470
- ...import_globals.default.node,
10471
- document: "readonly",
10472
- navigator: "readonly",
10473
- window: "readonly"
10474
- },
10475
- parserOptions: {
10476
- ecmaFeatures: {
10477
- jsx: true
10478
- },
10479
- ecmaVersion: 2022,
10480
- sourceType: "module"
10481
- },
10482
- sourceType: "module"
10483
- },
10484
- linterOptions: {
10485
- reportUnusedDisableDirectives
10486
- },
10487
- name: "jsse:javascript",
10488
- plugins: {
10489
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10490
- "unused-imports": default5
10491
- },
10492
- rules: {
10493
- ...eslintjs.configs.recommended.rules,
10494
- "accessor-pairs": [
10495
- "error",
10496
- { enforceForClassMembers: true, setWithoutGet: true }
10497
- ],
10498
- "array-callback-return": "error",
10499
- "arrow-parens": ["error", "as-needed", { requireForBlockBody: true }],
10500
- "block-scoped-var": "error",
10501
- "constructor-super": "error",
10502
- "default-case-last": "error",
10503
- "dot-notation": ["error", { allowKeywords: true }],
10504
- eqeqeq: ["error", "smart"],
10505
- "new-cap": [
10506
- "error",
10507
- { capIsNew: false, newIsCap: true, properties: true }
10508
- ],
10509
- "no-alert": "error",
10510
- "no-array-constructor": "error",
10511
- "no-async-promise-executor": "error",
10512
- "no-caller": "error",
10513
- "no-case-declarations": "error",
10514
- "no-class-assign": "error",
10515
- "no-compare-neg-zero": "error",
10516
- "no-cond-assign": ["error", "always"],
10517
- "no-console": ["error", { allow: ["warn", "error"] }],
10518
- "no-const-assign": "error",
10519
- "no-control-regex": "error",
10520
- "no-debugger": "error",
10521
- "no-delete-var": "error",
10522
- "no-dupe-args": "error",
10523
- "no-dupe-class-members": "error",
10524
- "no-dupe-keys": "error",
10525
- "no-duplicate-case": "error",
10526
- "no-empty": ["error", { allowEmptyCatch: true }],
10527
- "no-empty-character-class": "error",
10528
- "no-empty-pattern": "error",
10529
- "no-eval": "error",
10530
- "no-ex-assign": "error",
10531
- "no-extend-native": "error",
10532
- "no-extra-bind": "error",
10533
- "no-extra-boolean-cast": "error",
10534
- "no-fallthrough": "error",
10535
- "no-func-assign": "error",
10536
- "no-global-assign": "error",
10537
- "no-implied-eval": "error",
10538
- "no-import-assign": "error",
10539
- "no-invalid-regexp": "error",
10540
- "no-invalid-this": "error",
10541
- "no-irregular-whitespace": "error",
10542
- "no-iterator": "error",
10543
- "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
10544
- "no-lone-blocks": "error",
10545
- "no-loss-of-precision": "error",
10546
- "no-misleading-character-class": "error",
10547
- "no-multi-str": "error",
10548
- "no-nested-ternary": "off",
10549
- "no-new": "error",
10550
- "no-new-func": "error",
10551
- "no-new-object": "error",
10552
- "no-new-symbol": "error",
10553
- "no-new-wrappers": "error",
10554
- "no-obj-calls": "error",
10555
- "no-octal": "error",
10556
- "no-octal-escape": "error",
10557
- "no-proto": "error",
10558
- "no-prototype-builtins": "error",
10559
- "no-redeclare": ["error", { builtinGlobals: false }],
10560
- "no-regex-spaces": "error",
10561
- "no-restricted-globals": [
10562
- "error",
10563
- { message: "Use `globalThis` instead.", name: "global" },
10564
- { message: "Use `globalThis` instead.", name: "self" }
10565
- ],
10566
- "no-restricted-properties": [
10567
- "error",
10568
- {
10569
- message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",
10570
- property: "__proto__"
10571
- },
10572
- {
10573
- message: "Use `Object.defineProperty` instead.",
10574
- property: "__defineGetter__"
10575
- },
10576
- {
10577
- message: "Use `Object.defineProperty` instead.",
10578
- property: "__defineSetter__"
10579
- },
10580
- {
10581
- message: "Use `Object.getOwnPropertyDescriptor` instead.",
10582
- property: "__lookupGetter__"
10583
- },
10584
- {
10585
- message: "Use `Object.getOwnPropertyDescriptor` instead.",
10586
- property: "__lookupSetter__"
10587
- }
10588
- ],
10589
- "no-restricted-syntax": [
10590
- "error",
10591
- "DebuggerStatement",
10592
- "LabeledStatement",
10593
- "WithStatement",
10594
- "TSEnumDeclaration[const=true]",
10595
- "TSExportAssignment"
10596
- ],
10597
- "no-self-assign": ["error", { props: true }],
10598
- "no-self-compare": "error",
10599
- "no-sequences": "error",
10600
- "no-shadow-restricted-names": "error",
10601
- "no-sparse-arrays": "error",
10602
- "no-template-curly-in-string": "error",
10603
- "no-this-before-super": "error",
10604
- "no-throw-literal": "error",
10605
- "no-undef": "error",
10606
- "no-undef-init": "error",
10607
- "no-unexpected-multiline": "error",
10608
- "no-unmodified-loop-condition": "error",
10609
- "no-unneeded-ternary": ["error", { defaultAssignment: false }],
10610
- "no-unreachable": "error",
10611
- "no-unreachable-loop": "error",
10612
- "no-unsafe-finally": "error",
10613
- "no-unsafe-negation": "error",
10614
- "no-unused-expressions": [
10615
- "error",
10616
- {
10617
- allowShortCircuit: true,
10618
- allowTaggedTemplates: true,
10619
- allowTernary: true
10620
- }
10621
- ],
10622
- "no-unused-vars": [
10623
- "error",
10624
- {
10625
- args: "none",
10626
- caughtErrors: "none",
10627
- ignoreRestSiblings: true,
10628
- vars: "all"
10629
- }
10630
- ],
10631
- "no-use-before-define": [
10632
- "error",
10633
- { classes: false, functions: false, variables: true }
10634
- ],
10635
- "no-useless-backreference": "error",
10636
- "no-useless-call": "error",
10637
- "no-useless-catch": "error",
10638
- "no-useless-computed-key": "error",
10639
- "no-useless-constructor": "error",
10640
- "no-useless-rename": "error",
10641
- "no-useless-return": "error",
10642
- "no-var": "error",
10643
- "no-with": "error",
10644
- "object-shorthand": [
10645
- "error",
10646
- "always",
10647
- {
10648
- avoidQuotes: true,
10649
- ignoreConstructors: false
10650
- }
10651
- ],
10652
- "one-var": ["error", { initialized: "never" }],
10653
- "prefer-arrow-callback": [
10654
- "error",
10655
- {
10656
- allowNamedFunctions: false,
10657
- allowUnboundThis: true
10658
- }
10659
- ],
10660
- "prefer-const": [
10661
- "error",
10662
- {
10663
- destructuring: "all",
10664
- ignoreReadBeforeAssign: true
10665
- }
10666
- ],
10667
- "prefer-exponentiation-operator": "error",
10668
- "prefer-promise-reject-errors": "error",
10669
- "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
10670
- "prefer-rest-params": "error",
10671
- "prefer-spread": "error",
10672
- "prefer-template": "error",
10673
- "sort-imports": [
10674
- "error",
10675
- {
10676
- allowSeparatedGroups: false,
10677
- ignoreCase: false,
10678
- ignoreDeclarationSort: true,
10679
- ignoreMemberSort: false,
10680
- memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
10681
- }
10682
- ],
10683
- "symbol-description": "error",
10684
- "unicode-bom": ["error", "never"],
10685
- "unused-imports/no-unused-imports": isInEditor2 ? "off" : "error",
10686
- "unused-imports/no-unused-vars": [
10687
- "error",
10688
- {
10689
- args: "after-used",
10690
- argsIgnorePattern: "^_",
10691
- vars: "all",
10692
- varsIgnorePattern: "^_"
10693
- }
10694
- ],
10695
- "use-isnan": [
10696
- "error",
10697
- { enforceForIndexOf: true, enforceForSwitchCase: true }
10698
- ],
10699
- "valid-typeof": ["error", { requireStringLiterals: true }],
10700
- "vars-on-top": "error",
10701
- yoda: ["error", "never"],
10702
- ...overrides
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
10703
10661
  }
10704
- },
10705
- {
10706
- files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
10707
- name: "jsse:scripts-overrides",
10708
- rules: {
10709
- "no-console": "off"
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
10710
10677
  }
10711
- }
10712
- ];
10713
- };
10714
-
10715
- // src/configs/jsdoc.ts
10716
- var jsdoc = async () => {
10717
- const { pluginJsdoc } = await importPluginJsdoc();
10718
- return [
10719
- {
10720
- name: "jsse:jsdoc",
10721
- plugins: {
10722
- jsdoc: pluginJsdoc
10723
- },
10724
- rules: {
10725
- "jsdoc/check-access": "warn",
10726
- "jsdoc/check-alignment": "warn",
10727
- "jsdoc/check-param-names": "warn",
10728
- "jsdoc/check-property-names": "warn",
10729
- "jsdoc/check-types": "warn",
10730
- "jsdoc/empty-tags": "warn",
10731
- "jsdoc/implements-on-classes": "warn",
10732
- "jsdoc/multiline-blocks": "warn",
10733
- "jsdoc/no-defaults": "warn",
10734
- "jsdoc/no-multi-asterisks": "warn",
10735
- "jsdoc/require-param-name": "warn",
10736
- "jsdoc/require-property": "warn",
10737
- "jsdoc/require-property-description": "warn",
10738
- "jsdoc/require-property-name": "warn",
10739
- "jsdoc/require-returns-check": "warn",
10740
- "jsdoc/require-returns-description": "warn",
10741
- "jsdoc/require-yields-check": "warn"
10678
+ ],
10679
+ "comma-spacing": "off",
10680
+ "@typescript-eslint/comma-spacing": [
10681
+ "error",
10682
+ {
10683
+ before: false,
10684
+ after: true
10742
10685
  }
10743
- }
10744
- ];
10745
- };
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
+ }
10746
10756
 
10747
- // src/configs/jsonc.ts
10748
- var jsonc = async (options) => {
10749
- const { overrides = {}, stylistic: stylistic2 = true } = options ?? {};
10750
- const { indent = 2 } = typeof stylistic2 === "boolean" ? {} : stylistic2;
10751
- const { parserJsonc, pluginJsonc } = await importJsoncLibs();
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
+ );
10752
10768
  return [
10753
10769
  {
10754
- name: "jsse:jsonc:setup",
10755
- plugins: {
10756
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
10757
- jsonc: pluginJsonc
10758
- }
10759
- },
10760
- {
10761
- files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
10762
- languageOptions: {
10763
- parser: parserJsonc
10764
- },
10765
- name: "jsse:jsonc:rules",
10766
- rules: {
10767
- "jsonc/no-bigint-literals": "error",
10768
- "jsonc/no-binary-expression": "error",
10769
- "jsonc/no-binary-numeric-literals": "error",
10770
- "jsonc/no-dupe-keys": "error",
10771
- "jsonc/no-escape-sequence-in-identifier": "error",
10772
- "jsonc/no-floating-decimal": "error",
10773
- "jsonc/no-hexadecimal-numeric-literals": "error",
10774
- "jsonc/no-infinity": "error",
10775
- "jsonc/no-multi-str": "error",
10776
- "jsonc/no-nan": "error",
10777
- "jsonc/no-number-props": "error",
10778
- "jsonc/no-numeric-separators": "error",
10779
- "jsonc/no-octal": "error",
10780
- "jsonc/no-octal-escape": "error",
10781
- "jsonc/no-octal-numeric-literals": "error",
10782
- "jsonc/no-parenthesized": "error",
10783
- "jsonc/no-plus-sign": "error",
10784
- "jsonc/no-regexp-literals": "error",
10785
- "jsonc/no-sparse-arrays": "error",
10786
- "jsonc/no-template-literals": "error",
10787
- "jsonc/no-undefined-value": "error",
10788
- "jsonc/no-unicode-codepoint-escapes": "error",
10789
- "jsonc/no-useless-escape": "error",
10790
- "jsonc/space-unary-ops": "error",
10791
- "jsonc/valid-json-number": "error",
10792
- "jsonc/vue-custom-block/no-parsing-error": "error",
10793
- ...stylistic2 ? {
10794
- "jsonc/array-bracket-spacing": ["error", "never"],
10795
- "jsonc/comma-dangle": ["error", "never"],
10796
- "jsonc/comma-style": ["error", "last"],
10797
- "jsonc/indent": ["error", indent],
10798
- "jsonc/key-spacing": [
10799
- "error",
10800
- { afterColon: true, beforeColon: false }
10801
- ],
10802
- "jsonc/object-curly-newline": [
10803
- "error",
10804
- { consistent: true, multiline: true }
10805
- ],
10806
- "jsonc/object-curly-spacing": ["error", "always"],
10807
- "jsonc/object-property-newline": [
10808
- "error",
10809
- { allowMultiplePropertiesPerLine: true }
10810
- ],
10811
- "jsonc/quote-props": "error",
10812
- "jsonc/quotes": "error"
10813
- } : {},
10770
+ name: "jsse:markdown:setup",
10771
+ plugins: {
10772
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10773
+ markdown: pluginMarkdown
10774
+ }
10775
+ },
10776
+ {
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
+ ],
10786
+ languageOptions: {
10787
+ parserOptions: {
10788
+ ecmaFeatures: {
10789
+ impliedStrict: true
10790
+ }
10791
+ }
10792
+ },
10793
+ name: "jsse:markdown:rules",
10794
+ rules: {
10795
+ "@typescript-eslint/await-thenable": "off",
10796
+ "@typescript-eslint/consistent-type-imports": "off",
10797
+ "@typescript-eslint/dot-notation": "off",
10798
+ "@typescript-eslint/no-floating-promises": "off",
10799
+ "@typescript-eslint/no-for-in-array": "off",
10800
+ "@typescript-eslint/no-implied-eval": "off",
10801
+ "@typescript-eslint/no-misused-promises": "off",
10802
+ "@typescript-eslint/no-namespace": "off",
10803
+ "@typescript-eslint/no-redeclare": "off",
10804
+ "@typescript-eslint/no-require-imports": "off",
10805
+ "@typescript-eslint/no-throw-literal": "off",
10806
+ "@typescript-eslint/no-unnecessary-type-assertion": "off",
10807
+ "@typescript-eslint/no-unsafe-argument": "off",
10808
+ "@typescript-eslint/no-unsafe-assignment": "off",
10809
+ "@typescript-eslint/no-unsafe-call": "off",
10810
+ "@typescript-eslint/no-unsafe-member-access": "off",
10811
+ "@typescript-eslint/no-unsafe-return": "off",
10812
+ "@typescript-eslint/no-unused-vars": "off",
10813
+ "@typescript-eslint/no-use-before-define": "off",
10814
+ "@typescript-eslint/no-var-requires": "off",
10815
+ "@typescript-eslint/restrict-plus-operands": "off",
10816
+ "@typescript-eslint/restrict-template-expressions": "off",
10817
+ "@typescript-eslint/unbound-method": "off",
10818
+ "no-alert": "off",
10819
+ "no-console": "off",
10820
+ "no-undef": "off",
10821
+ "no-unused-expressions": "off",
10822
+ "no-unused-vars": "off",
10823
+ "node/prefer-global/process": "off",
10824
+ // Type aware rules
10825
+ "object-curly-newline": "off",
10826
+ "style/comma-dangle": "off",
10827
+ "style/eol-last": "off",
10828
+ "unicode-bom": "off",
10829
+ "unused-imports/no-unused-imports": "off",
10830
+ "unused-imports/no-unused-vars": "off",
10831
+ ...tsRulesOff,
10814
10832
  ...overrides
10815
10833
  }
10816
10834
  }
@@ -10824,7 +10842,7 @@ var n = async () => {
10824
10842
  name: "jsse:n",
10825
10843
  plugins: {
10826
10844
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10827
- n: default3
10845
+ n: default4
10828
10846
  },
10829
10847
  rules: {
10830
10848
  "n/handle-callback-err": ["error", "^(err|error)$"],
@@ -10847,7 +10865,7 @@ var perfectionist = async () => {
10847
10865
  name: "jsse:perfectionist",
10848
10866
  plugins: {
10849
10867
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10850
- perfectionist: default6
10868
+ perfectionist: default5
10851
10869
  }
10852
10870
  }
10853
10871
  ];
@@ -11270,91 +11288,7 @@ var react = async (options) => {
11270
11288
  return config;
11271
11289
  };
11272
11290
 
11273
- // src/configs/stylistic.ts
11274
- function jsxStylistic({
11275
- indent
11276
- }) {
11277
- return {
11278
- "@stylistic/jsx-curly-brace-presence": [
11279
- "error",
11280
- { propElementValues: "always" }
11281
- ],
11282
- "@stylistic/jsx-indent": [
11283
- "error",
11284
- indent,
11285
- { checkAttributes: true, indentLogicalExpressions: true }
11286
- ],
11287
- "@stylistic/jsx-quotes": "error"
11288
- };
11289
- }
11290
- var stylistic = async (options) => {
11291
- const { indent = 2, jsx = true, quotes = "double" } = options ?? {};
11292
- const { pluginStylistic } = await importPluginStylistic();
11293
- return [
11294
- {
11295
- name: "jsse:stylistic",
11296
- plugins: {
11297
- // eslint-disable-next-line @typescript-eslint/naming-convention
11298
- "@stylistic": pluginStylistic
11299
- },
11300
- rules: {
11301
- "@stylistic/quote-props": ["error", "as-needed"],
11302
- "@stylistic/quotes": [
11303
- "error",
11304
- quotes,
11305
- { allowTemplateLiterals: false, avoidEscape: true }
11306
- ],
11307
- ...jsx ? jsxStylistic({ indent }) : {}
11308
- }
11309
- }
11310
- ];
11311
- };
11312
-
11313
- // src/configs/tailwind.ts
11314
- var TAILWIND_ESLINT_SETTINGS_DEFAULT = {
11315
- // These are the default values but feel free to customize
11316
- callees: ["classnames", "clsx", "ctl", "cn", "cx", "twMerge", "twJoin"],
11317
- classRegex: "^class(Name)?$",
11318
- // can be modified to support custom attributes. E.g. "^tw$" for `twin.macro`
11319
- config: "tailwind.config.js",
11320
- // returned from `loadConfig()` utility if not provided
11321
- cssFiles: ["**/*.css", "!**/node_modules", "!**/.*", "!**/dist", "!**/build"],
11322
- cssFilesRefreshRate: 5e3,
11323
- removeDuplicates: true,
11324
- skipClassAttribute: false,
11325
- tags: [],
11326
- // can be set to e.g. ['tw'] for use in tw`bg-blue`
11327
- whitelist: []
11328
- };
11329
- function tailwindSettings(options) {
11330
- if (typeof options === "boolean") {
11331
- return TAILWIND_ESLINT_SETTINGS_DEFAULT;
11332
- }
11333
- return { ...TAILWIND_ESLINT_SETTINGS_DEFAULT, ...options };
11334
- }
11335
- var tailwind = async (options) => {
11336
- const { pluginTailwind } = await importPluginTailwind();
11337
- return [
11338
- {
11339
- files: [GLOB_SRC],
11340
- name: "jsse:tailwind:rules",
11341
- plugins: {
11342
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11343
- tailwindcss: pluginTailwind
11344
- },
11345
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11346
- rules: {
11347
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
11348
- ...pluginTailwind.configs.recommended.rules
11349
- },
11350
- settings: {
11351
- tailwindcss: tailwindSettings(options)
11352
- }
11353
- }
11354
- ];
11355
- };
11356
-
11357
- // src/configs/sort.ts
11291
+ // src/configs/sort-package-json.ts
11358
11292
  var sortPackageJson = async () => {
11359
11293
  return [
11360
11294
  {
@@ -11439,6 +11373,8 @@ var sortPackageJson = async () => {
11439
11373
  }
11440
11374
  ];
11441
11375
  };
11376
+
11377
+ // src/configs/sort-tsconfig.ts
11442
11378
  var sortTsconfig = async () => {
11443
11379
  return [
11444
11380
  {
@@ -11565,36 +11501,111 @@ var sortTsconfig = async () => {
11565
11501
  ];
11566
11502
  };
11567
11503
 
11504
+ // src/configs/stylistic.ts
11505
+ function jsxStylistic({
11506
+ indent
11507
+ }) {
11508
+ return {
11509
+ "@stylistic/jsx-curly-brace-presence": [
11510
+ "error",
11511
+ { propElementValues: "always" }
11512
+ ],
11513
+ "@stylistic/jsx-indent": [
11514
+ "error",
11515
+ indent,
11516
+ { checkAttributes: true, indentLogicalExpressions: true }
11517
+ ],
11518
+ "@stylistic/jsx-quotes": "error"
11519
+ };
11520
+ }
11521
+ var stylistic = async (options) => {
11522
+ const { indent = 2, jsx = true, quotes = "double" } = options ?? {};
11523
+ const { pluginStylistic } = await importPluginStylistic();
11524
+ return [
11525
+ {
11526
+ name: "jsse:stylistic",
11527
+ plugins: {
11528
+ // eslint-disable-next-line @typescript-eslint/naming-convention
11529
+ "@stylistic": pluginStylistic
11530
+ },
11531
+ rules: {
11532
+ "@stylistic/quote-props": ["error", "as-needed"],
11533
+ "@stylistic/quotes": [
11534
+ "error",
11535
+ quotes,
11536
+ { allowTemplateLiterals: false, avoidEscape: true }
11537
+ ],
11538
+ ...jsx ? jsxStylistic({ indent }) : {}
11539
+ }
11540
+ }
11541
+ ];
11542
+ };
11543
+
11544
+ // src/configs/tailwind.ts
11545
+ var TAILWIND_ESLINT_SETTINGS_DEFAULT = {
11546
+ // These are the default values but feel free to customize
11547
+ callees: ["classnames", "clsx", "ctl", "cn", "cx", "twMerge", "twJoin"],
11548
+ classRegex: "^class(Name)?$",
11549
+ // can be modified to support custom attributes. E.g. "^tw$" for `twin.macro`
11550
+ config: "tailwind.config.js",
11551
+ // returned from `loadConfig()` utility if not provided
11552
+ cssFiles: ["**/*.css", "!**/node_modules", "!**/.*", "!**/dist", "!**/build"],
11553
+ cssFilesRefreshRate: 5e3,
11554
+ removeDuplicates: true,
11555
+ skipClassAttribute: false,
11556
+ tags: [],
11557
+ // can be set to e.g. ['tw'] for use in tw`bg-blue`
11558
+ whitelist: []
11559
+ };
11560
+ function tailwindSettings(options) {
11561
+ if (typeof options === "boolean") {
11562
+ return TAILWIND_ESLINT_SETTINGS_DEFAULT;
11563
+ }
11564
+ return { ...TAILWIND_ESLINT_SETTINGS_DEFAULT, ...options };
11565
+ }
11566
+ var tailwind = async (options) => {
11567
+ const { pluginTailwind } = await importPluginTailwind();
11568
+ return [
11569
+ {
11570
+ files: [GLOB_SRC],
11571
+ name: "jsse:tailwind:rules",
11572
+ plugins: {
11573
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11574
+ tailwindcss: pluginTailwind
11575
+ },
11576
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11577
+ rules: {
11578
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
11579
+ ...pluginTailwind.configs.recommended.rules
11580
+ },
11581
+ settings: {
11582
+ tailwindcss: tailwindSettings(options)
11583
+ }
11584
+ }
11585
+ ];
11586
+ };
11587
+
11568
11588
  // src/configs/test.ts
11569
- var test = async (options = {}) => {
11589
+ var noOnlyTests = async (options = {}) => {
11570
11590
  const { isInEditor: isInEditor2 = false, overrides = {} } = options;
11571
- const [pluginNoOnlyTests, pluginVitest] = await Promise.all([
11591
+ const pluginNoOnlyTests = await interopDefault2(
11572
11592
  // @ts-expect-error - types are incorrect/missing
11573
- interopDefault2(import("eslint-plugin-no-only-tests")),
11574
- interopDefault2(import("eslint-plugin-vitest"))
11575
- ]);
11593
+ import("eslint-plugin-no-only-tests")
11594
+ );
11576
11595
  return [
11577
11596
  {
11578
- name: "jsse:test:setup",
11597
+ name: "jsse:no-only-tests:setup",
11579
11598
  plugins: {
11580
11599
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11581
- "no-only-tests": pluginNoOnlyTests,
11582
- vitest: pluginVitest
11600
+ "no-only-tests": pluginNoOnlyTests
11583
11601
  }
11584
11602
  },
11585
11603
  {
11586
11604
  files: GLOB_TESTS,
11587
- name: "jsse:test:rules",
11605
+ name: "jsse:no-only-tests:rules",
11588
11606
  rules: {
11589
11607
  "no-only-tests/no-only-tests": isInEditor2 ? "off" : isCI() ? "error" : "warn",
11590
11608
  "unicorn/no-null": "off",
11591
- "vitest/consistent-test-it": [
11592
- "error",
11593
- { fn: "test", withinDescribe: "test" }
11594
- ],
11595
- "vitest/no-identical-title": "error",
11596
- "vitest/prefer-hooks-in-order": "error",
11597
- "vitest/prefer-lowercase-title": "error",
11598
11609
  ...overrides
11599
11610
  }
11600
11611
  }
@@ -11697,7 +11708,7 @@ function unicornOff() {
11697
11708
  };
11698
11709
  }
11699
11710
  function unicornRecommended() {
11700
- return default4.configs.recommended.rules;
11711
+ return default6.configs.recommended.rules;
11701
11712
  }
11702
11713
  var unicorn = async () => {
11703
11714
  return [
@@ -11705,7 +11716,7 @@ var unicorn = async () => {
11705
11716
  name: "jsse:unicorn",
11706
11717
  plugins: {
11707
11718
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11708
- unicorn: default4
11719
+ unicorn: default6
11709
11720
  },
11710
11721
  rules: {
11711
11722
  ...unicornRecommended(),
@@ -11779,6 +11790,42 @@ var unicorn = async () => {
11779
11790
  // Use new when throwing error
11780
11791
  "unicorn/throw-new-error": "error"
11781
11792
  }
11793
+ },
11794
+ {
11795
+ files: GLOB_TESTS,
11796
+ name: "jsse:unicorn:tests",
11797
+ rules: {
11798
+ "unicorn/no-null": "off",
11799
+ "unicorn/no-unused-properties": "off"
11800
+ }
11801
+ }
11802
+ ];
11803
+ };
11804
+
11805
+ // src/configs/vitest.ts
11806
+ var vitest = async (options = {}) => {
11807
+ const { overrides = {} } = options;
11808
+ const pluginVitest = await interopDefault2(import("eslint-plugin-vitest"));
11809
+ return [
11810
+ {
11811
+ name: "jsse:vitest:setup",
11812
+ plugins: {
11813
+ vitest: pluginVitest
11814
+ }
11815
+ },
11816
+ {
11817
+ files: GLOB_TESTS,
11818
+ name: "jsse:vitest:rules",
11819
+ rules: {
11820
+ "vitest/consistent-test-it": [
11821
+ "error",
11822
+ { fn: "test", withinDescribe: "test" }
11823
+ ],
11824
+ "vitest/no-identical-title": "error",
11825
+ "vitest/prefer-hooks-in-order": "error",
11826
+ "vitest/prefer-lowercase-title": "error",
11827
+ ...overrides
11828
+ }
11782
11829
  }
11783
11830
  ];
11784
11831
  };
@@ -11926,7 +11973,7 @@ async function jsse(options = {}, ...userConfigs) {
11926
11973
  const configs = [];
11927
11974
  if (enableGitignore) {
11928
11975
  if (typeof enableGitignore === "boolean") {
11929
- if (fs2.existsSync(".gitignore"))
11976
+ if (fs2.existsSync(".gitignore")) {
11930
11977
  configs.push(
11931
11978
  interopDefault2(import("eslint-config-flat-gitignore")).then((r2) => {
11932
11979
  const res = r2();
@@ -11934,6 +11981,7 @@ async function jsse(options = {}, ...userConfigs) {
11934
11981
  return [res];
11935
11982
  })
11936
11983
  );
11984
+ }
11937
11985
  } else {
11938
11986
  configs.push(
11939
11987
  interopDefault2(import("eslint-config-flat-gitignore")).then((r2) => {
@@ -11999,7 +12047,11 @@ async function jsse(options = {}, ...userConfigs) {
11999
12047
  }
12000
12048
  if (normalizedOptions.test) {
12001
12049
  configs.push(
12002
- test({
12050
+ vitest({
12051
+ isInEditor: isInEditor2,
12052
+ overrides: overrides.test
12053
+ }),
12054
+ noOnlyTests({
12003
12055
  isInEditor: isInEditor2,
12004
12056
  overrides: overrides.test
12005
12057
  })
@@ -12122,6 +12174,7 @@ export {
12122
12174
  GLOB_SRC_EXT,
12123
12175
  GLOB_STYLE,
12124
12176
  GLOB_TESTS,
12177
+ GLOB_TOML,
12125
12178
  GLOB_TS,
12126
12179
  GLOB_TSX,
12127
12180
  GLOB_YAML,
@@ -12148,14 +12201,14 @@ export {
12148
12201
  jssestd,
12149
12202
  parserTs,
12150
12203
  default2 as pluginAntfu,
12151
- default7 as pluginEslintComments,
12204
+ default3 as pluginEslintComments,
12152
12205
  pluginImport,
12153
- default3 as pluginN,
12154
- default6 as pluginPerfectionist,
12206
+ default4 as pluginN,
12207
+ default5 as pluginPerfectionist,
12155
12208
  pluginSortKeys,
12156
12209
  default8 as pluginTs,
12157
- default4 as pluginUnicorn,
12158
- default5 as pluginUnusedImports,
12210
+ default6 as pluginUnicorn,
12211
+ default7 as pluginUnusedImports,
12159
12212
  renameRules
12160
12213
  };
12161
12214
  /*! Bundled license information: