js-style-kit 0.0.2

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.
Files changed (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +33 -0
  3. package/dist/chunk-3H3TV7WG.js +21 -0
  4. package/dist/chunk-3H3TV7WG.js.map +1 -0
  5. package/dist/chunk-7D4SUZUM.js +38 -0
  6. package/dist/chunk-7D4SUZUM.js.map +1 -0
  7. package/dist/chunk-AL3W54BT.js +137 -0
  8. package/dist/chunk-AL3W54BT.js.map +1 -0
  9. package/dist/chunk-EQOUQWIX.js +45 -0
  10. package/dist/chunk-EQOUQWIX.js.map +1 -0
  11. package/dist/chunk-ETHEVVRU.js +1 -0
  12. package/dist/chunk-ETHEVVRU.js.map +1 -0
  13. package/dist/chunk-GE5ZPFK5.js +32 -0
  14. package/dist/chunk-GE5ZPFK5.js.map +1 -0
  15. package/dist/chunk-GZC424B7.js +36 -0
  16. package/dist/chunk-GZC424B7.js.map +1 -0
  17. package/dist/chunk-IOVQNUC6.js +21 -0
  18. package/dist/chunk-IOVQNUC6.js.map +1 -0
  19. package/dist/chunk-JY5TAY3J.js +428 -0
  20. package/dist/chunk-JY5TAY3J.js.map +1 -0
  21. package/dist/chunk-Q3UZX7NT.js +14 -0
  22. package/dist/chunk-Q3UZX7NT.js.map +1 -0
  23. package/dist/chunk-SVENELEJ.js +17576 -0
  24. package/dist/chunk-SVENELEJ.js.map +1 -0
  25. package/dist/chunk-TQWE6NWW.js +133 -0
  26. package/dist/chunk-TQWE6NWW.js.map +1 -0
  27. package/dist/chunk-UTXH73LC.js +42 -0
  28. package/dist/chunk-UTXH73LC.js.map +1 -0
  29. package/dist/chunk-W56QT6S7.js +14 -0
  30. package/dist/chunk-W56QT6S7.js.map +1 -0
  31. package/dist/chunk-YS5XHQB5.js +23 -0
  32. package/dist/chunk-YS5XHQB5.js.map +1 -0
  33. package/dist/eslint/constants.d.ts +10 -0
  34. package/dist/eslint/constants.js +8 -0
  35. package/dist/eslint/constants.js.map +1 -0
  36. package/dist/eslint/ignores.d.ts +5 -0
  37. package/dist/eslint/ignores.js +9 -0
  38. package/dist/eslint/ignores.js.map +1 -0
  39. package/dist/eslint/index.d.ts +25 -0
  40. package/dist/eslint/index.js +18 -0
  41. package/dist/eslint/index.js.map +1 -0
  42. package/dist/eslint/index.test.d.ts +2 -0
  43. package/dist/eslint/index.test.js +60 -0
  44. package/dist/eslint/index.test.js.map +1 -0
  45. package/dist/eslint/javascript/config.d.ts +6 -0
  46. package/dist/eslint/javascript/config.js +10 -0
  47. package/dist/eslint/javascript/config.js.map +1 -0
  48. package/dist/eslint/javascript/rules.d.ts +13 -0
  49. package/dist/eslint/javascript/rules.js +8 -0
  50. package/dist/eslint/javascript/rules.js.map +1 -0
  51. package/dist/eslint/perfectionist/config.d.ts +5 -0
  52. package/dist/eslint/perfectionist/config.js +10 -0
  53. package/dist/eslint/perfectionist/config.js.map +1 -0
  54. package/dist/eslint/perfectionist/rules.d.ts +10 -0
  55. package/dist/eslint/perfectionist/rules.js +8 -0
  56. package/dist/eslint/perfectionist/rules.js.map +1 -0
  57. package/dist/eslint/react/config.d.ts +6 -0
  58. package/dist/eslint/react/config.js +10 -0
  59. package/dist/eslint/react/config.js.map +1 -0
  60. package/dist/eslint/react/rules.d.ts +16 -0
  61. package/dist/eslint/react/rules.js +8 -0
  62. package/dist/eslint/react/rules.js.map +1 -0
  63. package/dist/eslint/typescript/config.d.ts +5 -0
  64. package/dist/eslint/typescript/config.js +10 -0
  65. package/dist/eslint/typescript/config.js.map +1 -0
  66. package/dist/eslint/typescript/rules.d.ts +5 -0
  67. package/dist/eslint/typescript/rules.js +8 -0
  68. package/dist/eslint/typescript/rules.js.map +1 -0
  69. package/dist/index.d.ts +7 -0
  70. package/dist/index.js +23 -0
  71. package/dist/index.js.map +1 -0
  72. package/dist/magic-string.es-UEL4LDHN.js +1300 -0
  73. package/dist/magic-string.es-UEL4LDHN.js.map +1 -0
  74. package/dist/prettier/index.d.ts +27 -0
  75. package/dist/prettier/index.js +8 -0
  76. package/dist/prettier/index.js.map +1 -0
  77. package/dist/prettier/index.test.d.ts +2 -0
  78. package/dist/prettier/index.test.js +52 -0
  79. package/dist/prettier/index.test.js.map +1 -0
  80. package/dist/types.d.ts +5 -0
  81. package/dist/types.js +1 -0
  82. package/dist/types.js.map +1 -0
  83. package/package.json +48 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Nathan Drake
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # `js-style-kit`
2
+
3
+ ## How to Use
4
+
5
+ All dependencies, including ESLint/Prettier are included. TypeScript is not.
6
+
7
+ The project is ESM only, and requires at least Node v20.11.0.
8
+
9
+ ### ESLint
10
+
11
+ TypeScript is enabled by default, React is not.
12
+
13
+ Create a `eslint.config.js` if using `"type": "module"`, or `eslint.config.mjs` if not.
14
+
15
+ It accepts a config object, hover the function for the JSDoc options.
16
+
17
+ ```js
18
+ import { eslintConfig } from "js-style-kit";
19
+
20
+ export default eslintConfig({});
21
+ ```
22
+
23
+ ### Prettier
24
+
25
+ Create a `prettier.config.js` if using `"type": "module"`, or `prettier.config.mjs` if not.
26
+
27
+ Add `tailwind: true` for to enable Tailwind.
28
+
29
+ ```js
30
+ import { prettierConfig } from "js-style-kit";
31
+
32
+ export default prettierConfig({});
33
+ ```
@@ -0,0 +1,21 @@
1
+ import {
2
+ baseEslintRules
3
+ } from "./chunk-JY5TAY3J.js";
4
+ import {
5
+ configNames
6
+ } from "./chunk-W56QT6S7.js";
7
+
8
+ // src/eslint/javascript/config.ts
9
+ var baseEslintConfig = (functionStyle) => ({
10
+ languageOptions: {
11
+ ecmaVersion: 2022
12
+ },
13
+ linterOptions: { reportUnusedDisableDirectives: true },
14
+ name: configNames.base,
15
+ rules: baseEslintRules(functionStyle)
16
+ });
17
+
18
+ export {
19
+ baseEslintConfig
20
+ };
21
+ //# sourceMappingURL=chunk-3H3TV7WG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/eslint/javascript/config.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\n\nimport type { FunctionStyle } from \"../../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { baseEslintRules } from \"./rules.js\";\n\nexport const baseEslintConfig = (\n functionStyle: FunctionStyle,\n): Linter.Config => ({\n languageOptions: {\n ecmaVersion: 2022,\n },\n linterOptions: { reportUnusedDisableDirectives: true },\n name: configNames.base,\n rules: baseEslintRules(functionStyle),\n});\n"],"mappings":";;;;;;;;AAOO,IAAM,mBAAmB,CAC9B,mBACmB;AAAA,EACnB,iBAAiB;AAAA,IACf,aAAa;AAAA,EACf;AAAA,EACA,eAAe,EAAE,+BAA+B,KAAK;AAAA,EACrD,MAAM,YAAY;AAAA,EAClB,OAAO,gBAAgB,aAAa;AACtC;","names":[]}
@@ -0,0 +1,38 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x + '" is not supported');
12
+ });
13
+ var __commonJS = (cb, mod) => function __require2() {
14
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from))
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+
33
+ export {
34
+ __require,
35
+ __commonJS,
36
+ __toESM
37
+ };
38
+ //# sourceMappingURL=chunk-7D4SUZUM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,137 @@
1
+ // src/eslint/typescript/rules.ts
2
+ var tseslintRules = {
3
+ "@typescript-eslint/adjacent-overload-signatures": "warn",
4
+ "@typescript-eslint/array-type": "warn",
5
+ "@typescript-eslint/await-thenable": "warn",
6
+ "@typescript-eslint/ban-ts-comment": [
7
+ "warn",
8
+ { minimumDescriptionLength: 10 }
9
+ ],
10
+ "@typescript-eslint/ban-tslint-comment": "warn",
11
+ "@typescript-eslint/class-literal-property-style": "warn",
12
+ "@typescript-eslint/consistent-generic-constructors": "warn",
13
+ "@typescript-eslint/consistent-indexed-object-style": "warn",
14
+ "@typescript-eslint/consistent-type-assertions": "warn",
15
+ "@typescript-eslint/consistent-type-definitions": "warn",
16
+ "@typescript-eslint/consistent-type-exports": [
17
+ "warn",
18
+ { fixMixedExportsWithInlineTypeSpecifier: true }
19
+ ],
20
+ "@typescript-eslint/consistent-type-imports": [
21
+ "warn",
22
+ {
23
+ fixStyle: "inline-type-imports",
24
+ prefer: "type-imports"
25
+ }
26
+ ],
27
+ "@typescript-eslint/dot-notation": "warn",
28
+ "@typescript-eslint/no-array-constructor": "warn",
29
+ "@typescript-eslint/no-array-delete": "warn",
30
+ "@typescript-eslint/no-base-to-string": "warn",
31
+ "@typescript-eslint/no-confusing-non-null-assertion": "warn",
32
+ "@typescript-eslint/no-confusing-void-expression": "warn",
33
+ "@typescript-eslint/no-deprecated": "warn",
34
+ "@typescript-eslint/no-duplicate-enum-values": "warn",
35
+ "@typescript-eslint/no-duplicate-type-constituents": "warn",
36
+ "@typescript-eslint/no-dynamic-delete": "warn",
37
+ "@typescript-eslint/no-empty-function": "warn",
38
+ "@typescript-eslint/no-empty-object-type": "warn",
39
+ "@typescript-eslint/no-explicit-any": "warn",
40
+ "@typescript-eslint/no-extra-non-null-assertion": "warn",
41
+ "@typescript-eslint/no-extraneous-class": "warn",
42
+ "@typescript-eslint/no-floating-promises": "warn",
43
+ "@typescript-eslint/no-for-in-array": "warn",
44
+ "@typescript-eslint/no-implied-eval": "warn",
45
+ "@typescript-eslint/no-import-type-side-effects": "warn",
46
+ "@typescript-eslint/no-inferrable-types": "warn",
47
+ "@typescript-eslint/no-invalid-void-type": "warn",
48
+ "@typescript-eslint/no-meaningless-void-operator": "warn",
49
+ "@typescript-eslint/no-misused-new": "warn",
50
+ "@typescript-eslint/no-misused-promises": "warn",
51
+ "@typescript-eslint/no-mixed-enums": "warn",
52
+ "@typescript-eslint/no-namespace": "warn",
53
+ "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "warn",
54
+ "@typescript-eslint/no-non-null-asserted-optional-chain": "warn",
55
+ "@typescript-eslint/no-non-null-assertion": "warn",
56
+ "@typescript-eslint/no-redundant-type-constituents": "warn",
57
+ "@typescript-eslint/no-require-imports": "warn",
58
+ "@typescript-eslint/no-this-alias": "warn",
59
+ "@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn",
60
+ "@typescript-eslint/no-unnecessary-condition": "warn",
61
+ "@typescript-eslint/no-unnecessary-template-expression": "warn",
62
+ "@typescript-eslint/no-unnecessary-type-arguments": "warn",
63
+ "@typescript-eslint/no-unnecessary-type-assertion": "warn",
64
+ "@typescript-eslint/no-unnecessary-type-constraint": "warn",
65
+ "@typescript-eslint/no-unnecessary-type-parameters": "warn",
66
+ "@typescript-eslint/no-unsafe-declaration-merging": "warn",
67
+ "@typescript-eslint/no-unsafe-enum-comparison": "warn",
68
+ "@typescript-eslint/no-unsafe-function-type": "warn",
69
+ "@typescript-eslint/no-unsafe-unary-minus": "warn",
70
+ "@typescript-eslint/no-unused-expressions": "warn",
71
+ "@typescript-eslint/no-unused-vars": [
72
+ "warn",
73
+ {
74
+ args: "after-used",
75
+ argsIgnorePattern: "^_",
76
+ ignoreRestSiblings: false,
77
+ vars: "all",
78
+ varsIgnorePattern: "^_"
79
+ }
80
+ ],
81
+ "@typescript-eslint/no-useless-constructor": "warn",
82
+ "@typescript-eslint/no-wrapper-object-types": "warn",
83
+ "@typescript-eslint/non-nullable-type-assertion-style": "warn",
84
+ "@typescript-eslint/only-throw-error": "warn",
85
+ "@typescript-eslint/prefer-as-const": "warn",
86
+ "@typescript-eslint/prefer-find": "warn",
87
+ "@typescript-eslint/prefer-for-of": "warn",
88
+ "@typescript-eslint/prefer-function-type": "warn",
89
+ "@typescript-eslint/prefer-includes": "warn",
90
+ "@typescript-eslint/prefer-literal-enum-member": "warn",
91
+ "@typescript-eslint/prefer-namespace-keyword": "warn",
92
+ "@typescript-eslint/prefer-nullish-coalescing": "warn",
93
+ "@typescript-eslint/prefer-optional-chain": "warn",
94
+ "@typescript-eslint/prefer-promise-reject-errors": "warn",
95
+ "@typescript-eslint/prefer-reduce-type-parameter": "warn",
96
+ "@typescript-eslint/prefer-regexp-exec": "warn",
97
+ "@typescript-eslint/prefer-return-this-type": "warn",
98
+ "@typescript-eslint/prefer-string-starts-ends-with": "warn",
99
+ "@typescript-eslint/related-getter-setter-pairs": "warn",
100
+ "@typescript-eslint/require-await": "warn",
101
+ "@typescript-eslint/restrict-plus-operands": [
102
+ "warn",
103
+ {
104
+ allowAny: false,
105
+ allowBoolean: false,
106
+ allowNullish: false,
107
+ allowNumberAndString: false,
108
+ allowRegExp: false
109
+ }
110
+ ],
111
+ "@typescript-eslint/restrict-template-expressions": [
112
+ "warn",
113
+ {
114
+ allowAny: false,
115
+ allowBoolean: false,
116
+ allowNever: false,
117
+ allowNullish: false,
118
+ allowNumber: false,
119
+ allowRegExp: false
120
+ }
121
+ ],
122
+ "@typescript-eslint/return-await": [
123
+ "warn",
124
+ "error-handling-correctness-only"
125
+ ],
126
+ "@typescript-eslint/triple-slash-reference": "warn",
127
+ "@typescript-eslint/unbound-method": "warn",
128
+ "@typescript-eslint/unified-signatures": "warn",
129
+ "@typescript-eslint/use-unknown-in-catch-callback-variable": "warn",
130
+ "dot-notation": "off",
131
+ "no-empty-function": "off"
132
+ };
133
+
134
+ export {
135
+ tseslintRules
136
+ };
137
+ //# sourceMappingURL=chunk-AL3W54BT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/eslint/typescript/rules.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\n\nexport const tseslintRules: Linter.RulesRecord = {\n \"@typescript-eslint/adjacent-overload-signatures\": \"warn\",\n \"@typescript-eslint/array-type\": \"warn\",\n \"@typescript-eslint/await-thenable\": \"warn\",\n \"@typescript-eslint/ban-ts-comment\": [\n \"warn\",\n { minimumDescriptionLength: 10 },\n ],\n \"@typescript-eslint/ban-tslint-comment\": \"warn\",\n \"@typescript-eslint/class-literal-property-style\": \"warn\",\n \"@typescript-eslint/consistent-generic-constructors\": \"warn\",\n \"@typescript-eslint/consistent-indexed-object-style\": \"warn\",\n \"@typescript-eslint/consistent-type-assertions\": \"warn\",\n \"@typescript-eslint/consistent-type-definitions\": \"warn\",\n \"@typescript-eslint/consistent-type-exports\": [\n \"warn\",\n { fixMixedExportsWithInlineTypeSpecifier: true },\n ],\n \"@typescript-eslint/consistent-type-imports\": [\n \"warn\",\n {\n fixStyle: \"inline-type-imports\",\n prefer: \"type-imports\",\n },\n ],\n \"@typescript-eslint/dot-notation\": \"warn\",\n \"@typescript-eslint/no-array-constructor\": \"warn\",\n \"@typescript-eslint/no-array-delete\": \"warn\",\n \"@typescript-eslint/no-base-to-string\": \"warn\",\n \"@typescript-eslint/no-confusing-non-null-assertion\": \"warn\",\n \"@typescript-eslint/no-confusing-void-expression\": \"warn\",\n \"@typescript-eslint/no-deprecated\": \"warn\",\n \"@typescript-eslint/no-duplicate-enum-values\": \"warn\",\n \"@typescript-eslint/no-duplicate-type-constituents\": \"warn\",\n \"@typescript-eslint/no-dynamic-delete\": \"warn\",\n \"@typescript-eslint/no-empty-function\": \"warn\",\n \"@typescript-eslint/no-empty-object-type\": \"warn\",\n \"@typescript-eslint/no-explicit-any\": \"warn\",\n \"@typescript-eslint/no-extra-non-null-assertion\": \"warn\",\n \"@typescript-eslint/no-extraneous-class\": \"warn\",\n \"@typescript-eslint/no-floating-promises\": \"warn\",\n \"@typescript-eslint/no-for-in-array\": \"warn\",\n \"@typescript-eslint/no-implied-eval\": \"warn\",\n \"@typescript-eslint/no-import-type-side-effects\": \"warn\",\n \"@typescript-eslint/no-inferrable-types\": \"warn\",\n \"@typescript-eslint/no-invalid-void-type\": \"warn\",\n \"@typescript-eslint/no-meaningless-void-operator\": \"warn\",\n \"@typescript-eslint/no-misused-new\": \"warn\",\n \"@typescript-eslint/no-misused-promises\": \"warn\",\n \"@typescript-eslint/no-mixed-enums\": \"warn\",\n \"@typescript-eslint/no-namespace\": \"warn\",\n \"@typescript-eslint/no-non-null-asserted-nullish-coalescing\": \"warn\",\n \"@typescript-eslint/no-non-null-asserted-optional-chain\": \"warn\",\n \"@typescript-eslint/no-non-null-assertion\": \"warn\",\n \"@typescript-eslint/no-redundant-type-constituents\": \"warn\",\n \"@typescript-eslint/no-require-imports\": \"warn\",\n \"@typescript-eslint/no-this-alias\": \"warn\",\n \"@typescript-eslint/no-unnecessary-boolean-literal-compare\": \"warn\",\n \"@typescript-eslint/no-unnecessary-condition\": \"warn\",\n \"@typescript-eslint/no-unnecessary-template-expression\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-arguments\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-assertion\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-constraint\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-parameters\": \"warn\",\n \"@typescript-eslint/no-unsafe-declaration-merging\": \"warn\",\n \"@typescript-eslint/no-unsafe-enum-comparison\": \"warn\",\n \"@typescript-eslint/no-unsafe-function-type\": \"warn\",\n \"@typescript-eslint/no-unsafe-unary-minus\": \"warn\",\n \"@typescript-eslint/no-unused-expressions\": \"warn\",\n \"@typescript-eslint/no-unused-vars\": [\n \"warn\",\n {\n args: \"after-used\",\n argsIgnorePattern: \"^_\",\n ignoreRestSiblings: false,\n vars: \"all\",\n varsIgnorePattern: \"^_\",\n },\n ],\n \"@typescript-eslint/no-useless-constructor\": \"warn\",\n \"@typescript-eslint/no-wrapper-object-types\": \"warn\",\n \"@typescript-eslint/non-nullable-type-assertion-style\": \"warn\",\n \"@typescript-eslint/only-throw-error\": \"warn\",\n \"@typescript-eslint/prefer-as-const\": \"warn\",\n \"@typescript-eslint/prefer-find\": \"warn\",\n \"@typescript-eslint/prefer-for-of\": \"warn\",\n \"@typescript-eslint/prefer-function-type\": \"warn\",\n \"@typescript-eslint/prefer-includes\": \"warn\",\n \"@typescript-eslint/prefer-literal-enum-member\": \"warn\",\n \"@typescript-eslint/prefer-namespace-keyword\": \"warn\",\n \"@typescript-eslint/prefer-nullish-coalescing\": \"warn\",\n \"@typescript-eslint/prefer-optional-chain\": \"warn\",\n \"@typescript-eslint/prefer-promise-reject-errors\": \"warn\",\n \"@typescript-eslint/prefer-reduce-type-parameter\": \"warn\",\n \"@typescript-eslint/prefer-regexp-exec\": \"warn\",\n \"@typescript-eslint/prefer-return-this-type\": \"warn\",\n \"@typescript-eslint/prefer-string-starts-ends-with\": \"warn\",\n \"@typescript-eslint/related-getter-setter-pairs\": \"warn\",\n \"@typescript-eslint/require-await\": \"warn\",\n \"@typescript-eslint/restrict-plus-operands\": [\n \"warn\",\n {\n allowAny: false,\n allowBoolean: false,\n allowNullish: false,\n allowNumberAndString: false,\n allowRegExp: false,\n },\n ],\n \"@typescript-eslint/restrict-template-expressions\": [\n \"warn\",\n {\n allowAny: false,\n allowBoolean: false,\n allowNever: false,\n allowNullish: false,\n allowNumber: false,\n allowRegExp: false,\n },\n ],\n \"@typescript-eslint/return-await\": [\n \"warn\",\n \"error-handling-correctness-only\",\n ],\n \"@typescript-eslint/triple-slash-reference\": \"warn\",\n \"@typescript-eslint/unbound-method\": \"warn\",\n \"@typescript-eslint/unified-signatures\": \"warn\",\n \"@typescript-eslint/use-unknown-in-catch-callback-variable\": \"warn\",\n \"dot-notation\": \"off\",\n \"no-empty-function\": \"off\",\n};\n"],"mappings":"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","names":[]}
@@ -0,0 +1,45 @@
1
+ import {
2
+ baseEslintConfig
3
+ } from "./chunk-3H3TV7WG.js";
4
+ import {
5
+ reactEslintConfig
6
+ } from "./chunk-YS5XHQB5.js";
7
+ import {
8
+ perfectionistConfig
9
+ } from "./chunk-IOVQNUC6.js";
10
+ import {
11
+ tseslintConfig
12
+ } from "./chunk-GZC424B7.js";
13
+ import {
14
+ ignoresConfig
15
+ } from "./chunk-Q3UZX7NT.js";
16
+
17
+ // src/eslint/index.ts
18
+ var eslintConfig = (options = {}) => {
19
+ const {
20
+ functionStyle = "arrow",
21
+ ignores = [],
22
+ react = false,
23
+ sorting = true,
24
+ typescript = true
25
+ } = options;
26
+ const configs = [
27
+ ignoresConfig(ignores),
28
+ baseEslintConfig(functionStyle)
29
+ ];
30
+ if (typescript) {
31
+ configs.push(...tseslintConfig);
32
+ }
33
+ if (react) {
34
+ configs.push(reactEslintConfig(functionStyle, typescript));
35
+ }
36
+ if (sorting) {
37
+ configs.push(perfectionistConfig);
38
+ }
39
+ return configs;
40
+ };
41
+
42
+ export {
43
+ eslintConfig
44
+ };
45
+ //# sourceMappingURL=chunk-EQOUQWIX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/eslint/index.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\n\nimport type { FunctionStyle } from \"../types.js\";\n\nimport { ignoresConfig } from \"./ignores.js\";\nimport { baseEslintConfig } from \"./javascript/config.js\";\nimport { perfectionistConfig } from \"./perfectionist/config.js\";\nimport { reactEslintConfig } from \"./react/config.js\";\nimport { tseslintConfig } from \"./typescript/config.js\";\n\nexport interface EslintConfigOptions {\n functionStyle?: FunctionStyle;\n ignores?: string[];\n import?: boolean;\n react?: boolean;\n sorting?: boolean;\n typescript?: boolean;\n}\n\n/**\n * This function configures your ESLint config based on inputs. It accepts a configuration object with the following properties:\n *\n * @param options\n * @param options.functionStyle - The function style to use. Defaults to \"arrow\".\n * @param options.ignores - An array of paths to ignore. Already excludes `node_modules` and `dist`.\n * @param options.react - Whether to include React rules. Defaults to false.\n * @param options.sorting - Whether to include sorting rules from Perfectionist. Defaults to true.\n * @param options.typescript - Whether to include TypeScript rules. Defaults to true.\n * @returns The ESLint configuration array.\n */\nexport const eslintConfig = (\n options: EslintConfigOptions = {},\n): Linter.Config[] => {\n const {\n functionStyle = \"arrow\",\n ignores = [],\n react = false,\n sorting = true,\n typescript = true,\n } = options;\n\n const configs: Linter.Config[] = [\n ignoresConfig(ignores),\n baseEslintConfig(functionStyle),\n ];\n\n if (typescript) {\n configs.push(...(tseslintConfig as Linter.Config[]));\n }\n\n if (react) {\n configs.push(reactEslintConfig(functionStyle, typescript));\n }\n\n if (sorting) {\n configs.push(perfectionistConfig);\n }\n\n return configs;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA8BO,IAAM,eAAe,CAC1B,UAA+B,CAAC,MACZ;AACpB,QAAM;AAAA,IACJ,gBAAgB;AAAA,IAChB,UAAU,CAAC;AAAA,IACX,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,aAAa;AAAA,EACf,IAAI;AAEJ,QAAM,UAA2B;AAAA,IAC/B,cAAc,OAAO;AAAA,IACrB,iBAAiB,aAAa;AAAA,EAChC;AAEA,MAAI,YAAY;AACd,YAAQ,KAAK,GAAI,cAAkC;AAAA,EACrD;AAEA,MAAI,OAAO;AACT,YAAQ,KAAK,kBAAkB,eAAe,UAAU,CAAC;AAAA,EAC3D;AAEA,MAAI,SAAS;AACX,YAAQ,KAAK,mBAAmB;AAAA,EAClC;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-ETHEVVRU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,32 @@
1
+ // src/eslint/perfectionist/rules.ts
2
+ var defaultOptions = {
3
+ order: "asc",
4
+ type: "natural"
5
+ };
6
+ var perfectionistRules = {
7
+ "perfectionist/sort-array-includes": ["warn", defaultOptions],
8
+ "perfectionist/sort-classes": ["warn", defaultOptions],
9
+ "perfectionist/sort-decorators": ["warn", defaultOptions],
10
+ "perfectionist/sort-enums": ["warn", defaultOptions],
11
+ "perfectionist/sort-exports": ["warn", defaultOptions],
12
+ "perfectionist/sort-heritage-clauses": ["warn", defaultOptions],
13
+ "perfectionist/sort-imports": ["warn", defaultOptions],
14
+ "perfectionist/sort-interfaces": ["warn", defaultOptions],
15
+ "perfectionist/sort-intersection-types": ["warn", defaultOptions],
16
+ "perfectionist/sort-jsx-props": ["warn", defaultOptions],
17
+ "perfectionist/sort-maps": ["warn", defaultOptions],
18
+ "perfectionist/sort-modules": ["off", defaultOptions],
19
+ "perfectionist/sort-named-exports": ["warn", defaultOptions],
20
+ "perfectionist/sort-named-imports": ["warn", defaultOptions],
21
+ "perfectionist/sort-object-types": ["warn", defaultOptions],
22
+ "perfectionist/sort-objects": ["warn", defaultOptions],
23
+ "perfectionist/sort-sets": ["warn", defaultOptions],
24
+ "perfectionist/sort-switch-case": ["warn", defaultOptions],
25
+ "perfectionist/sort-union-types": ["warn", defaultOptions],
26
+ "perfectionist/sort-variable-declarations": ["warn", defaultOptions]
27
+ };
28
+
29
+ export {
30
+ perfectionistRules
31
+ };
32
+ //# sourceMappingURL=chunk-GE5ZPFK5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/eslint/perfectionist/rules.ts"],"sourcesContent":["import type { EslintRuleConfig } from \"../../types.js\";\n\ninterface PerfectionistRuleOptions {\n order: \"asc\" | \"desc\";\n type: \"alphabetical\" | \"custom\" | \"line-length\" | \"natural\";\n}\n\nconst defaultOptions: PerfectionistRuleOptions = {\n order: \"asc\",\n type: \"natural\",\n};\n\ntype PerfectionRules = Record<\n `perfectionist/${string}`,\n EslintRuleConfig<PerfectionistRuleOptions>\n>;\n\nexport const perfectionistRules: PerfectionRules = {\n \"perfectionist/sort-array-includes\": [\"warn\", defaultOptions],\n \"perfectionist/sort-classes\": [\"warn\", defaultOptions],\n \"perfectionist/sort-decorators\": [\"warn\", defaultOptions],\n \"perfectionist/sort-enums\": [\"warn\", defaultOptions],\n \"perfectionist/sort-exports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-heritage-clauses\": [\"warn\", defaultOptions],\n \"perfectionist/sort-imports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-interfaces\": [\"warn\", defaultOptions],\n \"perfectionist/sort-intersection-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-jsx-props\": [\"warn\", defaultOptions],\n \"perfectionist/sort-maps\": [\"warn\", defaultOptions],\n \"perfectionist/sort-modules\": [\"off\", defaultOptions],\n \"perfectionist/sort-named-exports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-named-imports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-object-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-objects\": [\"warn\", defaultOptions],\n \"perfectionist/sort-sets\": [\"warn\", defaultOptions],\n \"perfectionist/sort-switch-case\": [\"warn\", defaultOptions],\n \"perfectionist/sort-union-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-variable-declarations\": [\"warn\", defaultOptions],\n};\n"],"mappings":";AAOA,IAAM,iBAA2C;AAAA,EAC/C,OAAO;AAAA,EACP,MAAM;AACR;AAOO,IAAM,qBAAsC;AAAA,EACjD,qCAAqC,CAAC,QAAQ,cAAc;AAAA,EAC5D,8BAA8B,CAAC,QAAQ,cAAc;AAAA,EACrD,iCAAiC,CAAC,QAAQ,cAAc;AAAA,EACxD,4BAA4B,CAAC,QAAQ,cAAc;AAAA,EACnD,8BAA8B,CAAC,QAAQ,cAAc;AAAA,EACrD,uCAAuC,CAAC,QAAQ,cAAc;AAAA,EAC9D,8BAA8B,CAAC,QAAQ,cAAc;AAAA,EACrD,iCAAiC,CAAC,QAAQ,cAAc;AAAA,EACxD,yCAAyC,CAAC,QAAQ,cAAc;AAAA,EAChE,gCAAgC,CAAC,QAAQ,cAAc;AAAA,EACvD,2BAA2B,CAAC,QAAQ,cAAc;AAAA,EAClD,8BAA8B,CAAC,OAAO,cAAc;AAAA,EACpD,oCAAoC,CAAC,QAAQ,cAAc;AAAA,EAC3D,oCAAoC,CAAC,QAAQ,cAAc;AAAA,EAC3D,mCAAmC,CAAC,QAAQ,cAAc;AAAA,EAC1D,8BAA8B,CAAC,QAAQ,cAAc;AAAA,EACrD,2BAA2B,CAAC,QAAQ,cAAc;AAAA,EAClD,kCAAkC,CAAC,QAAQ,cAAc;AAAA,EACzD,kCAAkC,CAAC,QAAQ,cAAc;AAAA,EACzD,4CAA4C,CAAC,QAAQ,cAAc;AACrE;","names":[]}
@@ -0,0 +1,36 @@
1
+ import {
2
+ tseslintRules
3
+ } from "./chunk-AL3W54BT.js";
4
+ import {
5
+ configNames
6
+ } from "./chunk-W56QT6S7.js";
7
+
8
+ // src/eslint/typescript/config.ts
9
+ import tseslint from "typescript-eslint";
10
+ var tseslintConfig = tseslint.config(
11
+ {
12
+ files: ["**/*.{js,cjs,mjs,ts,jsx,tsx}"],
13
+ languageOptions: {
14
+ parser: tseslint.parser,
15
+ parserOptions: {
16
+ projectService: true,
17
+ tsconfigRootDir: import.meta.dirname
18
+ }
19
+ },
20
+ name: configNames.typescript,
21
+ plugins: {
22
+ "@typescript-eslint": tseslint.plugin
23
+ },
24
+ rules: tseslintRules
25
+ },
26
+ {
27
+ // disable type-aware linting on JS files
28
+ extends: [tseslint.configs.disableTypeChecked],
29
+ files: ["**/*.js"]
30
+ }
31
+ );
32
+
33
+ export {
34
+ tseslintConfig
35
+ };
36
+ //# sourceMappingURL=chunk-GZC424B7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/eslint/typescript/config.ts"],"sourcesContent":["import tseslint, { type Config } from \"typescript-eslint\";\n\nimport { configNames } from \"../constants.js\";\nimport { tseslintRules } from \"./rules.js\";\n\nexport const tseslintConfig: Config = tseslint.config(\n {\n files: [\"**/*.{js,cjs,mjs,ts,jsx,tsx}\"],\n languageOptions: {\n parser: tseslint.parser,\n parserOptions: {\n projectService: true,\n tsconfigRootDir: import.meta.dirname,\n },\n },\n name: configNames.typescript,\n plugins: {\n \"@typescript-eslint\": tseslint.plugin,\n },\n rules: tseslintRules,\n },\n {\n // disable type-aware linting on JS files\n extends: [tseslint.configs.disableTypeChecked],\n files: [\"**/*.js\"],\n },\n);\n"],"mappings":";;;;;;;;AAAA,OAAO,cAA+B;AAK/B,IAAM,iBAAyB,SAAS;AAAA,EAC7C;AAAA,IACE,OAAO,CAAC,8BAA8B;AAAA,IACtC,iBAAiB;AAAA,MACf,QAAQ,SAAS;AAAA,MACjB,eAAe;AAAA,QACb,gBAAgB;AAAA,QAChB,iBAAiB,YAAY;AAAA,MAC/B;AAAA,IACF;AAAA,IACA,MAAM,YAAY;AAAA,IAClB,SAAS;AAAA,MACP,sBAAsB,SAAS;AAAA,IACjC;AAAA,IACA,OAAO;AAAA,EACT;AAAA,EACA;AAAA;AAAA,IAEE,SAAS,CAAC,SAAS,QAAQ,kBAAkB;AAAA,IAC7C,OAAO,CAAC,SAAS;AAAA,EACnB;AACF;","names":[]}
@@ -0,0 +1,21 @@
1
+ import {
2
+ perfectionistRules
3
+ } from "./chunk-GE5ZPFK5.js";
4
+ import {
5
+ configNames
6
+ } from "./chunk-W56QT6S7.js";
7
+
8
+ // src/eslint/perfectionist/config.ts
9
+ import perfectionist from "eslint-plugin-perfectionist";
10
+ var perfectionistConfig = {
11
+ name: configNames.perfectionist,
12
+ plugins: {
13
+ perfectionist
14
+ },
15
+ rules: perfectionistRules
16
+ };
17
+
18
+ export {
19
+ perfectionistConfig
20
+ };
21
+ //# sourceMappingURL=chunk-IOVQNUC6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/eslint/perfectionist/config.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\n\nimport perfectionist from \"eslint-plugin-perfectionist\";\n\nimport { configNames } from \"../constants.js\";\nimport { perfectionistRules } from \"./rules.js\";\n\nexport const perfectionistConfig: Linter.Config = {\n name: configNames.perfectionist,\n plugins: {\n perfectionist,\n },\n rules: perfectionistRules,\n};\n"],"mappings":";;;;;;;;AAEA,OAAO,mBAAmB;AAKnB,IAAM,sBAAqC;AAAA,EAChD,MAAM,YAAY;AAAA,EAClB,SAAS;AAAA,IACP;AAAA,EACF;AAAA,EACA,OAAO;AACT;","names":[]}