@giladgd/eslint-config 0.0.0-stage → 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 (135) hide show
  1. package/LICENSE +21 -0
  2. package/dist/giladgdEslint.d.ts +41 -0
  3. package/dist/giladgdEslint.d.ts.map +1 -0
  4. package/dist/giladgdEslint.js +312 -0
  5. package/dist/giladgdEslint.js.map +1 -0
  6. package/dist/index.d.ts +4 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +4 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/plugin.d.ts +53 -0
  11. package/dist/plugin.d.ts.map +1 -0
  12. package/dist/plugin.js +54 -0
  13. package/dist/plugin.js.map +1 -0
  14. package/dist/resolveIgnoreFile.d.ts +7 -0
  15. package/dist/resolveIgnoreFile.d.ts.map +1 -0
  16. package/dist/resolveIgnoreFile.js +32 -0
  17. package/dist/resolveIgnoreFile.js.map +1 -0
  18. package/dist/rules/blank-line-after-control-flow/blank-line-after-control-flow.d.ts +3 -0
  19. package/dist/rules/blank-line-after-control-flow/blank-line-after-control-flow.d.ts.map +1 -0
  20. package/dist/rules/blank-line-after-control-flow/blank-line-after-control-flow.js +99 -0
  21. package/dist/rules/blank-line-after-control-flow/blank-line-after-control-flow.js.map +1 -0
  22. package/dist/rules/blank-line-before-jsdoc-default/blank-line-before-jsdoc-default.d.ts +3 -0
  23. package/dist/rules/blank-line-before-jsdoc-default/blank-line-before-jsdoc-default.d.ts.map +1 -0
  24. package/dist/rules/blank-line-before-jsdoc-default/blank-line-before-jsdoc-default.js +127 -0
  25. package/dist/rules/blank-line-before-jsdoc-default/blank-line-before-jsdoc-default.js.map +1 -0
  26. package/dist/rules/blank-line-before-line-comment/blank-line-before-line-comment.d.ts +3 -0
  27. package/dist/rules/blank-line-before-line-comment/blank-line-before-line-comment.d.ts.map +1 -0
  28. package/dist/rules/blank-line-before-line-comment/blank-line-before-line-comment.js +70 -0
  29. package/dist/rules/blank-line-before-line-comment/blank-line-before-line-comment.js.map +1 -0
  30. package/dist/rules/newline-per-chained-call/newline-per-chained-call.d.ts +92 -0
  31. package/dist/rules/newline-per-chained-call/newline-per-chained-call.d.ts.map +1 -0
  32. package/dist/rules/newline-per-chained-call/newline-per-chained-call.js +241 -0
  33. package/dist/rules/newline-per-chained-call/newline-per-chained-call.js.map +1 -0
  34. package/dist/rules/no-simple-template-literals/no-simple-template-literals.d.ts +3 -0
  35. package/dist/rules/no-simple-template-literals/no-simple-template-literals.d.ts.map +1 -0
  36. package/dist/rules/no-simple-template-literals/no-simple-template-literals.js +343 -0
  37. package/dist/rules/no-simple-template-literals/no-simple-template-literals.js.map +1 -0
  38. package/dist/rules/pack-import-specifiers/pack-import-specifiers.d.ts +3 -0
  39. package/dist/rules/pack-import-specifiers/pack-import-specifiers.d.ts.map +1 -0
  40. package/dist/rules/pack-import-specifiers/pack-import-specifiers.js +102 -0
  41. package/dist/rules/pack-import-specifiers/pack-import-specifiers.js.map +1 -0
  42. package/dist/rules/parenthesize-arrow-bodies/parenthesize-arrow-bodies.d.ts +3 -0
  43. package/dist/rules/parenthesize-arrow-bodies/parenthesize-arrow-bodies.d.ts.map +1 -0
  44. package/dist/rules/parenthesize-arrow-bodies/parenthesize-arrow-bodies.js +144 -0
  45. package/dist/rules/parenthesize-arrow-bodies/parenthesize-arrow-bodies.js.map +1 -0
  46. package/dist/rules/parenthesize-ternary-conditions/parenthesize-ternary-conditions.d.ts +3 -0
  47. package/dist/rules/parenthesize-ternary-conditions/parenthesize-ternary-conditions.d.ts.map +1 -0
  48. package/dist/rules/parenthesize-ternary-conditions/parenthesize-ternary-conditions.js +81 -0
  49. package/dist/rules/parenthesize-ternary-conditions/parenthesize-ternary-conditions.js.map +1 -0
  50. package/dist/rules/prefer-else-if-after-exit/prefer-else-if-after-exit.d.ts +3 -0
  51. package/dist/rules/prefer-else-if-after-exit/prefer-else-if-after-exit.d.ts.map +1 -0
  52. package/dist/rules/prefer-else-if-after-exit/prefer-else-if-after-exit.js +77 -0
  53. package/dist/rules/prefer-else-if-after-exit/prefer-else-if-after-exit.js.map +1 -0
  54. package/dist/rules/prefer-generic-multiline-arrays/prefer-generic-multiline-arrays.d.ts +3 -0
  55. package/dist/rules/prefer-generic-multiline-arrays/prefer-generic-multiline-arrays.d.ts.map +1 -0
  56. package/dist/rules/prefer-generic-multiline-arrays/prefer-generic-multiline-arrays.js +42 -0
  57. package/dist/rules/prefer-generic-multiline-arrays/prefer-generic-multiline-arrays.js.map +1 -0
  58. package/dist/rules/require-default-imports/hasSameExport.d.ts +5 -0
  59. package/dist/rules/require-default-imports/hasSameExport.d.ts.map +1 -0
  60. package/dist/rules/require-default-imports/hasSameExport.js +53 -0
  61. package/dist/rules/require-default-imports/hasSameExport.js.map +1 -0
  62. package/dist/rules/require-default-imports/require-default-imports.d.ts +3 -0
  63. package/dist/rules/require-default-imports/require-default-imports.d.ts.map +1 -0
  64. package/dist/rules/require-default-imports/require-default-imports.js +180 -0
  65. package/dist/rules/require-default-imports/require-default-imports.js.map +1 -0
  66. package/dist/rules/require-using-locks/require-using-locks.d.ts +3 -0
  67. package/dist/rules/require-using-locks/require-using-locks.d.ts.map +1 -0
  68. package/dist/rules/require-using-locks/require-using-locks.js +68 -0
  69. package/dist/rules/require-using-locks/require-using-locks.js.map +1 -0
  70. package/dist/rules/require-zod-object-schemas/require-zod-object-schemas.d.ts +3 -0
  71. package/dist/rules/require-zod-object-schemas/require-zod-object-schemas.d.ts.map +1 -0
  72. package/dist/rules/require-zod-object-schemas/require-zod-object-schemas.js +36 -0
  73. package/dist/rules/require-zod-object-schemas/require-zod-object-schemas.js.map +1 -0
  74. package/dist/rules/wrap-long-ternaries/wrap-long-ternaries.d.ts +3 -0
  75. package/dist/rules/wrap-long-ternaries/wrap-long-ternaries.d.ts.map +1 -0
  76. package/dist/rules/wrap-long-ternaries/wrap-long-ternaries.js +167 -0
  77. package/dist/rules/wrap-long-ternaries/wrap-long-ternaries.js.map +1 -0
  78. package/dist/rules/wrap-multiline-arrays/wrap-multiline-arrays.d.ts +3 -0
  79. package/dist/rules/wrap-multiline-arrays/wrap-multiline-arrays.d.ts.map +1 -0
  80. package/dist/rules/wrap-multiline-arrays/wrap-multiline-arrays.js +64 -0
  81. package/dist/rules/wrap-multiline-arrays/wrap-multiline-arrays.js.map +1 -0
  82. package/dist/rules/wrap-multiline-if-conditions/wrap-multiline-if-conditions.d.ts +3 -0
  83. package/dist/rules/wrap-multiline-if-conditions/wrap-multiline-if-conditions.d.ts.map +1 -0
  84. package/dist/rules/wrap-multiline-if-conditions/wrap-multiline-if-conditions.js +61 -0
  85. package/dist/rules/wrap-multiline-if-conditions/wrap-multiline-if-conditions.js.map +1 -0
  86. package/dist/rules/wrap-multiline-parentheses/wrap-multiline-parentheses.d.ts +3 -0
  87. package/dist/rules/wrap-multiline-parentheses/wrap-multiline-parentheses.d.ts.map +1 -0
  88. package/dist/rules/wrap-multiline-parentheses/wrap-multiline-parentheses.js +72 -0
  89. package/dist/rules/wrap-multiline-parentheses/wrap-multiline-parentheses.js.map +1 -0
  90. package/dist/rules/wrap-multiline-tuple-types/wrap-multiline-tuple-types.d.ts +3 -0
  91. package/dist/rules/wrap-multiline-tuple-types/wrap-multiline-tuple-types.d.ts.map +1 -0
  92. package/dist/rules/wrap-multiline-tuple-types/wrap-multiline-tuple-types.js +34 -0
  93. package/dist/rules/wrap-multiline-tuple-types/wrap-multiline-tuple-types.js.map +1 -0
  94. package/dist/rules/wrap-object-literals/wrap-object-literals.d.ts +3 -0
  95. package/dist/rules/wrap-object-literals/wrap-object-literals.d.ts.map +1 -0
  96. package/dist/rules/wrap-object-literals/wrap-object-literals.js +90 -0
  97. package/dist/rules/wrap-object-literals/wrap-object-literals.js.map +1 -0
  98. package/dist/rules/wrap-object-types/wrap-object-types.d.ts +3 -0
  99. package/dist/rules/wrap-object-types/wrap-object-types.d.ts.map +1 -0
  100. package/dist/rules/wrap-object-types/wrap-object-types.js +105 -0
  101. package/dist/rules/wrap-object-types/wrap-object-types.js.map +1 -0
  102. package/dist/utils/createRule.d.ts +21 -0
  103. package/dist/utils/createRule.d.ts.map +1 -0
  104. package/dist/utils/createRule.js +17 -0
  105. package/dist/utils/createRule.js.map +1 -0
  106. package/dist/utils/getGenericArrayTypeChanges.d.ts +4 -0
  107. package/dist/utils/getGenericArrayTypeChanges.d.ts.map +1 -0
  108. package/dist/utils/getGenericArrayTypeChanges.js +43 -0
  109. package/dist/utils/getGenericArrayTypeChanges.js.map +1 -0
  110. package/dist/utils/getImportedBinding.d.ts +11 -0
  111. package/dist/utils/getImportedBinding.d.ts.map +1 -0
  112. package/dist/utils/getImportedBinding.js +18 -0
  113. package/dist/utils/getImportedBinding.js.map +1 -0
  114. package/dist/utils/getLineWidth.d.ts +2 -0
  115. package/dist/utils/getLineWidth.d.ts.map +1 -0
  116. package/dist/utils/getLineWidth.js +9 -0
  117. package/dist/utils/getLineWidth.js.map +1 -0
  118. package/dist/utils/getParenthesisWrapChanges.d.ts +4 -0
  119. package/dist/utils/getParenthesisWrapChanges.d.ts.map +1 -0
  120. package/dist/utils/getParenthesisWrapChanges.js +24 -0
  121. package/dist/utils/getParenthesisWrapChanges.js.map +1 -0
  122. package/dist/utils/hasSimpleBranchAndArrayOrObjectFallback.d.ts +4 -0
  123. package/dist/utils/hasSimpleBranchAndArrayOrObjectFallback.d.ts.map +1 -0
  124. package/dist/utils/hasSimpleBranchAndArrayOrObjectFallback.js +15 -0
  125. package/dist/utils/hasSimpleBranchAndArrayOrObjectFallback.js.map +1 -0
  126. package/dist/utils/isLogicalArithmeticOrBitwiseExpression.d.ts +3 -0
  127. package/dist/utils/isLogicalArithmeticOrBitwiseExpression.d.ts.map +1 -0
  128. package/dist/utils/isLogicalArithmeticOrBitwiseExpression.js +9 -0
  129. package/dist/utils/isLogicalArithmeticOrBitwiseExpression.js.map +1 -0
  130. package/dist/utils/wrapDelimitedMembers.d.ts +8 -0
  131. package/dist/utils/wrapDelimitedMembers.d.ts.map +1 -0
  132. package/dist/utils/wrapDelimitedMembers.js +70 -0
  133. package/dist/utils/wrapDelimitedMembers.js.map +1 -0
  134. package/package.json +86 -4
  135. package/README.md +0 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Gilad S.
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.
@@ -0,0 +1,41 @@
1
+ import type { Linter } from "eslint";
2
+ export type GiladgdEslintOptions = {
3
+ /**
4
+ * Add browser globals and JSX formatting. Set to `"react"` to also enable React rules.
5
+ *
6
+ * Defaults to `false`.
7
+ */
8
+ web?: boolean | "react";
9
+ /**
10
+ * Enable type-aware rules. The TypeScript compiler analyzes each project, which can make linting much slower.
11
+ *
12
+ * Defaults to `true`.
13
+ */
14
+ typeChecked?: boolean;
15
+ /**
16
+ * Enable Bun built-in resolution in the TypeScript import resolver under Node.js.
17
+ *
18
+ * Defaults to `true`.
19
+ */
20
+ bun?: boolean;
21
+ /**
22
+ * Add the separate Node.js import resolver.
23
+ *
24
+ * Defaults to `true`.
25
+ */
26
+ node?: boolean;
27
+ /** Apply the preset where both these ESLint file patterns and its own patterns match. */
28
+ files?: Linter.Config["files"];
29
+ /** Global ESLint ignore globs, applied after patterns from `includeIgnoreFiles`. */
30
+ ignores?: readonly string[];
31
+ /** Paths to gitignore-style files. Resolve relative paths from the working directory and patterns from each file's directory. */
32
+ includeIgnoreFiles?: readonly string[];
33
+ /**
34
+ * Set the width for line length checks, import packing, and exceptions for ternaries and chained calls.
35
+ *
36
+ * Defaults to `140`.
37
+ */
38
+ maxLineWidth?: number;
39
+ };
40
+ export declare function giladgdEslint({ web, typeChecked, bun, node, files, ignores, includeIgnoreFiles, maxLineWidth }?: GiladgdEslintOptions): Linter.Config[];
41
+ //# sourceMappingURL=giladgdEslint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"giladgdEslint.d.ts","sourceRoot":"","sources":["../src/giladgdEslint.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,QAAQ,CAAC;AAOnC,MAAM,MAAM,oBAAoB,GAAG;IAC/B;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAExB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,yFAAyF;IACzF,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAE/B,oFAAoF;IACpF,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAE5B,iIAAiI;IACjI,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAEvC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACxB,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC1B,GAAW,EACX,WAAkB,EAClB,GAAU,EACV,IAAW,EACX,KAAK,EACL,OAAY,EACZ,kBAAuB,EACvB,YAAkB,EACrB,GAAE,oBAAyB,GAAG,MAAM,CAAC,MAAM,EAAE,CAmU7C"}
@@ -0,0 +1,312 @@
1
+ import { defineConfig, globalIgnores } from "eslint/config";
2
+ import { importX, createNodeResolver } from "eslint-plugin-import-x";
3
+ import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript";
4
+ import jsdoc from "eslint-plugin-jsdoc";
5
+ import n from "eslint-plugin-n";
6
+ import reactRefresh from "eslint-plugin-react-refresh";
7
+ import tseslint from "typescript-eslint";
8
+ import stylistic from "@stylistic/eslint-plugin";
9
+ import reactHooks from "eslint-plugin-react-hooks";
10
+ import globals from "globals";
11
+ import { plugin } from "./plugin.js";
12
+ import { resolveIgnoreFile } from "./resolveIgnoreFile.js";
13
+ const codeFiles = ["**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}"];
14
+ const typescriptFiles = ["**/*.{ts,mts,cts,tsx}"];
15
+ const jsxFiles = ["**/*.{j,t}sx"];
16
+ export function giladgdEslint({ web = false, typeChecked = true, bun = true, node = true, files, ignores = [], includeIgnoreFiles = [], maxLineWidth = 140 } = {}) {
17
+ const maxLengthOptions = {
18
+ code: maxLineWidth,
19
+ tabWidth: 4
20
+ };
21
+ function scopeFiles(patterns) {
22
+ return files?.flatMap((entry) => patterns.map((pattern) => [pattern].concat(entry))) ?? patterns;
23
+ }
24
+ const ignoreConfigs = includeIgnoreFiles.map(resolveIgnoreFile);
25
+ if (ignores.length > 0)
26
+ ignoreConfigs.push(globalIgnores([...ignores], "giladgd/ignores"));
27
+ const config = defineConfig(ignoreConfigs, {
28
+ name: "giladgd/base",
29
+ files: scopeFiles(codeFiles),
30
+ extends: [
31
+ stylistic.configs["recommended"],
32
+ jsdoc.configs["flat/recommended"],
33
+ importX.flatConfigs.recommended
34
+ ],
35
+ plugins: {
36
+ n,
37
+ giladgd: plugin
38
+ },
39
+ languageOptions: {
40
+ parser: tseslint.parser,
41
+ globals: {
42
+ Atomics: "readonly",
43
+ SharedArrayBuffer: "readonly"
44
+ },
45
+ ecmaVersion: "latest",
46
+ sourceType: "module"
47
+ },
48
+ settings: {
49
+ "import-x/resolver-next": [
50
+ createTypeScriptImportResolver({ bun }),
51
+ ...(node
52
+ ? [createNodeResolver({})]
53
+ : [])
54
+ ],
55
+ jsdoc: {
56
+ exemptDestructuredRootsFromChecks: true,
57
+ tagNamePreference: {
58
+ hidden: "hidden",
59
+ experimental: "experimental"
60
+ }
61
+ }
62
+ },
63
+ rules: {
64
+ "@stylistic/indent": ["warn", 4, {
65
+ SwitchCase: 1,
66
+ FunctionDeclaration: {
67
+ parameters: "first"
68
+ },
69
+ ignoredNodes: [
70
+ // Preserve the indentation of function expressions with object return types and no parameters.
71
+ 'FunctionExpression[params.length=0][returnType.type="TSTypeAnnotation"]'
72
+ ]
73
+ }],
74
+ "@stylistic/indent-binary-ops": ["warn", 4],
75
+ "@stylistic/quotes": ["warn", "double", { avoidEscape: true }],
76
+ "@stylistic/object-curly-spacing": ["warn", "never"],
77
+ "@stylistic/semi": ["warn", "always"],
78
+ "@stylistic/brace-style": ["warn", "1tbs", {
79
+ allowSingleLine: false
80
+ }],
81
+ "@stylistic/comma-spacing": ["warn", {
82
+ before: false,
83
+ after: true
84
+ }],
85
+ "@stylistic/comma-style": ["warn", "last"],
86
+ "@stylistic/comma-dangle": ["warn", "never"],
87
+ "@stylistic/no-confusing-arrow": ["warn"],
88
+ camelcase: ["warn", {
89
+ allow: ["\\d+_\\d+"]
90
+ }],
91
+ "@stylistic/keyword-spacing": ["warn"],
92
+ "@stylistic/space-infix-ops": ["warn"],
93
+ "@stylistic/spaced-comment": ["warn", "always", {
94
+ markers: ["/"]
95
+ }],
96
+ "@stylistic/eol-last": ["warn", "always"],
97
+ "@stylistic/max-len": ["warn", maxLengthOptions],
98
+ "@stylistic/arrow-parens": ["warn", "always"],
99
+ "@stylistic/lines-between-class-members": ["warn", {
100
+ enforce: [
101
+ { blankLine: "always", prev: "method", next: "*" },
102
+ { blankLine: "always", prev: "*", next: "method" }
103
+ ]
104
+ }],
105
+ "@stylistic/no-multi-spaces": ["warn"],
106
+ "@stylistic/block-spacing": ["warn", "never"],
107
+ "@stylistic/padded-blocks": ["warn"],
108
+ // "@stylistic/padding-line-between-statements": ["warn", {blankLine: "always", prev: "*", next: "return"}],
109
+ "no-unused-vars": ["warn", {
110
+ args: "none",
111
+ ignoreRestSiblings: true,
112
+ varsIgnorePattern: "^set",
113
+ caughtErrors: "none",
114
+ ignoreUsingDeclarations: true
115
+ }],
116
+ "no-duplicate-imports": ["warn", {
117
+ includeExports: true,
118
+ allowSeparateTypeImports: true
119
+ }],
120
+ "no-empty": ["warn", {
121
+ allowEmptyCatch: true
122
+ }],
123
+ "n/prefer-node-protocol": ["warn"],
124
+ "import-x/order": ["warn", {
125
+ groups: ["builtin", "external", "internal", "parent", "sibling", "index", "type", "object", "unknown"],
126
+ warnOnUnassignedImports: true
127
+ }],
128
+ "@stylistic/quote-props": ["off"],
129
+ "@stylistic/no-multiple-empty-lines": ["off"],
130
+ "@stylistic/operator-linebreak": ["off"],
131
+ "@stylistic/no-extra-parens": ["off"],
132
+ "@stylistic/multiline-ternary": ["off"],
133
+ "@stylistic/no-trailing-spaces": ["off"],
134
+ "@stylistic/generator-star-spacing": ["off"],
135
+ "@stylistic/newline-per-chained-call": ["off"],
136
+ "giladgd/no-simple-template-literals": ["warn"],
137
+ "giladgd/pack-import-specifiers": ["warn", { maxLineWidth }],
138
+ "giladgd/blank-line-after-control-flow": ["warn"],
139
+ "giladgd/blank-line-before-jsdoc-default": ["warn"],
140
+ "giladgd/blank-line-before-line-comment": ["warn"],
141
+ "giladgd/parenthesize-arrow-bodies": ["warn"],
142
+ "giladgd/parenthesize-ternary-conditions": ["warn"],
143
+ "giladgd/prefer-else-if-after-exit": ["warn"],
144
+ "giladgd/wrap-long-ternaries": ["warn", {
145
+ maxLength: {
146
+ total: 100,
147
+ target: { base: 16, enclosed: 48 }
148
+ },
149
+ maxLineWidth
150
+ }],
151
+ "giladgd/wrap-multiline-arrays": ["warn"],
152
+ "giladgd/wrap-multiline-if-conditions": ["warn"],
153
+ "giladgd/wrap-multiline-parentheses": ["warn"],
154
+ "giladgd/wrap-object-literals": ["warn"],
155
+ "giladgd/newline-per-chained-call": [
156
+ "warn",
157
+ {
158
+ ignoreChainWithDepth: 2,
159
+ tabWidth: 4,
160
+ overrides: [{
161
+ chainRoot: "z",
162
+ importedFrom: "zod",
163
+ maxLineLength: maxLineWidth,
164
+ ignoreChainWithDepth: 100
165
+ }, {
166
+ chainRoot: ["boolean", "integer", "text", "timestamp"],
167
+ importedFrom: "drizzle-orm/pg-core",
168
+ maxLineLength: maxLineWidth,
169
+ ignoreChainWithDepth: 100
170
+ }]
171
+ }
172
+ ],
173
+ "giladgd/require-default-imports": ["warn", {
174
+ modules: ["fs", "fs/promises", "path", "os", "net", "http", "https", "process", "crypto"]
175
+ .flatMap((name) => [name, "node:" + name])
176
+ }],
177
+ "no-var": ["error"],
178
+ "n/file-extension-in-import": ["error", "always"],
179
+ "no-const-assign": ["error"],
180
+ yoda: ["error", "never", {
181
+ exceptRange: true
182
+ }],
183
+ "no-eval": ["error"],
184
+ "array-callback-return": ["error"],
185
+ "giladgd/require-using-locks": ["error"],
186
+ "giladgd/require-zod-object-schemas": ["error"]
187
+ }
188
+ }, {
189
+ name: "giladgd/typescript",
190
+ files: scopeFiles(typescriptFiles),
191
+ extends: [
192
+ jsdoc.configs["flat/recommended-typescript"],
193
+ ...tseslint.configs.recommended
194
+ ],
195
+ rules: {
196
+ "@typescript-eslint/no-unused-vars": ["warn", {
197
+ args: "none",
198
+ ignoreRestSiblings: true,
199
+ varsIgnorePattern: "^set",
200
+ caughtErrors: "none",
201
+ ignoreUsingDeclarations: true
202
+ }],
203
+ "@typescript-eslint/member-ordering": ["warn", {
204
+ default: ["field", "constructor", "method", "signature"],
205
+ typeLiterals: []
206
+ }],
207
+ "@typescript-eslint/parameter-properties": ["warn", {
208
+ allow: []
209
+ }],
210
+ "@typescript-eslint/explicit-member-accessibility": ["warn"],
211
+ "@typescript-eslint/consistent-type-definitions": ["warn", "type"],
212
+ "giladgd/prefer-generic-multiline-arrays": "warn",
213
+ "giladgd/wrap-multiline-tuple-types": "warn",
214
+ "giladgd/wrap-object-types": "warn",
215
+ "@stylistic/member-delimiter-style": ["warn", {
216
+ multiline: {
217
+ delimiter: "comma",
218
+ requireLast: false
219
+ },
220
+ singleline: {
221
+ delimiter: "comma",
222
+ requireLast: false
223
+ },
224
+ multilineDetection: "brackets"
225
+ }],
226
+ "jsdoc/lines-before-block": ["warn", { ignoreSingleLines: true }],
227
+ "jsdoc/check-param-names": ["warn", {
228
+ checkDestructured: false
229
+ }],
230
+ "no-constant-condition": ["warn"],
231
+ "@typescript-eslint/explicit-module-boundary-types": ["off"],
232
+ "@typescript-eslint/ban-ts-comment": ["off"],
233
+ "@typescript-eslint/no-explicit-any": ["off"],
234
+ "@typescript-eslint/no-inferrable-types": ["off"],
235
+ "@typescript-eslint/no-empty-object-type": ["off"],
236
+ "jsdoc/require-param": ["off"],
237
+ "jsdoc/require-returns": ["off"],
238
+ "jsdoc/require-jsdoc": ["off"],
239
+ "jsdoc/require-yields": ["off"],
240
+ "jsdoc/require-param-description": ["off"],
241
+ "import-x/named": ["off"]
242
+ }
243
+ }, {
244
+ name: "giladgd/typescript/tests",
245
+ files: scopeFiles(["**/*.test.{ts,tsx}"]),
246
+ rules: {
247
+ "@stylistic/max-len": ["warn", {
248
+ ...maxLengthOptions,
249
+ ignoreStrings: true
250
+ }],
251
+ "giladgd/wrap-object-literals": ["warn", { minLength: 32 }],
252
+ "giladgd/wrap-object-types": ["warn", { minLength: 32 }]
253
+ }
254
+ });
255
+ if (typeChecked)
256
+ config.push(...defineConfig({
257
+ name: "giladgd/type-checked",
258
+ files: scopeFiles(typescriptFiles),
259
+ languageOptions: {
260
+ parserOptions: {
261
+ projectService: true
262
+ }
263
+ },
264
+ rules: {
265
+ "@typescript-eslint/no-floating-promises": ["warn"],
266
+ "@typescript-eslint/restrict-plus-operands": ["warn", {
267
+ allowBoolean: false,
268
+ allowNullish: false,
269
+ allowRegExp: false,
270
+ skipCompoundAssignments: false
271
+ }]
272
+ }
273
+ }));
274
+ if (web != null && web !== false)
275
+ config.push(...defineConfig({
276
+ name: "giladgd/web",
277
+ files: scopeFiles(codeFiles),
278
+ languageOptions: {
279
+ globals: globals.browser
280
+ }
281
+ }, {
282
+ name: "giladgd/jsx",
283
+ files: scopeFiles(jsxFiles),
284
+ rules: {
285
+ "@stylistic/jsx-quotes": ["warn"],
286
+ "@stylistic/jsx-wrap-multilines": ["off"],
287
+ "@stylistic/jsx-indent-props": ["warn", 4],
288
+ "@stylistic/jsx-closing-tag-location": ["warn", "line-aligned"],
289
+ "@stylistic/jsx-closing-bracket-location": ["warn", "line-aligned"],
290
+ "@stylistic/jsx-tag-spacing": ["warn"],
291
+ "@stylistic/jsx-one-expression-per-line": ["off"]
292
+ }
293
+ }));
294
+ if (web === "react")
295
+ config.push(...defineConfig({
296
+ name: "giladgd/react",
297
+ files: scopeFiles(codeFiles),
298
+ plugins: {
299
+ "react-hooks": reactHooks,
300
+ "react-refresh": reactRefresh
301
+ },
302
+ rules: {
303
+ ...reactHooks.configs.recommended.rules,
304
+ "react-refresh/only-export-components": ["warn", {
305
+ allowConstantExport: true
306
+ }],
307
+ "react-hooks/exhaustive-deps": ["off"]
308
+ }
309
+ }));
310
+ return config;
311
+ }
312
+ //# sourceMappingURL=giladgdEslint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"giladgdEslint.js","sourceRoot":"","sources":["../src/giladgdEslint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAC,OAAO,EAAE,kBAAkB,EAAC,MAAM,wBAAwB,CAAC;AACnE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K,EAAE;gBACH,GAAG,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK;gBAEvC,sCAAsC,EAAE,CAAC,MAAM,EAAE;wBAC7C,mBAAmB,EAAE,IAAI;qBAC5B,CAAC;gBAEF,6BAA6B,EAAE,CAAC,KAAK,CAAC;aACzC;SACJ,CAAC,CAAC,CAAC;IAER,OAAO,MAAM,CAAC;AAClB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { giladgdEslint, type GiladgdEslintOptions } from "./giladgdEslint.js";
2
+ export { plugin as default, plugin, rules } from "./plugin.js";
3
+ export { resolveIgnoreFile } from "./resolveIgnoreFile.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,KAAK,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAC,MAAM,IAAI,OAAO,EAAE,MAAM,EAAE,KAAK,EAAC,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export { giladgdEslint } from "./giladgdEslint.js";
2
+ export { plugin as default, plugin, rules } from "./plugin.js";
3
+ export { resolveIgnoreFile } from "./resolveIgnoreFile.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAA4B,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAC,MAAM,IAAI,OAAO,EAAE,MAAM,EAAE,KAAK,EAAC,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,53 @@
1
+ export declare const rules: {
2
+ "blank-line-after-control-flow": import("eslint").Rule.RuleModule;
3
+ "blank-line-before-jsdoc-default": import("eslint").Rule.RuleModule;
4
+ "blank-line-before-line-comment": import("eslint").Rule.RuleModule;
5
+ "newline-per-chained-call": import("eslint").Rule.RuleModule;
6
+ "no-simple-template-literals": import("eslint").Rule.RuleModule;
7
+ "pack-import-specifiers": import("eslint").Rule.RuleModule;
8
+ "parenthesize-arrow-bodies": import("eslint").Rule.RuleModule;
9
+ "parenthesize-ternary-conditions": import("eslint").Rule.RuleModule;
10
+ "prefer-else-if-after-exit": import("eslint").Rule.RuleModule;
11
+ "prefer-generic-multiline-arrays": import("eslint").Rule.RuleModule;
12
+ "require-default-imports": import("eslint").Rule.RuleModule;
13
+ "require-using-locks": import("eslint").Rule.RuleModule;
14
+ "require-zod-object-schemas": import("eslint").Rule.RuleModule;
15
+ "wrap-long-ternaries": import("eslint").Rule.RuleModule;
16
+ "wrap-multiline-arrays": import("eslint").Rule.RuleModule;
17
+ "wrap-multiline-if-conditions": import("eslint").Rule.RuleModule;
18
+ "wrap-multiline-parentheses": import("eslint").Rule.RuleModule;
19
+ "wrap-multiline-tuple-types": import("eslint").Rule.RuleModule;
20
+ "wrap-object-literals": import("eslint").Rule.RuleModule;
21
+ "wrap-object-types": import("eslint").Rule.RuleModule;
22
+ };
23
+ export declare const plugin: {
24
+ meta: {
25
+ namespace: string;
26
+ name: string;
27
+ version: string;
28
+ };
29
+ rules: {
30
+ "blank-line-after-control-flow": import("eslint").Rule.RuleModule;
31
+ "blank-line-before-jsdoc-default": import("eslint").Rule.RuleModule;
32
+ "blank-line-before-line-comment": import("eslint").Rule.RuleModule;
33
+ "newline-per-chained-call": import("eslint").Rule.RuleModule;
34
+ "no-simple-template-literals": import("eslint").Rule.RuleModule;
35
+ "pack-import-specifiers": import("eslint").Rule.RuleModule;
36
+ "parenthesize-arrow-bodies": import("eslint").Rule.RuleModule;
37
+ "parenthesize-ternary-conditions": import("eslint").Rule.RuleModule;
38
+ "prefer-else-if-after-exit": import("eslint").Rule.RuleModule;
39
+ "prefer-generic-multiline-arrays": import("eslint").Rule.RuleModule;
40
+ "require-default-imports": import("eslint").Rule.RuleModule;
41
+ "require-using-locks": import("eslint").Rule.RuleModule;
42
+ "require-zod-object-schemas": import("eslint").Rule.RuleModule;
43
+ "wrap-long-ternaries": import("eslint").Rule.RuleModule;
44
+ "wrap-multiline-arrays": import("eslint").Rule.RuleModule;
45
+ "wrap-multiline-if-conditions": import("eslint").Rule.RuleModule;
46
+ "wrap-multiline-parentheses": import("eslint").Rule.RuleModule;
47
+ "wrap-multiline-tuple-types": import("eslint").Rule.RuleModule;
48
+ "wrap-object-literals": import("eslint").Rule.RuleModule;
49
+ "wrap-object-types": import("eslint").Rule.RuleModule;
50
+ };
51
+ };
52
+ export default plugin;
53
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;CAqBjB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOM,CAAC;AAE1B,eAAe,MAAM,CAAC"}
package/dist/plugin.js ADDED
@@ -0,0 +1,54 @@
1
+ import { createRequire } from "node:module";
2
+ import blankLineAfterControlFlow from "./rules/blank-line-after-control-flow/blank-line-after-control-flow.js";
3
+ import blankLineBeforeJsdocDefault from "./rules/blank-line-before-jsdoc-default/blank-line-before-jsdoc-default.js";
4
+ import blankLineBeforeLineComment from "./rules/blank-line-before-line-comment/blank-line-before-line-comment.js";
5
+ import newlinePerChainedCall from "./rules/newline-per-chained-call/newline-per-chained-call.js";
6
+ import noSimpleTemplateLiterals from "./rules/no-simple-template-literals/no-simple-template-literals.js";
7
+ import packImportSpecifiers from "./rules/pack-import-specifiers/pack-import-specifiers.js";
8
+ import parenthesizeArrowBodies from "./rules/parenthesize-arrow-bodies/parenthesize-arrow-bodies.js";
9
+ import parenthesizeTernaryConditions from "./rules/parenthesize-ternary-conditions/parenthesize-ternary-conditions.js";
10
+ import preferElseIfAfterExit from "./rules/prefer-else-if-after-exit/prefer-else-if-after-exit.js";
11
+ import preferGenericMultilineArrays from "./rules/prefer-generic-multiline-arrays/prefer-generic-multiline-arrays.js";
12
+ import requireDefaultImports from "./rules/require-default-imports/require-default-imports.js";
13
+ import requireUsingLocks from "./rules/require-using-locks/require-using-locks.js";
14
+ import requireZodObjectSchemas from "./rules/require-zod-object-schemas/require-zod-object-schemas.js";
15
+ import wrapLongTernaries from "./rules/wrap-long-ternaries/wrap-long-ternaries.js";
16
+ import wrapMultilineArrays from "./rules/wrap-multiline-arrays/wrap-multiline-arrays.js";
17
+ import wrapMultilineIfConditions from "./rules/wrap-multiline-if-conditions/wrap-multiline-if-conditions.js";
18
+ import wrapMultilineParentheses from "./rules/wrap-multiline-parentheses/wrap-multiline-parentheses.js";
19
+ import wrapMultilineTupleTypes from "./rules/wrap-multiline-tuple-types/wrap-multiline-tuple-types.js";
20
+ import wrapObjectLiterals from "./rules/wrap-object-literals/wrap-object-literals.js";
21
+ import wrapObjectTypes from "./rules/wrap-object-types/wrap-object-types.js";
22
+ const { name, version } = createRequire(import.meta.url)("../package.json");
23
+ export const rules = {
24
+ "blank-line-after-control-flow": blankLineAfterControlFlow,
25
+ "blank-line-before-jsdoc-default": blankLineBeforeJsdocDefault,
26
+ "blank-line-before-line-comment": blankLineBeforeLineComment,
27
+ "newline-per-chained-call": newlinePerChainedCall,
28
+ "no-simple-template-literals": noSimpleTemplateLiterals,
29
+ "pack-import-specifiers": packImportSpecifiers,
30
+ "parenthesize-arrow-bodies": parenthesizeArrowBodies,
31
+ "parenthesize-ternary-conditions": parenthesizeTernaryConditions,
32
+ "prefer-else-if-after-exit": preferElseIfAfterExit,
33
+ "prefer-generic-multiline-arrays": preferGenericMultilineArrays,
34
+ "require-default-imports": requireDefaultImports,
35
+ "require-using-locks": requireUsingLocks,
36
+ "require-zod-object-schemas": requireZodObjectSchemas,
37
+ "wrap-long-ternaries": wrapLongTernaries,
38
+ "wrap-multiline-arrays": wrapMultilineArrays,
39
+ "wrap-multiline-if-conditions": wrapMultilineIfConditions,
40
+ "wrap-multiline-parentheses": wrapMultilineParentheses,
41
+ "wrap-multiline-tuple-types": wrapMultilineTupleTypes,
42
+ "wrap-object-literals": wrapObjectLiterals,
43
+ "wrap-object-types": wrapObjectTypes
44
+ };
45
+ export const plugin = {
46
+ meta: {
47
+ namespace: "giladgd",
48
+ name,
49
+ version
50
+ },
51
+ rules
52
+ };
53
+ export default plugin;
54
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC1C,OAAO,yBAAyB,MAAM,wEAAwE,CAAC;AAC/G,OAAO,2BAA2B,MAAM,4EAA4E,CAAC;AACrH,OAAO,0BAA0B,MAAM,0EAA0E,CAAC;AAClH,OAAO,qBAAqB,MAAM,8DAA8D,CAAC;AACjG,OAAO,wBAAwB,MAAM,oEAAoE,CAAC;AAC1G,OAAO,oBAAoB,MAAM,0DAA0D,CAAC;AAC5F,OAAO,uBAAuB,MAAM,gEAAgE,CAAC;AACrG,OAAO,6BAA6B,MAAM,4EAA4E,CAAC;AACvH,OAAO,qBAAqB,MAAM,gEAAgE,CAAC;AACnG,OAAO,4BAA4B,MAAM,4EAA4E,CAAC;AACtH,OAAO,qBAAqB,MAAM,4DAA4D,CAAC;AAC/F,OAAO,iBAAiB,MAAM,oDAAoD,CAAC;AACnF,OAAO,uBAAuB,MAAM,kEAAkE,CAAC;AACvG,OAAO,iBAAiB,MAAM,oDAAoD,CAAC;AACnF,OAAO,mBAAmB,MAAM,wDAAwD,CAAC;AACzF,OAAO,yBAAyB,MAAM,sEAAsE,CAAC;AAC7G,OAAO,wBAAwB,MAAM,kEAAkE,CAAC;AACxG,OAAO,uBAAuB,MAAM,kEAAkE,CAAC;AACvG,OAAO,kBAAkB,MAAM,sDAAsD,CAAC;AACtF,OAAO,eAAe,MAAM,gDAAgD,CAAC;AAG7E,MAAM,EAAC,IAAI,EAAE,OAAO,EAAC,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,iBAAiB,CAAoC,CAAC;AAE7G,MAAM,CAAC,MAAM,KAAK,GAAG;IACjB,+BAA+B,EAAE,yBAAyB;IAC1D,iCAAiC,EAAE,2BAA2B;IAC9D,gCAAgC,EAAE,0BAA0B;IAC5D,0BAA0B,EAAE,qBAAqB;IACjD,6BAA6B,EAAE,wBAAwB;IACvD,wBAAwB,EAAE,oBAAoB;IAC9C,2BAA2B,EAAE,uBAAuB;IACpD,iCAAiC,EAAE,6BAA6B;IAChE,2BAA2B,EAAE,qBAAqB;IAClD,iCAAiC,EAAE,4BAA4B;IAC/D,yBAAyB,EAAE,qBAAqB;IAChD,qBAAqB,EAAE,iBAAiB;IACxC,4BAA4B,EAAE,uBAAuB;IACrD,qBAAqB,EAAE,iBAAiB;IACxC,uBAAuB,EAAE,mBAAmB;IAC5C,8BAA8B,EAAE,yBAAyB;IACzD,4BAA4B,EAAE,wBAAwB;IACtD,4BAA4B,EAAE,uBAAuB;IACrD,sBAAsB,EAAE,kBAAkB;IAC1C,mBAAmB,EAAE,eAAe;CACvC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,IAAI,EAAE;QACF,SAAS,EAAE,SAAS;QACpB,IAAI;QACJ,OAAO;KACV;IACD,KAAK;CACgB,CAAC;AAE1B,eAAe,MAAM,CAAC"}
@@ -0,0 +1,7 @@
1
+ /** Read gitignore-style patterns into a named ESLint config scoped to the ignore file's directory. */
2
+ export declare function resolveIgnoreFile(ignoreFilePath: string): {
3
+ name: string;
4
+ basePath: string;
5
+ ignores: string[];
6
+ };
7
+ //# sourceMappingURL=resolveIgnoreFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveIgnoreFile.d.ts","sourceRoot":"","sources":["../src/resolveIgnoreFile.ts"],"names":[],"mappings":"AAsBA,sGAAsG;AACtG,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM;;;;EAavD"}
@@ -0,0 +1,32 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ function convertIgnorePattern(line) {
4
+ const negated = line.startsWith("!");
5
+ const pattern = negated
6
+ ? line.slice(1)
7
+ : line;
8
+ if (["", "**", "/**", "**/"].includes(pattern))
9
+ return line;
10
+ const prefix = pattern.slice(0, -1).includes("/") ? "" : "**/";
11
+ const suffix = pattern.endsWith("/**") ? "/*" : "";
12
+ // escape literals that minimatch interprets as brace expansion or extglobs
13
+ const glob = pattern
14
+ .replace(/^\//u, "")
15
+ .replace(/\\.|[({]/gu, (part) => (part.length === 1 ? "\\" + part : part));
16
+ return (negated ? "!" : "") + prefix + glob + suffix;
17
+ }
18
+ /** Read gitignore-style patterns into a named ESLint config scoped to the ignore file's directory. */
19
+ export function resolveIgnoreFile(ignoreFilePath) {
20
+ const resolvedPath = path.resolve(ignoreFilePath);
21
+ const ignores = (void 0, fs.readFileSync)(resolvedPath, "utf8")
22
+ .split(/\r?\n/u)
23
+ .map((line) => line.trim())
24
+ .filter((line) => (line !== "" && !line.startsWith("#")))
25
+ .map(convertIgnorePattern);
26
+ return {
27
+ name: ignoreFilePath,
28
+ basePath: path.dirname(resolvedPath),
29
+ ignores
30
+ };
31
+ }
32
+ //# sourceMappingURL=resolveIgnoreFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveIgnoreFile.js","sourceRoot":"","sources":["../src/resolveIgnoreFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,SAAS,oBAAoB,CAAC,IAAY;IACtC,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACr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,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;SACxD,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAE/B,OAAO;QACH,IAAI,EAAE,cAAc;QACpB,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;QACpC,OAAO;KACV,CAAC;AACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const _default: import("eslint").Rule.RuleModule;
2
+ export default _default;
3
+ //# sourceMappingURL=blank-line-after-control-flow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blank-line-after-control-flow.d.ts","sourceRoot":"","sources":["../../../src/rules/blank-line-after-control-flow/blank-line-after-control-flow.ts"],"names":[],"mappings":";AAoDA,wBAiEG"}