eslint-plugin-flawless 1.1.0 → 1.2.1
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 +1 -0
- package/dist/index.d.mts +34 -25
- package/dist/index.mjs +1 -1
- package/dist/oxlint.mjs +1 -1
- package/dist/{plugin-B-YWsemf.mjs → plugin-DfRbpogP.mjs} +584 -103
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -214,6 +214,7 @@ Requires [type information](https://typescript-eslint.io/linting/typed-linting).
|
|
|
214
214
|
| [prefer-parameter-destructuring](src/rules/prefer-parameter-destructuring/documentation.md) | Enforce destructuring parameters in the function signature | 🔧 | |
|
|
215
215
|
| [prefer-read-only-props](src/rules/prefer-read-only-props/documentation.md) | Enforce that function component props are read-only | 🔧 | 💭 |
|
|
216
216
|
| [purity](src/rules/purity/documentation.md) | Disallow impure calls such as `math.random` or `os.clock` during render | | |
|
|
217
|
+
| [react-namespace](src/rules/react-namespace/documentation.md) | Prefer named imports for React runtime values and the React namespace for React types | 🔧 | |
|
|
217
218
|
| [toml-sort-keys](src/rules/toml-sort-keys/documentation.md) | Enforce a configured sort order for TOML keys and tables | 🔧 | |
|
|
218
219
|
| [yaml-block-key-blank-lines](src/rules/yaml-block-key-blank-lines/documentation.md) | Enforce blank lines around top-level YAML block collection keys | 🔧 | |
|
|
219
220
|
|
package/dist/index.d.mts
CHANGED
|
@@ -49,7 +49,7 @@ type FlawlessRuleModule<Options extends ReadonlyArray<unknown>, MessageIds exten
|
|
|
49
49
|
declare const IMPLICIT = "useImplicitReturn";
|
|
50
50
|
declare const EXPLICIT = "useExplicitReturn";
|
|
51
51
|
declare const COMPLEX_EXPLICIT = "useExplicitReturnComplex";
|
|
52
|
-
type MessageIds$
|
|
52
|
+
type MessageIds$5 = typeof COMPLEX_EXPLICIT | typeof EXPLICIT | typeof IMPLICIT;
|
|
53
53
|
type ObjectReturnStyle = "always-explicit" | "complex-explicit" | "off";
|
|
54
54
|
type Options$6 = [{
|
|
55
55
|
/** Always use explicit returns for JSX bodies. */
|
|
@@ -73,7 +73,7 @@ type Options$6 = [{
|
|
|
73
73
|
//#region src/rules/jsx-shorthand-fragment/rule.d.ts
|
|
74
74
|
declare const MESSAGE_ID_NAMED = "useNamedFragment";
|
|
75
75
|
declare const MESSAGE_ID_SHORTHAND = "useShorthandFragment";
|
|
76
|
-
type MessageIds$
|
|
76
|
+
type MessageIds$4 = typeof MESSAGE_ID_NAMED | typeof MESSAGE_ID_SHORTHAND;
|
|
77
77
|
interface JsxShorthandFragmentOptions {
|
|
78
78
|
/**
|
|
79
79
|
* The identifier used for the named fragment element in `"element"` mode
|
|
@@ -173,6 +173,7 @@ declare const Modifier: {
|
|
|
173
173
|
readonly async: 16384;
|
|
174
174
|
readonly default: 32768;
|
|
175
175
|
readonly namespace: 65536;
|
|
176
|
+
readonly constAsserted: 131072;
|
|
176
177
|
};
|
|
177
178
|
type ModifierString = keyof typeof Modifier;
|
|
178
179
|
declare const PredefinedFormat: {
|
|
@@ -185,11 +186,11 @@ declare const PredefinedFormat: {
|
|
|
185
186
|
};
|
|
186
187
|
type PredefinedFormatString = keyof typeof PredefinedFormat;
|
|
187
188
|
declare const TypeModifier: {
|
|
188
|
-
readonly boolean:
|
|
189
|
-
readonly string:
|
|
190
|
-
readonly number:
|
|
191
|
-
readonly function:
|
|
192
|
-
readonly array:
|
|
189
|
+
readonly boolean: 262144;
|
|
190
|
+
readonly string: 524288;
|
|
191
|
+
readonly number: 1048576;
|
|
192
|
+
readonly function: 2097152;
|
|
193
|
+
readonly array: 4194304;
|
|
193
194
|
};
|
|
194
195
|
type TypeModifierString = keyof typeof TypeModifier;
|
|
195
196
|
declare const UnderscoreOption: {
|
|
@@ -244,18 +245,18 @@ interface NamingSelector {
|
|
|
244
245
|
}
|
|
245
246
|
//#endregion
|
|
246
247
|
//#region src/rules/naming-convention/rule.d.ts
|
|
247
|
-
type MessageIds$
|
|
248
|
+
type MessageIds$3 = "doesNotMatchFormat" | "doesNotMatchFormatForeignContract" | "doesNotMatchFormatTrimmed" | "doesNotMatchFormatTrimmedForeignContract" | "missingAffix" | "missingAffixForeignContract" | "missingUnderscore" | "missingUnderscoreForeignContract" | "satisfyCustom" | "satisfyCustomForeignContract" | "unexpectedUnderscore" | "unexpectedUnderscoreForeignContract";
|
|
248
249
|
type Options$3 = Array<NamingSelector>;
|
|
249
250
|
//#endregion
|
|
250
251
|
//#region src/rules/no-unnecessary-use-callback/rule.d.ts
|
|
251
252
|
declare const MESSAGE_ID_DEFAULT$1 = "default";
|
|
252
253
|
declare const MESSAGE_ID_INSIDE_USE_EFFECT$1 = "noUnnecessaryUseCallbackInsideUseEffect";
|
|
253
|
-
type MessageIds$
|
|
254
|
+
type MessageIds$2 = typeof MESSAGE_ID_DEFAULT$1 | typeof MESSAGE_ID_INSIDE_USE_EFFECT$1;
|
|
254
255
|
//#endregion
|
|
255
256
|
//#region src/rules/no-unnecessary-use-memo/rule.d.ts
|
|
256
257
|
declare const MESSAGE_ID_DEFAULT = "default";
|
|
257
258
|
declare const MESSAGE_ID_INSIDE_USE_EFFECT = "noUnnecessaryUseMemoInsideUseEffect";
|
|
258
|
-
type MessageIds = typeof MESSAGE_ID_DEFAULT | typeof MESSAGE_ID_INSIDE_USE_EFFECT;
|
|
259
|
+
type MessageIds$1 = typeof MESSAGE_ID_DEFAULT | typeof MESSAGE_ID_INSIDE_USE_EFFECT;
|
|
259
260
|
//#endregion
|
|
260
261
|
//#region src/rules/prefer-parameter-destructuring/rule.d.ts
|
|
261
262
|
type Options$2 = [{
|
|
@@ -279,6 +280,11 @@ interface PurityOptions {
|
|
|
279
280
|
}
|
|
280
281
|
type Options$1 = [PurityOptions?];
|
|
281
282
|
//#endregion
|
|
283
|
+
//#region src/rules/react-namespace/rule.d.ts
|
|
284
|
+
declare const MESSAGE_ID_RUNTIME = "runtimeNamespace";
|
|
285
|
+
declare const MESSAGE_ID_TYPE = "typeNamedImport";
|
|
286
|
+
type MessageIds = typeof MESSAGE_ID_RUNTIME | typeof MESSAGE_ID_TYPE;
|
|
287
|
+
//#endregion
|
|
282
288
|
//#region src/rules/toml-sort-keys/rule.d.ts
|
|
283
289
|
type Options = Array<SortSpec>;
|
|
284
290
|
interface SortOrderObject {
|
|
@@ -299,19 +305,19 @@ declare const plugin: {
|
|
|
299
305
|
version: string;
|
|
300
306
|
};
|
|
301
307
|
rules: {
|
|
302
|
-
"arrow-return-style": FlawlessRuleModule<Options$6, MessageIds$
|
|
308
|
+
"arrow-return-style": FlawlessRuleModule<Options$6, MessageIds$5, Readonly<TSESLint.SourceCode>>;
|
|
303
309
|
"jsx-shorthand-boolean": FlawlessRuleModule<[], "setAttributeValue", Readonly<TSESLint.SourceCode>>;
|
|
304
|
-
"jsx-shorthand-fragment": FlawlessRuleModule<Options$5, MessageIds$
|
|
310
|
+
"jsx-shorthand-fragment": FlawlessRuleModule<Options$5, MessageIds$4, Readonly<TSESLint.SourceCode>>;
|
|
305
311
|
"max-lines-per-function": FlawlessRuleModule<Options$4, "exceed", Readonly<TSESLint.SourceCode>>;
|
|
306
|
-
"naming-convention": TSESLint.RuleModule<MessageIds$
|
|
312
|
+
"naming-convention": TSESLint.RuleModule<MessageIds$3, Options$3, PluginDocumentation, TSESLint.RuleListener> & {
|
|
307
313
|
name: string;
|
|
308
314
|
};
|
|
309
315
|
"no-export-default-arrow": FlawlessRuleModule<[], "disallowExportDefaultArrow", Readonly<TSESLint.SourceCode>>;
|
|
310
316
|
"no-redundant-tsconfig-options": TSESLint.RuleModule<"redundant", [], PluginDocumentation, TSESLint.RuleListener> & {
|
|
311
317
|
name: string;
|
|
312
318
|
};
|
|
313
|
-
"no-unnecessary-use-callback": FlawlessRuleModule<[], MessageIds$
|
|
314
|
-
"no-unnecessary-use-memo": FlawlessRuleModule<[], MessageIds, Readonly<TSESLint.SourceCode>>;
|
|
319
|
+
"no-unnecessary-use-callback": FlawlessRuleModule<[], MessageIds$2, Readonly<TSESLint.SourceCode>>;
|
|
320
|
+
"no-unnecessary-use-memo": FlawlessRuleModule<[], MessageIds$1, Readonly<TSESLint.SourceCode>>;
|
|
315
321
|
"padding-after-expect-assertions": FlawlessRuleModule<[], "missingPadding", Readonly<TSESLint.SourceCode>>;
|
|
316
322
|
"prefer-destructuring-assignment": FlawlessRuleModule<[], "default", Readonly<TSESLint.SourceCode>>;
|
|
317
323
|
"prefer-parameter-destructuring": FlawlessRuleModule<Options$2, "default", Readonly<TSESLint.SourceCode>>;
|
|
@@ -323,6 +329,7 @@ declare const plugin: {
|
|
|
323
329
|
name: string;
|
|
324
330
|
};
|
|
325
331
|
purity: FlawlessRuleModule<Options$1, "impureCall", Readonly<TSESLint.SourceCode>>;
|
|
332
|
+
"react-namespace": FlawlessRuleModule<[], MessageIds, Readonly<TSESLint.SourceCode>>;
|
|
326
333
|
"toml-sort-keys": TSESLint.RuleModule<"unsorted", Options, PluginDocumentation, TSESLint.RuleListener> & {
|
|
327
334
|
name: string;
|
|
328
335
|
};
|
|
@@ -343,19 +350,19 @@ declare const _default: {
|
|
|
343
350
|
version: string;
|
|
344
351
|
};
|
|
345
352
|
rules: {
|
|
346
|
-
"arrow-return-style": FlawlessRuleModule<Options$6, MessageIds$
|
|
353
|
+
"arrow-return-style": FlawlessRuleModule<Options$6, MessageIds$5, Readonly<import("${configDir}").SourceCode>>;
|
|
347
354
|
"jsx-shorthand-boolean": FlawlessRuleModule<[], "setAttributeValue", Readonly<import("${configDir}").SourceCode>>;
|
|
348
|
-
"jsx-shorthand-fragment": FlawlessRuleModule<Options$5, MessageIds$
|
|
355
|
+
"jsx-shorthand-fragment": FlawlessRuleModule<Options$5, MessageIds$4, Readonly<import("${configDir}").SourceCode>>;
|
|
349
356
|
"max-lines-per-function": FlawlessRuleModule<Options$4, "exceed", Readonly<import("${configDir}").SourceCode>>;
|
|
350
|
-
"naming-convention": import("${configDir}").RuleModule<MessageIds$
|
|
357
|
+
"naming-convention": import("${configDir}").RuleModule<MessageIds$3, Options$3, PluginDocumentation, import("${configDir}").RuleListener> & {
|
|
351
358
|
name: string;
|
|
352
359
|
};
|
|
353
360
|
"no-export-default-arrow": FlawlessRuleModule<[], "disallowExportDefaultArrow", Readonly<import("${configDir}").SourceCode>>;
|
|
354
361
|
"no-redundant-tsconfig-options": import("${configDir}").RuleModule<"redundant", [], PluginDocumentation, import("${configDir}").RuleListener> & {
|
|
355
362
|
name: string;
|
|
356
363
|
};
|
|
357
|
-
"no-unnecessary-use-callback": FlawlessRuleModule<[], MessageIds$
|
|
358
|
-
"no-unnecessary-use-memo": FlawlessRuleModule<[], MessageIds, Readonly<import("${configDir}").SourceCode>>;
|
|
364
|
+
"no-unnecessary-use-callback": FlawlessRuleModule<[], MessageIds$2, Readonly<import("${configDir}").SourceCode>>;
|
|
365
|
+
"no-unnecessary-use-memo": FlawlessRuleModule<[], MessageIds$1, Readonly<import("${configDir}").SourceCode>>;
|
|
359
366
|
"padding-after-expect-assertions": FlawlessRuleModule<[], "missingPadding", Readonly<import("${configDir}").SourceCode>>;
|
|
360
367
|
"prefer-destructuring-assignment": FlawlessRuleModule<[], "default", Readonly<import("${configDir}").SourceCode>>;
|
|
361
368
|
"prefer-parameter-destructuring": FlawlessRuleModule<Options$2, "default", Readonly<import("${configDir}").SourceCode>>;
|
|
@@ -367,6 +374,7 @@ declare const _default: {
|
|
|
367
374
|
name: string;
|
|
368
375
|
};
|
|
369
376
|
purity: FlawlessRuleModule<Options$1, "impureCall", Readonly<import("${configDir}").SourceCode>>;
|
|
377
|
+
"react-namespace": FlawlessRuleModule<[], MessageIds, Readonly<import("${configDir}").SourceCode>>;
|
|
370
378
|
"toml-sort-keys": import("${configDir}").RuleModule<"unsorted", Options, PluginDocumentation, import("${configDir}").RuleListener> & {
|
|
371
379
|
name: string;
|
|
372
380
|
};
|
|
@@ -384,19 +392,19 @@ declare const _default: {
|
|
|
384
392
|
version: string;
|
|
385
393
|
};
|
|
386
394
|
rules: {
|
|
387
|
-
"arrow-return-style": FlawlessRuleModule<Options$6, MessageIds$
|
|
395
|
+
"arrow-return-style": FlawlessRuleModule<Options$6, MessageIds$5, Readonly<import("${configDir}").SourceCode>>;
|
|
388
396
|
"jsx-shorthand-boolean": FlawlessRuleModule<[], "setAttributeValue", Readonly<import("${configDir}").SourceCode>>;
|
|
389
|
-
"jsx-shorthand-fragment": FlawlessRuleModule<Options$5, MessageIds$
|
|
397
|
+
"jsx-shorthand-fragment": FlawlessRuleModule<Options$5, MessageIds$4, Readonly<import("${configDir}").SourceCode>>;
|
|
390
398
|
"max-lines-per-function": FlawlessRuleModule<Options$4, "exceed", Readonly<import("${configDir}").SourceCode>>;
|
|
391
|
-
"naming-convention": import("${configDir}").RuleModule<MessageIds$
|
|
399
|
+
"naming-convention": import("${configDir}").RuleModule<MessageIds$3, Options$3, PluginDocumentation, import("${configDir}").RuleListener> & {
|
|
392
400
|
name: string;
|
|
393
401
|
};
|
|
394
402
|
"no-export-default-arrow": FlawlessRuleModule<[], "disallowExportDefaultArrow", Readonly<import("${configDir}").SourceCode>>;
|
|
395
403
|
"no-redundant-tsconfig-options": import("${configDir}").RuleModule<"redundant", [], PluginDocumentation, import("${configDir}").RuleListener> & {
|
|
396
404
|
name: string;
|
|
397
405
|
};
|
|
398
|
-
"no-unnecessary-use-callback": FlawlessRuleModule<[], MessageIds$
|
|
399
|
-
"no-unnecessary-use-memo": FlawlessRuleModule<[], MessageIds, Readonly<import("${configDir}").SourceCode>>;
|
|
406
|
+
"no-unnecessary-use-callback": FlawlessRuleModule<[], MessageIds$2, Readonly<import("${configDir}").SourceCode>>;
|
|
407
|
+
"no-unnecessary-use-memo": FlawlessRuleModule<[], MessageIds$1, Readonly<import("${configDir}").SourceCode>>;
|
|
400
408
|
"padding-after-expect-assertions": FlawlessRuleModule<[], "missingPadding", Readonly<import("${configDir}").SourceCode>>;
|
|
401
409
|
"prefer-destructuring-assignment": FlawlessRuleModule<[], "default", Readonly<import("${configDir}").SourceCode>>;
|
|
402
410
|
"prefer-parameter-destructuring": FlawlessRuleModule<Options$2, "default", Readonly<import("${configDir}").SourceCode>>;
|
|
@@ -408,6 +416,7 @@ declare const _default: {
|
|
|
408
416
|
name: string;
|
|
409
417
|
};
|
|
410
418
|
purity: FlawlessRuleModule<Options$1, "impureCall", Readonly<import("${configDir}").SourceCode>>;
|
|
419
|
+
"react-namespace": FlawlessRuleModule<[], MessageIds, Readonly<import("${configDir}").SourceCode>>;
|
|
411
420
|
"toml-sort-keys": import("${configDir}").RuleModule<"unsorted", Options, PluginDocumentation, import("${configDir}").RuleListener> & {
|
|
412
421
|
name: string;
|
|
413
422
|
};
|
package/dist/index.mjs
CHANGED
package/dist/oxlint.mjs
CHANGED