eslint-plugin-flawless 0.1.12 → 1.0.0

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/README.md CHANGED
@@ -198,21 +198,24 @@ pnpm eslint-docs
198
198
  💭
199
199
  Requires [type information](https://typescript-eslint.io/linting/typed-linting).
200
200
 
201
- | Name                            | Description | 🔧 | 💭 |
202
- | :-------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------- | :-- | :-- |
203
- | [arrow-return-style](src/rules/arrow-return-style/documentation.md) | Enforce arrow function return style based on line length | 🔧 | |
204
- | [jsx-shorthand-boolean](src/rules/jsx-shorthand-boolean/documentation.md) | Disallow shorthand boolean JSX attributes | 🔧 | |
205
- | [jsx-shorthand-fragment](src/rules/jsx-shorthand-fragment/documentation.md) | Enforce a consistent fragment form: the shorthand `<>...</>` or a named fragment | 🔧 | |
206
- | [naming-convention](src/rules/naming-convention/documentation.md) | Enforce naming conventions for everything across a codebase | | 💭 |
207
- | [no-export-default-arrow](src/rules/no-export-default-arrow/documentation.md) | Disallow anonymous arrow functions as export default declarations | 🔧 | |
208
- | [no-unnecessary-use-callback](src/rules/no-unnecessary-use-callback/documentation.md) | Disallow unnecessary usage of 'useCallback' | | |
209
- | [no-unnecessary-use-memo](src/rules/no-unnecessary-use-memo/documentation.md) | Disallow unnecessary usage of 'useMemo' | | |
210
- | [prefer-destructuring-assignment](src/rules/prefer-destructuring-assignment/documentation.md) | Enforce destructuring assignment for component props | 🔧 | |
211
- | [prefer-parameter-destructuring](src/rules/prefer-parameter-destructuring/documentation.md) | Enforce destructuring parameters in the function signature | 🔧 | |
212
- | [prefer-read-only-props](src/rules/prefer-read-only-props/documentation.md) | Enforce that function component props are read-only | 🔧 | 💭 |
213
- | [purity](src/rules/purity/documentation.md) | Disallow impure calls such as `math.random` or `os.clock` during render | | |
214
- | [toml-sort-keys](src/rules/toml-sort-keys/documentation.md) | Enforce a configured sort order for TOML keys and tables | 🔧 | |
215
- | [yaml-block-key-blank-lines](src/rules/yaml-block-key-blank-lines/documentation.md) | Enforce blank lines around top-level YAML block collection keys | 🔧 | |
201
+ | Name                            | Description | 🔧 | 💭 |
202
+ | :-------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------- | :-- | :-- |
203
+ | [arrow-return-style](src/rules/arrow-return-style/documentation.md) | Enforce arrow function return style based on line length | 🔧 | |
204
+ | [jsx-shorthand-boolean](src/rules/jsx-shorthand-boolean/documentation.md) | Disallow shorthand boolean JSX attributes | 🔧 | |
205
+ | [jsx-shorthand-fragment](src/rules/jsx-shorthand-fragment/documentation.md) | Enforce a consistent fragment form: the shorthand `<>...</>` or a named fragment | 🔧 | |
206
+ | [max-lines-per-function](src/rules/max-lines-per-function/documentation.md) | Enforce a maximum number of lines of code in a function | | |
207
+ | [naming-convention](src/rules/naming-convention/documentation.md) | Enforce naming conventions for everything across a codebase | | 💭 |
208
+ | [no-export-default-arrow](src/rules/no-export-default-arrow/documentation.md) | Disallow anonymous arrow functions as export default declarations | 🔧 | |
209
+ | [no-redundant-tsconfig-options](src/rules/no-redundant-tsconfig-options/documentation.md) | Disallow tsconfig options that redundantly re-set a value already provided by an extended config | 🔧 | |
210
+ | [no-unnecessary-use-callback](src/rules/no-unnecessary-use-callback/documentation.md) | Disallow unnecessary usage of 'useCallback' | | |
211
+ | [no-unnecessary-use-memo](src/rules/no-unnecessary-use-memo/documentation.md) | Disallow unnecessary usage of 'useMemo' | | |
212
+ | [padding-after-expect-assertions](src/rules/padding-after-expect-assertions/documentation.md) | Enforce a blank line after `expect.assertions` and `expect.hasAssertions` | 🔧 | |
213
+ | [prefer-destructuring-assignment](src/rules/prefer-destructuring-assignment/documentation.md) | Enforce destructuring assignment for component props | 🔧 | |
214
+ | [prefer-parameter-destructuring](src/rules/prefer-parameter-destructuring/documentation.md) | Enforce destructuring parameters in the function signature | 🔧 | |
215
+ | [prefer-read-only-props](src/rules/prefer-read-only-props/documentation.md) | Enforce that function component props are read-only | 🔧 | 💭 |
216
+ | [purity](src/rules/purity/documentation.md) | Disallow impure calls such as `math.random` or `os.clock` during render | | |
217
+ | [toml-sort-keys](src/rules/toml-sort-keys/documentation.md) | Enforce a configured sort order for TOML keys and tables | 🔧 | |
218
+ | [yaml-block-key-blank-lines](src/rules/yaml-block-key-blank-lines/documentation.md) | Enforce blank lines around top-level YAML block collection keys | 🔧 | |
216
219
 
217
220
  <!-- end auto-generated rules list -->
218
221
 
package/dist/index.d.mts CHANGED
@@ -50,7 +50,7 @@ declare const EXPLICIT = "useExplicitReturn";
50
50
  declare const COMPLEX_EXPLICIT = "useExplicitReturnComplex";
51
51
  type MessageIds$4 = typeof COMPLEX_EXPLICIT | typeof EXPLICIT | typeof IMPLICIT;
52
52
  type ObjectReturnStyle = "always-explicit" | "complex-explicit" | "off";
53
- type Options$5 = [{
53
+ type Options$6 = [{
54
54
  /** Always use explicit returns for JSX bodies. */
55
55
  jsxAlwaysUseExplicitReturn?: boolean;
56
56
  /** Maximum emitted line length (tab-expanded) before requiring an explicit return. */
@@ -85,9 +85,41 @@ interface JsxShorthandFragmentOptions {
85
85
  */
86
86
  readonly mode?: Mode;
87
87
  }
88
- type Options$4 = [JsxShorthandFragmentOptions?];
88
+ type Options$5 = [JsxShorthandFragmentOptions?];
89
89
  type Mode = "element" | "syntax";
90
90
  //#endregion
91
+ //#region src/rules/max-lines-per-function/rule.d.ts
92
+ /** Where a function's counted range begins. */
93
+ type CountFrom = "body" | "function";
94
+ interface MaxLinesPerFunctionOptions {
95
+ /**
96
+ * Where the counted range begins. `"body"` (the default) counts from the
97
+ * line holding the body's opening brace through the line holding its closing
98
+ * brace, so lines spent purely on the signature — destructured parameters, a
99
+ * long parameter list, multi-line generics or return types, decorators — do
100
+ * not count against `max`. Note the opening-brace line is still counted, and
101
+ * it is usually also the last line of the signature (`): void {`), so exactly
102
+ * one signature line always remains in the total. `"function"` counts the
103
+ * whole function node instead, matching ESLint core.
104
+ */
105
+ readonly countFrom?: CountFrom;
106
+ /**
107
+ * Whether immediately-invoked function expressions are measured. Off by
108
+ * default, matching ESLint core.
109
+ */
110
+ readonly IIFEs?: boolean;
111
+ /** The maximum number of lines a function may span. */
112
+ readonly max?: number;
113
+ /** Whether lines containing only whitespace are excluded from the count. */
114
+ readonly skipBlankLines?: boolean;
115
+ /**
116
+ * Whether lines consisting solely of a comment are excluded from the count.
117
+ * A comment trailing real code does not make its line skippable.
118
+ */
119
+ readonly skipComments?: boolean;
120
+ }
121
+ type Options$4 = [MaxLinesPerFunctionOptions?];
122
+ //#endregion
91
123
  //#region src/rules/naming-convention/utils/enums.d.ts
92
124
  declare const Selector: {
93
125
  readonly variable: 1;
@@ -250,15 +282,20 @@ declare const plugin: {
250
282
  version: string;
251
283
  };
252
284
  rules: {
253
- "arrow-return-style": FlawlessRuleModule<Options$5, MessageIds$4, Readonly<TSESLint.SourceCode>>;
285
+ "arrow-return-style": FlawlessRuleModule<Options$6, MessageIds$4, Readonly<TSESLint.SourceCode>>;
254
286
  "jsx-shorthand-boolean": FlawlessRuleModule<[], "setAttributeValue", Readonly<TSESLint.SourceCode>>;
255
- "jsx-shorthand-fragment": FlawlessRuleModule<Options$4, MessageIds$3, Readonly<TSESLint.SourceCode>>;
287
+ "jsx-shorthand-fragment": FlawlessRuleModule<Options$5, MessageIds$3, Readonly<TSESLint.SourceCode>>;
288
+ "max-lines-per-function": FlawlessRuleModule<Options$4, "exceed", Readonly<TSESLint.SourceCode>>;
256
289
  "naming-convention": TSESLint.RuleModule<MessageIds$2, Options$3, PluginDocumentation, TSESLint.RuleListener> & {
257
290
  name: string;
258
291
  };
259
292
  "no-export-default-arrow": FlawlessRuleModule<[], "disallowExportDefaultArrow", Readonly<TSESLint.SourceCode>>;
293
+ "no-redundant-tsconfig-options": TSESLint.RuleModule<"redundant", [], PluginDocumentation, TSESLint.RuleListener> & {
294
+ name: string;
295
+ };
260
296
  "no-unnecessary-use-callback": FlawlessRuleModule<[], MessageIds$1, Readonly<TSESLint.SourceCode>>;
261
297
  "no-unnecessary-use-memo": FlawlessRuleModule<[], MessageIds, Readonly<TSESLint.SourceCode>>;
298
+ "padding-after-expect-assertions": FlawlessRuleModule<[], "missingPadding", Readonly<TSESLint.SourceCode>>;
262
299
  "prefer-destructuring-assignment": FlawlessRuleModule<[], "default", Readonly<TSESLint.SourceCode>>;
263
300
  "prefer-parameter-destructuring": FlawlessRuleModule<Options$2, "default", Readonly<TSESLint.SourceCode>>;
264
301
  "prefer-read-only-props": TSESLint.RuleModule<"preferReadOnlyProps", [{
@@ -289,15 +326,20 @@ declare const _default: {
289
326
  version: string;
290
327
  };
291
328
  rules: {
292
- "arrow-return-style": FlawlessRuleModule<Options$5, MessageIds$4, Readonly<import("${configDir}").SourceCode>>;
329
+ "arrow-return-style": FlawlessRuleModule<Options$6, MessageIds$4, Readonly<import("${configDir}").SourceCode>>;
293
330
  "jsx-shorthand-boolean": FlawlessRuleModule<[], "setAttributeValue", Readonly<import("${configDir}").SourceCode>>;
294
- "jsx-shorthand-fragment": FlawlessRuleModule<Options$4, MessageIds$3, Readonly<import("${configDir}").SourceCode>>;
331
+ "jsx-shorthand-fragment": FlawlessRuleModule<Options$5, MessageIds$3, Readonly<import("${configDir}").SourceCode>>;
332
+ "max-lines-per-function": FlawlessRuleModule<Options$4, "exceed", Readonly<import("${configDir}").SourceCode>>;
295
333
  "naming-convention": import("${configDir}").RuleModule<MessageIds$2, Options$3, PluginDocumentation, import("${configDir}").RuleListener> & {
296
334
  name: string;
297
335
  };
298
336
  "no-export-default-arrow": FlawlessRuleModule<[], "disallowExportDefaultArrow", Readonly<import("${configDir}").SourceCode>>;
337
+ "no-redundant-tsconfig-options": import("${configDir}").RuleModule<"redundant", [], PluginDocumentation, import("${configDir}").RuleListener> & {
338
+ name: string;
339
+ };
299
340
  "no-unnecessary-use-callback": FlawlessRuleModule<[], MessageIds$1, Readonly<import("${configDir}").SourceCode>>;
300
341
  "no-unnecessary-use-memo": FlawlessRuleModule<[], MessageIds, Readonly<import("${configDir}").SourceCode>>;
342
+ "padding-after-expect-assertions": FlawlessRuleModule<[], "missingPadding", Readonly<import("${configDir}").SourceCode>>;
301
343
  "prefer-destructuring-assignment": FlawlessRuleModule<[], "default", Readonly<import("${configDir}").SourceCode>>;
302
344
  "prefer-parameter-destructuring": FlawlessRuleModule<Options$2, "default", Readonly<import("${configDir}").SourceCode>>;
303
345
  "prefer-read-only-props": import("${configDir}").RuleModule<"preferReadOnlyProps", [{
@@ -325,15 +367,20 @@ declare const _default: {
325
367
  version: string;
326
368
  };
327
369
  rules: {
328
- "arrow-return-style": FlawlessRuleModule<Options$5, MessageIds$4, Readonly<import("${configDir}").SourceCode>>;
370
+ "arrow-return-style": FlawlessRuleModule<Options$6, MessageIds$4, Readonly<import("${configDir}").SourceCode>>;
329
371
  "jsx-shorthand-boolean": FlawlessRuleModule<[], "setAttributeValue", Readonly<import("${configDir}").SourceCode>>;
330
- "jsx-shorthand-fragment": FlawlessRuleModule<Options$4, MessageIds$3, Readonly<import("${configDir}").SourceCode>>;
372
+ "jsx-shorthand-fragment": FlawlessRuleModule<Options$5, MessageIds$3, Readonly<import("${configDir}").SourceCode>>;
373
+ "max-lines-per-function": FlawlessRuleModule<Options$4, "exceed", Readonly<import("${configDir}").SourceCode>>;
331
374
  "naming-convention": import("${configDir}").RuleModule<MessageIds$2, Options$3, PluginDocumentation, import("${configDir}").RuleListener> & {
332
375
  name: string;
333
376
  };
334
377
  "no-export-default-arrow": FlawlessRuleModule<[], "disallowExportDefaultArrow", Readonly<import("${configDir}").SourceCode>>;
378
+ "no-redundant-tsconfig-options": import("${configDir}").RuleModule<"redundant", [], PluginDocumentation, import("${configDir}").RuleListener> & {
379
+ name: string;
380
+ };
335
381
  "no-unnecessary-use-callback": FlawlessRuleModule<[], MessageIds$1, Readonly<import("${configDir}").SourceCode>>;
336
382
  "no-unnecessary-use-memo": FlawlessRuleModule<[], MessageIds, Readonly<import("${configDir}").SourceCode>>;
383
+ "padding-after-expect-assertions": FlawlessRuleModule<[], "missingPadding", Readonly<import("${configDir}").SourceCode>>;
337
384
  "prefer-destructuring-assignment": FlawlessRuleModule<[], "default", Readonly<import("${configDir}").SourceCode>>;
338
385
  "prefer-parameter-destructuring": FlawlessRuleModule<Options$2, "default", Readonly<import("${configDir}").SourceCode>>;
339
386
  "prefer-read-only-props": import("${configDir}").RuleModule<"preferReadOnlyProps", [{
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as plugin, t as PLUGIN_NAME } from "./plugin-DYVtpuio.mjs";
1
+ import { n as plugin, t as PLUGIN_NAME } from "./plugin-DFLOyhkl.mjs";
2
2
  //#region src/configs/index.ts
3
3
  const configs = { recommended: {
4
4
  plugins: { [PLUGIN_NAME]: plugin },
package/dist/oxlint.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as plugin, t as PLUGIN_NAME } from "./plugin-DYVtpuio.mjs";
1
+ import { n as plugin, t as PLUGIN_NAME } from "./plugin-DFLOyhkl.mjs";
2
2
  import { definePlugin } from "@oxlint/plugins";
3
3
  //#region src/oxlint.ts
4
4
  /**