@component-hook/eslint-plugin 1.5.1 → 1.6.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
@@ -1,6 +1,6 @@
1
1
  # @component-hook/eslint-plugin
2
2
 
3
- A opinionated ESLint config preset for `JavaScript`, `TypeScript`, `Vue3`, `React` and `Prettier`.
3
+ A opinionated ESLint config preset for `JavaScript`, `TypeScript`, `Vue3`, `React`, `Prettier` and `oxfmt`.
4
4
 
5
5
  <p>
6
6
  <a href="https://npm-stat.com/charts.html?package=@component-hook/eslint-plugin">
@@ -14,14 +14,15 @@ A opinionated ESLint config preset for `JavaScript`, `TypeScript`, `Vue3`, `Reac
14
14
  ## Features
15
15
 
16
16
  - Support `TypeScript`, `Vue3` and `React` out-of-box.
17
- - Format with `Prettier`.
17
+ - Format with `Prettier` or [`oxfmt`](https://oxc.rs/docs/guide/usage/formatter).
18
18
  - Ignores common files like `dist`, `node_modules`, `coverage`, and files in `.gitignore`.
19
19
  - Various built-in configurations can be referenced according to respective needs.
20
20
  - Reasonable defaults, best practices, and just a few lines of configuration.
21
+ - Prefer [oxlint](https://oxc.rs/docs/guide/usage/linter)? [`@component-hook/oxlint-config`](https://github.com/tzuyi0817/component-hook/tree/master/packages/oxlint-config) is generated from this preset.
21
22
 
22
23
  ## Documentation
23
24
 
24
- For detailed documentation and usage examples, please visit: [Official Docs](https://tzuyi0817.github.io/component-hook/#/eslint/plugin).
25
+ For detailed documentation and usage examples, please visit: [Official Docs](https://tzuyi0817.github.io/component-hook/#/lint/eslint-plugin).
25
26
 
26
27
  ## Installation
27
28
 
@@ -36,7 +37,11 @@ $ yarn add @component-hook/eslint-plugin --dev
36
37
  $ pnpm install @component-hook/eslint-plugin --save-dev
37
38
  ```
38
39
 
39
- Require ESLint >= 9.0.0
40
+ > **Compatibility Note:**
41
+ >
42
+ > Require ESLint >= 9.0.0
43
+ >
44
+ > This package is ESM only because several bundled plugins are ESM only. Write your config as `eslint.config.js` in a `"type": "module"` project or as `eslint.config.mjs`. On Node.js 20.19+ / 22.12+ `require()` still works through `require(esm)`, and the plugin is exposed on the `default` property.
40
45
 
41
46
  ## Basic Usage
42
47
 
@@ -84,6 +89,29 @@ import { vuePreset } from '@component-hook/eslint-plugin';
84
89
  export default vuePreset;
85
90
  ```
86
91
 
92
+ ## Formatting with oxfmt
93
+
94
+ Use `configs.oxfmt` instead of `configs.prettier` to format with [oxfmt](https://oxc.rs/docs/guide/usage/formatter). It discovers `.oxfmtrc.json` (or other oxfmt config files) the same way as the oxfmt CLI, and turns off the stylistic rules that conflict with the formatter.
95
+
96
+ oxfmt also sorts top-level `package.json` keys by default (`sortPackageJson`), so the preset no longer orders them itself; it still sorts nested fields oxfmt leaves alone, such as `exports` conditions and dependency maps. If you stay on `configs.prettier` and still want `package.json` sorted, add [`prettier-plugin-packagejson`](https://github.com/matzkoh/prettier-plugin-packagejson), which uses the same `sort-package-json` order as oxfmt.
97
+
98
+ `oxfmt` >= 0.71.0 is a peer dependency. Most package managers install it automatically; otherwise add it yourself:
99
+
100
+ ```bash
101
+ $ pnpm add -D oxfmt
102
+ ```
103
+
104
+ ```js
105
+ import componentHookPlugin from '@component-hook/eslint-plugin';
106
+
107
+ export default [
108
+ ...componentHookPlugin.configs.basic,
109
+ ...componentHookPlugin.configs.vue,
110
+ componentHookPlugin.configs.oxfmt,
111
+ // your custom config
112
+ ];
113
+ ```
114
+
87
115
  ## Configs
88
116
 
89
117
  | Name | Type | Reference |
@@ -93,6 +121,7 @@ export default vuePreset;
93
121
  | react | `Linter.Config[]` | `eslint-plugin-react/recommended`, `eslint-plugin-react-hooks/recommended`, `eslint-plugin-jsx-a11y/recommended` |
94
122
  | markdown | `Linter.Config[]` | `@eslint/markdown` |
95
123
  | prettier | `Linter.Config` | `eslint-plugin-prettier/recommended` |
124
+ | oxfmt | `Linter.Config` | `eslint-plugin-oxfmt`, `eslint-config-prettier` |
96
125
  | sonarjs | `Linter.Config[]` | `eslint-plugin-sonarjs/recommended` |
97
126
  | security | `Linter.Config` | `eslint-plugin-security/recommended` |
98
127
  | playwright | `Linter.Config` | `eslint-plugin-playwright/flat/recommended` |
@@ -116,6 +145,7 @@ export default vuePreset;
116
145
  - [eslint-plugin-perfectionist](https://github.com/azat-io/eslint-plugin-perfectionist)
117
146
  - [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml)
118
147
  - [eslint-plugin-prettier/recommended](https://github.com/prettier/eslint-plugin-prettier/blob/master/recommended.js)
148
+ - [eslint-plugin-oxfmt](https://github.com/ntnyq/eslint-plugin-oxfmt)
119
149
  - [eslint-plugin-react/recommended](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/configs/recommended.js)
120
150
  - [eslint-plugin-react-hooks/recommended](https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/src/index.js)
121
151
  - [eslint-plugin-jsx-a11y/recommended](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/src/index.js)
package/dist/index.d.mts CHANGED
@@ -1723,6 +1723,11 @@ interface VueRules {
1723
1723
  * @see https://typescript-eslint.io/rules/no-for-in-array
1724
1724
  */
1725
1725
  '@typescript-eslint/no-for-in-array'?: Linter.RuleEntry<[]>;
1726
+ /**
1727
+ * Disallow type operations that resolve to the "empty object" type
1728
+ * @see https://typescript-eslint.io/rules/no-generated-empty-object-type
1729
+ */
1730
+ '@typescript-eslint/no-generated-empty-object-type'?: Linter.RuleEntry<[]>;
1726
1731
  /**
1727
1732
  * Disallow the use of `eval()`-like functions
1728
1733
  * @see https://typescript-eslint.io/rules/no-implied-eval
@@ -2856,6 +2861,11 @@ interface VueRules {
2856
2861
  * @see https://eslint.vuejs.org/rules/no-setup-props-reactivity-loss.html
2857
2862
  */
2858
2863
  'vue/no-setup-props-reactivity-loss'?: Linter.RuleEntry<[]>;
2864
+ /**
2865
+ * disallow the use of event names that collide with native web event names
2866
+ * @see https://eslint.vuejs.org/rules/no-shadow-native-events.html
2867
+ */
2868
+ 'vue/no-shadow-native-events'?: Linter.RuleEntry<[]>;
2859
2869
  /**
2860
2870
  * enforce component's data property to be a function
2861
2871
  * @see https://eslint.vuejs.org/rules/no-shared-component-data.html
@@ -3997,7 +4007,9 @@ type TypescriptEslintNoMeaninglessVoidOperator = [] | [{
3997
4007
  checkNever?: boolean;
3998
4008
  }];
3999
4009
  type TypescriptEslintNoMisusedPromises = [] | [{
4000
- checksConditionals?: boolean;
4010
+ checksConditionals?: (boolean | {
4011
+ flagUnions?: ("all" | "strict" | "none");
4012
+ });
4001
4013
  checksSpreads?: boolean;
4002
4014
  checksVoidReturn?: (boolean | {
4003
4015
  arguments?: boolean;
@@ -5014,7 +5026,7 @@ type VueNoDeprecatedSlotAttribute = [] | [{
5014
5026
  ignoreParents?: string[];
5015
5027
  }];
5016
5028
  type VueNoDupeKeys = [] | [{
5017
- groups?: unknown[];
5029
+ groups?: string[];
5018
5030
  }];
5019
5031
  type VueNoDuplicateAttrInheritance = [] | [{
5020
5032
  checkMultiRootNodes?: boolean;
@@ -5121,8 +5133,8 @@ type VueNoReservedComponentNames = [] | [{
5121
5133
  htmlElementCaseSensitive?: boolean;
5122
5134
  }];
5123
5135
  type VueNoReservedKeys = [] | [{
5124
- reserved?: unknown[];
5125
- groups?: unknown[];
5136
+ reserved?: string[];
5137
+ groups?: string[];
5126
5138
  }];
5127
5139
  type VueNoReservedProps = [] | [{
5128
5140
  vueVersion?: (2 | 3);
@@ -5193,7 +5205,7 @@ type VueNoTemplateTargetBlank = [] | [{
5193
5205
  enforceDynamicLinks?: ("always" | "never");
5194
5206
  }];
5195
5207
  type VueNoUndefComponents = [] | [{
5196
- ignorePatterns?: unknown[];
5208
+ ignorePatterns?: string[];
5197
5209
  }];
5198
5210
  type VueNoUndefDirectives = [] | [{
5199
5211
  ignore?: string[];
@@ -5283,7 +5295,7 @@ type VueOperatorLinebreak = [] | [("after" | "before" | "none" | null)] | [("aft
5283
5295
  };
5284
5296
  }];
5285
5297
  type VueOrderInComponents = [] | [{
5286
- order?: unknown[];
5298
+ order?: (string | string[])[];
5287
5299
  }];
5288
5300
  type VuePaddingLineBetweenBlocks = [] | [("never" | "always")];
5289
5301
  type VuePaddingLineBetweenTags = [] | [{
@@ -5355,8 +5367,8 @@ type VueSinglelineHtmlElementContentNewline = [] | [{
5355
5367
  type VueSlotNameCasing = [] | [("camelCase" | "kebab-case" | "singleword")];
5356
5368
  type VueSortKeys = [] | [("asc" | "desc")] | [("asc" | "desc"), {
5357
5369
  caseSensitive?: boolean;
5358
- ignoreChildrenOf?: unknown[];
5359
- ignoreGrandchildrenOf?: unknown[];
5370
+ ignoreChildrenOf?: string[];
5371
+ ignoreGrandchildrenOf?: string[];
5360
5372
  minKeys?: number;
5361
5373
  natural?: boolean;
5362
5374
  allowLineSeparatedGroups?: boolean;
@@ -5402,7 +5414,7 @@ type VueValidVFor = [] | [{
5402
5414
  allowEmptyAlias?: boolean;
5403
5415
  }];
5404
5416
  type VueValidVOn = [] | [{
5405
- modifiers?: unknown[];
5417
+ modifiers?: string[];
5406
5418
  }];
5407
5419
  type VueValidVSlot = [] | [{
5408
5420
  allowModifiers?: boolean;
@@ -5583,6 +5595,168 @@ type PrettierPrettier = [] | [{
5583
5595
  };
5584
5596
  }];
5585
5597
  //#endregion
5598
+ //#region typegen/oxfmt.d.ts
5599
+ interface OxfmtRules {
5600
+ /**
5601
+ * Format code via oxfmt
5602
+ * @see https://github.com/ntnyq/eslint-plugin-oxfmt
5603
+ */
5604
+ 'oxfmt/oxfmt'?: Linter.RuleEntry<OxfmtOxfmt>;
5605
+ }
5606
+ type OxfmtOxfmt = [] | [{
5607
+ arrowParens?: ("always" | "avoid");
5608
+ bracketSameLine?: boolean;
5609
+ bracketSpacing?: boolean;
5610
+ embeddedLanguageFormatting?: ("auto" | "off");
5611
+ endOfLine?: ("lf" | "crlf" | "cr");
5612
+ experimentalOperatorPosition?: ("start" | "end");
5613
+ htmlWhitespaceSensitivity?: ("css" | "ignore" | "strict");
5614
+ ignorePatterns?: string[];
5615
+ insertFinalNewline?: boolean;
5616
+ jsdoc?: (boolean | {
5617
+ addDefaultToDescription?: boolean;
5618
+ bracketSpacing?: boolean;
5619
+ capitalizeDescriptions?: boolean;
5620
+ commentLineStrategy?: ("singleLine" | "multiline" | "keep");
5621
+ descriptionTag?: boolean;
5622
+ descriptionWithDot?: boolean;
5623
+ keepUnparsableExampleIndent?: boolean;
5624
+ lineWrappingStyle?: ("greedy" | "balance");
5625
+ preferCodeFences?: boolean;
5626
+ separateReturnsFromParam?: boolean;
5627
+ separateTagGroups?: boolean;
5628
+ });
5629
+ jsxSingleQuote?: boolean;
5630
+ objectWrap?: ("preserve" | "collapse");
5631
+ printWidth?: number;
5632
+ proseWrap?: ("always" | "never" | "preserve");
5633
+ quoteProps?: ("as-needed" | "consistent" | "preserve");
5634
+ semi?: boolean;
5635
+ singleAttributePerLine?: boolean;
5636
+ singleQuote?: boolean;
5637
+ sortImports?: (boolean | {
5638
+ customGroups?: {
5639
+ elementNamePattern?: string[];
5640
+ groupName?: string;
5641
+ modifiers?: string[];
5642
+ selector?: string;
5643
+ }[];
5644
+ groups?: (string | string[] | {
5645
+ newlinesBetween: boolean;
5646
+ })[];
5647
+ ignoreCase?: boolean;
5648
+ internalPattern?: string[];
5649
+ newlinesBetween?: boolean;
5650
+ order?: ("asc" | "desc");
5651
+ partitionByComment?: boolean;
5652
+ partitionByNewline?: boolean;
5653
+ sortSideEffects?: boolean;
5654
+ });
5655
+ sortPackageJson?: (boolean | {
5656
+ sortScripts?: boolean;
5657
+ });
5658
+ sortTailwindcss?: (boolean | {
5659
+ attributes?: string[];
5660
+ config?: string;
5661
+ functions?: string[];
5662
+ preserveDuplicates?: boolean;
5663
+ preserveWhitespace?: boolean;
5664
+ stylesheet?: string;
5665
+ });
5666
+ svelte?: (boolean | {
5667
+ allowShorthand?: boolean;
5668
+ indentScriptAndStyle?: boolean;
5669
+ sortOrder?: string;
5670
+ });
5671
+ tabWidth?: number;
5672
+ trailingComma?: ("all" | "es5" | "none");
5673
+ useTabs?: boolean;
5674
+ vueIndentScriptAndStyle?: boolean;
5675
+ configPath?: string;
5676
+ disableNestedConfig?: boolean;
5677
+ editorconfig?: (boolean | {
5678
+ cwd?: string;
5679
+ onlyCwd?: boolean;
5680
+ });
5681
+ ignorePath?: (string | string[]);
5682
+ respectOxfmtDefaultIgnores?: boolean;
5683
+ useConfig?: boolean;
5684
+ withNodeModules?: boolean;
5685
+ overrides?: {
5686
+ excludeFiles?: string[];
5687
+ files: string[];
5688
+ options?: {
5689
+ arrowParens?: ("always" | "avoid");
5690
+ bracketSameLine?: boolean;
5691
+ bracketSpacing?: boolean;
5692
+ embeddedLanguageFormatting?: ("auto" | "off");
5693
+ endOfLine?: ("lf" | "crlf" | "cr");
5694
+ experimentalOperatorPosition?: ("start" | "end");
5695
+ htmlWhitespaceSensitivity?: ("css" | "ignore" | "strict");
5696
+ insertFinalNewline?: boolean;
5697
+ jsdoc?: (boolean | {
5698
+ addDefaultToDescription?: boolean;
5699
+ bracketSpacing?: boolean;
5700
+ capitalizeDescriptions?: boolean;
5701
+ commentLineStrategy?: ("singleLine" | "multiline" | "keep");
5702
+ descriptionTag?: boolean;
5703
+ descriptionWithDot?: boolean;
5704
+ keepUnparsableExampleIndent?: boolean;
5705
+ lineWrappingStyle?: ("greedy" | "balance");
5706
+ preferCodeFences?: boolean;
5707
+ separateReturnsFromParam?: boolean;
5708
+ separateTagGroups?: boolean;
5709
+ });
5710
+ jsxSingleQuote?: boolean;
5711
+ objectWrap?: ("preserve" | "collapse");
5712
+ printWidth?: number;
5713
+ proseWrap?: ("always" | "never" | "preserve");
5714
+ quoteProps?: ("as-needed" | "consistent" | "preserve");
5715
+ semi?: boolean;
5716
+ singleAttributePerLine?: boolean;
5717
+ singleQuote?: boolean;
5718
+ sortImports?: (boolean | {
5719
+ customGroups?: {
5720
+ elementNamePattern?: string[];
5721
+ groupName?: string;
5722
+ modifiers?: string[];
5723
+ selector?: string;
5724
+ }[];
5725
+ groups?: (string | string[] | {
5726
+ newlinesBetween: boolean;
5727
+ })[];
5728
+ ignoreCase?: boolean;
5729
+ internalPattern?: string[];
5730
+ newlinesBetween?: boolean;
5731
+ order?: ("asc" | "desc");
5732
+ partitionByComment?: boolean;
5733
+ partitionByNewline?: boolean;
5734
+ sortSideEffects?: boolean;
5735
+ });
5736
+ sortPackageJson?: (boolean | {
5737
+ sortScripts?: boolean;
5738
+ });
5739
+ sortTailwindcss?: (boolean | {
5740
+ attributes?: string[];
5741
+ config?: string;
5742
+ functions?: string[];
5743
+ preserveDuplicates?: boolean;
5744
+ preserveWhitespace?: boolean;
5745
+ stylesheet?: string;
5746
+ });
5747
+ svelte?: (boolean | {
5748
+ allowShorthand?: boolean;
5749
+ indentScriptAndStyle?: boolean;
5750
+ sortOrder?: string;
5751
+ });
5752
+ tabWidth?: number;
5753
+ trailingComma?: ("all" | "es5" | "none");
5754
+ useTabs?: boolean;
5755
+ vueIndentScriptAndStyle?: boolean;
5756
+ };
5757
+ }[];
5758
+ }];
5759
+ //#endregion
5586
5760
  //#region typegen/sonarjs.d.ts
5587
5761
  interface SonarjsRules {
5588
5762
  /**
@@ -5635,6 +5809,11 @@ interface SonarjsRules {
5635
5809
  * @see https://sonarsource.github.io/rspec/#/rspec/S8780/javascript
5636
5810
  */
5637
5811
  'sonarjs/async-test-assertions'?: Linter.RuleEntry<[]>;
5812
+ /**
5813
+ * Nested properties of Lodash and Underscore.js clone results should not be mutated
5814
+ * @see https://sonarsource.github.io/rspec/#/rspec/S9135/javascript
5815
+ */
5816
+ 'sonarjs/avoid-mutating-nested-properties-of-shallow-clones'?: Linter.RuleEntry<[]>;
5638
5817
  /**
5639
5818
  * AWS API Gateway should require authentication
5640
5819
  * @see https://sonarsource.github.io/rspec/#/rspec/S6333/javascript
@@ -5780,6 +5959,11 @@ interface SonarjsRules {
5780
5959
  * @see https://sonarsource.github.io/rspec/#/rspec/S124/javascript
5781
5960
  */
5782
5961
  'sonarjs/comment-regex'?: Linter.RuleEntry<SonarjsCommentRegex>;
5962
+ /**
5963
+ * Composite assertions should be split
5964
+ * @see https://sonarsource.github.io/rspec/#/rspec/S9073/javascript
5965
+ */
5966
+ 'sonarjs/composite-assertions'?: Linter.RuleEntry<[]>;
5783
5967
  /**
5784
5968
  * Regular expression quantifiers and character classes should be used concisely
5785
5969
  * @see https://sonarsource.github.io/rspec/#/rspec/S6353/javascript
@@ -6159,6 +6343,11 @@ interface SonarjsRules {
6159
6343
  * @see https://sonarsource.github.io/rspec/#/rspec/S1854/javascript
6160
6344
  */
6161
6345
  'sonarjs/no-dead-store'?: Linter.RuleEntry<[]>;
6346
+ /**
6347
+ * Lodash and Underscore.js debounced or throttled functions should not be recreated on every React render
6348
+ * @see https://sonarsource.github.io/rspec/#/rspec/S9114/javascript
6349
+ */
6350
+ 'sonarjs/no-debounce-throttle-in-render'?: Linter.RuleEntry<[]>;
6162
6351
  /**
6163
6352
  * UI test debug commands should not be committed to version control
6164
6353
  * @see https://sonarsource.github.io/rspec/#/rspec/S8959/javascript
@@ -6179,6 +6368,11 @@ interface SonarjsRules {
6179
6368
  * @see https://sonarsource.github.io/rspec/#/rspec/S4621/javascript
6180
6369
  */
6181
6370
  'sonarjs/no-duplicate-in-composite'?: Linter.RuleEntry<[]>;
6371
+ /**
6372
+ * Parameterized tests should not contain duplicate test cases
6373
+ * @see https://sonarsource.github.io/rspec/#/rspec/S9078/javascript
6374
+ */
6375
+ 'sonarjs/no-duplicate-parameterized-test-case'?: Linter.RuleEntry<[]>;
6182
6376
  /**
6183
6377
  * String literals should not be duplicated
6184
6378
  * @see https://sonarsource.github.io/rspec/#/rspec/S1192/javascript
@@ -6224,6 +6418,11 @@ interface SonarjsRules {
6224
6418
  * @see https://sonarsource.github.io/rspec/#/rspec/S6331/javascript
6225
6419
  */
6226
6420
  'sonarjs/no-empty-group'?: Linter.RuleEntry<[]>;
6421
+ /**
6422
+ * Parameterized tests should not have empty datasets
6423
+ * @see https://sonarsource.github.io/rspec/#/rspec/S8998/javascript
6424
+ */
6425
+ 'sonarjs/no-empty-parameterized-test-dataset'?: Linter.RuleEntry<[]>;
6227
6426
  /**
6228
6427
  * Test files should contain at least one test case
6229
6428
  * @see https://sonarsource.github.io/rspec/#/rspec/S2187/javascript
@@ -6447,6 +6646,11 @@ interface SonarjsRules {
6447
6646
  * @deprecated
6448
6647
  */
6449
6648
  'sonarjs/no-mixed-content'?: Linter.RuleEntry<[]>;
6649
+ /**
6650
+ * Reactive state should not be unconditionally mutated inside Vue's "updated" lifecycle hook
6651
+ * @see https://sonarsource.github.io/rspec/#/rspec/S9163/javascript
6652
+ */
6653
+ 'sonarjs/no-mutate-reactive-state-in-updated-hook'?: Linter.RuleEntry<[]>;
6450
6654
  /**
6451
6655
  * Assignments should not be made from within sub-expressions
6452
6656
  * @see https://sonarsource.github.io/rspec/#/rspec/S1121/javascript
@@ -6477,6 +6681,11 @@ interface SonarjsRules {
6477
6681
  * @see https://sonarsource.github.io/rspec/#/rspec/S4624/javascript
6478
6682
  */
6479
6683
  'sonarjs/no-nested-template-literals'?: Linter.RuleEntry<[]>;
6684
+ /**
6685
+ * Playwright "networkidle" waits should not be used
6686
+ * @see https://sonarsource.github.io/rspec/#/rspec/S9332/javascript
6687
+ */
6688
+ 'sonarjs/no-networkidle-wait'?: Linter.RuleEntry<[]>;
6480
6689
  /**
6481
6690
  * OS commands should not rely on PATH resolution
6482
6691
  * @see https://sonarsource.github.io/rspec/#/rspec/S4036/javascript
@@ -6513,7 +6722,7 @@ interface SonarjsRules {
6513
6722
  */
6514
6723
  'sonarjs/no-redundant-optional'?: Linter.RuleEntry<[]>;
6515
6724
  /**
6516
- * Unnecessary parentheses should be removed
6725
+ * Redundant pairs of parentheses should be removed
6517
6726
  * @see https://sonarsource.github.io/rspec/#/rspec/S1110/javascript
6518
6727
  * @deprecated
6519
6728
  */
@@ -6675,6 +6884,16 @@ interface SonarjsRules {
6675
6884
  * @see https://sonarsource.github.io/rspec/#/rspec/S1526/javascript
6676
6885
  */
6677
6886
  'sonarjs/no-variable-usage-before-declaration'?: Linter.RuleEntry<[]>;
6887
+ /**
6888
+ * Vue components should not use the deprecated "vue-class-component" or "vue-property-decorator" libraries
6889
+ * @see https://sonarsource.github.io/rspec/#/rspec/S9145/javascript
6890
+ */
6891
+ 'sonarjs/no-vue-class-component'?: Linter.RuleEntry<[]>;
6892
+ /**
6893
+ * Vue components should not use mixins
6894
+ * @see https://sonarsource.github.io/rspec/#/rspec/S9150/javascript
6895
+ */
6896
+ 'sonarjs/no-vue-mixins'?: Linter.RuleEntry<[]>;
6678
6897
  /**
6679
6898
  * Cipher algorithms should be robust
6680
6899
  * @see https://sonarsource.github.io/rspec/#/rspec/S5547/javascript
@@ -6731,6 +6950,11 @@ interface SonarjsRules {
6731
6950
  * @see https://sonarsource.github.io/rspec/#/rspec/S2819/javascript
6732
6951
  */
6733
6952
  'sonarjs/post-message'?: Linter.RuleEntry<[]>;
6953
+ /**
6954
+ * Cypress assertions should be retryable
6955
+ * @see https://sonarsource.github.io/rspec/#/rspec/S9162/javascript
6956
+ */
6957
+ 'sonarjs/prefer-cypress-should'?: Linter.RuleEntry<[]>;
6734
6958
  /**
6735
6959
  * "default" clauses should be last
6736
6960
  * @see https://sonarsource.github.io/rspec/#/rspec/S4524/javascript
@@ -6741,6 +6965,16 @@ interface SonarjsRules {
6741
6965
  * @see https://sonarsource.github.io/rspec/#/rspec/S1488/javascript
6742
6966
  */
6743
6967
  'sonarjs/prefer-immediate-return'?: Linter.RuleEntry<[]>;
6968
+ /**
6969
+ * Native APIs should be preferred over Axios utility methods
6970
+ * @see https://sonarsource.github.io/rspec/#/rspec/S9339/javascript
6971
+ */
6972
+ 'sonarjs/prefer-native-axios-alternative'?: Linter.RuleEntry<[]>;
6973
+ /**
6974
+ * Native APIs should be preferred over jQuery utility methods
6975
+ * @see https://sonarsource.github.io/rspec/#/rspec/S9144/javascript
6976
+ */
6977
+ 'sonarjs/prefer-native-jquery-alternative'?: Linter.RuleEntry<[]>;
6744
6978
  /**
6745
6979
  * Native APIs should be preferred over Lodash and Underscore.js methods
6746
6980
  * @see https://sonarsource.github.io/rspec/#/rspec/S8907/javascript
@@ -6881,6 +7115,11 @@ interface SonarjsRules {
6881
7115
  * @see https://sonarsource.github.io/rspec/#/rspec/S8786/javascript
6882
7116
  */
6883
7117
  'sonarjs/super-linear-regex'?: Linter.RuleEntry<[]>;
7118
+ /**
7119
+ * Synchronous exception assertions should receive synchronous callbacks
7120
+ * @see https://sonarsource.github.io/rspec/#/rspec/S9072/javascript
7121
+ */
7122
+ 'sonarjs/synchronous-exception-assertions'?: Linter.RuleEntry<[]>;
6884
7123
  /**
6885
7124
  * Tests should not be registered asynchronously in suite callbacks
6886
7125
  * @see https://sonarsource.github.io/rspec/#/rspec/S8785/javascript
@@ -6901,6 +7140,16 @@ interface SonarjsRules {
6901
7140
  * @see https://sonarsource.github.io/rspec/#/rspec/S5958/javascript
6902
7141
  */
6903
7142
  'sonarjs/test-check-exception'?: Linter.RuleEntry<[]>;
7143
+ /**
7144
+ * Testing Library disappearance waits should use non-throwing queries
7145
+ * @see https://sonarsource.github.io/rspec/#/rspec/S9153/javascript
7146
+ */
7147
+ 'sonarjs/testing-library-prefer-query-by-disappearance'?: Linter.RuleEntry<[]>;
7148
+ /**
7149
+ * Testing Library queries should match presence assertions
7150
+ * @see https://sonarsource.github.io/rspec/#/rspec/S9027/javascript
7151
+ */
7152
+ 'sonarjs/testing-library-query-assertion'?: Linter.RuleEntry<[]>;
6904
7153
  /**
6905
7154
  * Track uses of "TODO" tags
6906
7155
  * @see https://sonarsource.github.io/rspec/#/rspec/S1135/javascript
@@ -6967,6 +7216,11 @@ interface SonarjsRules {
6967
7216
  * @see https://sonarsource.github.io/rspec/#/rspec/S117/javascript
6968
7217
  */
6969
7218
  'sonarjs/variable-name'?: Linter.RuleEntry<SonarjsVariableName>;
7219
+ /**
7220
+ * vi.mock should be declared at module scope
7221
+ * @see https://sonarsource.github.io/rspec/#/rspec/S9169/javascript
7222
+ */
7223
+ 'sonarjs/vitest-mock-at-module-scope'?: Linter.RuleEntry<[]>;
6970
7224
  /**
6971
7225
  * "void" should not be used
6972
7226
  * @see https://sonarsource.github.io/rspec/#/rspec/S3735/javascript
@@ -7169,6 +7423,11 @@ interface PlaywrightRules {
7169
7423
  * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/missing-playwright-await.md
7170
7424
  */
7171
7425
  'playwright/missing-playwright-await'?: Linter.RuleEntry<PlaywrightMissingPlaywrightAwait>;
7426
+ /**
7427
+ * Disallow the `timeout` option on actions
7428
+ * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-action-timeout.md
7429
+ */
7430
+ 'playwright/no-action-timeout'?: Linter.RuleEntry<PlaywrightNoActionTimeout>;
7172
7431
  /**
7173
7432
  * Disallow commented out tests
7174
7433
  * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-commented-out-tests.md
@@ -7204,6 +7463,11 @@ interface PlaywrightRules {
7204
7463
  * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-eval.md
7205
7464
  */
7206
7465
  'playwright/no-eval'?: Linter.RuleEntry<[]>;
7466
+ /**
7467
+ * Disallow using `export` in files containing tests
7468
+ * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-export.md
7469
+ */
7470
+ 'playwright/no-export'?: Linter.RuleEntry<[]>;
7207
7471
  /**
7208
7472
  * Prevent usage of `.only()` focus test annotation
7209
7473
  * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-focused-test.md
@@ -7224,6 +7488,16 @@ interface PlaywrightRules {
7224
7488
  * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-hooks.md
7225
7489
  */
7226
7490
  'playwright/no-hooks'?: Linter.RuleEntry<PlaywrightNoHooks>;
7491
+ /**
7492
+ * Disallow identical titles
7493
+ * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-identical-title.md
7494
+ */
7495
+ 'playwright/no-identical-title'?: Linter.RuleEntry<[]>;
7496
+ /**
7497
+ * Disallow magic numbers as Playwright timeout values
7498
+ * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-magic-timeouts.md
7499
+ */
7500
+ 'playwright/no-magic-timeouts'?: Linter.RuleEntry<PlaywrightNoMagicTimeouts>;
7227
7501
  /**
7228
7502
  * Disallow nested `test.step()` methods
7229
7503
  * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-nested-step.md
@@ -7279,6 +7553,16 @@ interface PlaywrightRules {
7279
7553
  * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-standalone-expect.md
7280
7554
  */
7281
7555
  'playwright/no-standalone-expect'?: Linter.RuleEntry<[]>;
7556
+ /**
7557
+ * Disallow template literals in test, describe, and step titles
7558
+ * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-template-literal-title.md
7559
+ */
7560
+ 'playwright/no-template-literal-title'?: Linter.RuleEntry<PlaywrightNoTemplateLiteralTitle>;
7561
+ /**
7562
+ * Disallow explicitly returning from tests
7563
+ * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-test-return-statement.md
7564
+ */
7565
+ 'playwright/no-test-return-statement'?: Linter.RuleEntry<[]>;
7282
7566
  /**
7283
7567
  * Disallow assertions on a Locator that can never fail
7284
7568
  * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/no-unnecessary-assertions.md
@@ -7324,6 +7608,11 @@ interface PlaywrightRules {
7324
7608
  * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/prefer-comparison-matcher.md
7325
7609
  */
7326
7610
  'playwright/prefer-comparison-matcher'?: Linter.RuleEntry<[]>;
7611
+ /**
7612
+ * Prefer having the last statement in a test be an assertion
7613
+ * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/prefer-ending-with-an-expect.md
7614
+ */
7615
+ 'playwright/prefer-ending-with-an-expect'?: Linter.RuleEntry<PlaywrightPreferEndingWithAnExpect>;
7327
7616
  /**
7328
7617
  * Suggest using the built-in equality matchers
7329
7618
  * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/prefer-equality-matcher.md
@@ -7384,6 +7673,11 @@ interface PlaywrightRules {
7384
7673
  * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/prefer-web-first-assertions.md
7385
7674
  */
7386
7675
  'playwright/prefer-web-first-assertions'?: Linter.RuleEntry<[]>;
7676
+ /**
7677
+ * Require a reason for `.skip()` and `.fixme()` annotations
7678
+ * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/require-annotation-reason.md
7679
+ */
7680
+ 'playwright/require-annotation-reason'?: Linter.RuleEntry<PlaywrightRequireAnnotationReason>;
7387
7681
  /**
7388
7682
  * Require setup and teardown code to be within a hook
7389
7683
  * @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/require-hook.md
@@ -7454,9 +7748,17 @@ type PlaywrightMissingPlaywrightAwait = [] | [{
7454
7748
  customMatchers?: string[];
7455
7749
  includePageLocatorMethods?: boolean;
7456
7750
  }];
7751
+ type PlaywrightNoActionTimeout = [] | [{
7752
+ allow?: string[];
7753
+ }];
7457
7754
  type PlaywrightNoHooks = [] | [{
7458
7755
  allow?: unknown[];
7459
7756
  }];
7757
+ type PlaywrightNoMagicTimeouts = [] | [{
7758
+ allow?: number[];
7759
+ minOccurrences?: number;
7760
+ properties?: string[];
7761
+ }];
7460
7762
  type PlaywrightNoRawLocators = [] | [{
7461
7763
  allowed?: string[];
7462
7764
  }];
@@ -7472,12 +7774,22 @@ type PlaywrightNoRestrictedRoles = [] | [(string | {
7472
7774
  role: string;
7473
7775
  })[]];
7474
7776
  type PlaywrightNoSkippedTest = [] | [{
7475
- allowConditional?: boolean;
7777
+ allowConditional?: (boolean | {
7778
+ fixme?: boolean;
7779
+ skip?: boolean;
7780
+ });
7476
7781
  disallowFixme?: boolean;
7477
7782
  }];
7478
7783
  type PlaywrightNoSlowedTest = [] | [{
7479
7784
  allowConditional?: boolean;
7480
7785
  }];
7786
+ type PlaywrightNoTemplateLiteralTitle = [] | [{
7787
+ ignore?: ("test" | "test.describe" | "test.step")[];
7788
+ }];
7789
+ type PlaywrightPreferEndingWithAnExpect = [] | [{
7790
+ assertFunctionNames?: string[];
7791
+ assertFunctionPatterns?: string[];
7792
+ }];
7481
7793
  type PlaywrightPreferLowercaseTitle = [] | [{
7482
7794
  allowedPrefixes?: string[];
7483
7795
  ignore?: ("test.describe" | "test")[];
@@ -7486,6 +7798,10 @@ type PlaywrightPreferLowercaseTitle = [] | [{
7486
7798
  type PlaywrightPreferNativeLocators = [] | [{
7487
7799
  testIdAttribute?: string;
7488
7800
  }];
7801
+ type PlaywrightRequireAnnotationReason = [] | [{
7802
+ annotations?: ("fail" | "fixme" | "skip" | "slow")[];
7803
+ pattern?: string;
7804
+ }];
7489
7805
  type PlaywrightRequireHook = [] | [{
7490
7806
  allowedFunctionCalls?: string[];
7491
7807
  }];
@@ -7721,6 +8037,7 @@ declare const _default: {
7721
8037
  vue: Config<VueRules>[];
7722
8038
  markdown: Config<MarkdownRules>[];
7723
8039
  prettier: Config<PrettierRules>;
8040
+ oxfmt: Config<OxfmtRules>;
7724
8041
  sonarjs: Config<SonarjsRules>[];
7725
8042
  security: Config<SecurityRules>;
7726
8043
  playwright: Config<PlaywrightRules>;
@@ -7731,13 +8048,13 @@ declare const _default: {
7731
8048
  'testing-library/marko': Config<TestingLibraryRules>;
7732
8049
  };
7733
8050
  };
7734
- declare const reactPreset: (Config | {
8051
+ export declare const reactPreset: (Config | {
7735
8052
  name: string;
7736
8053
  ignores: string[];
7737
8054
  })[];
7738
- declare const vuePreset: (Config | {
8055
+ export declare const vuePreset: (Config | {
7739
8056
  name: string;
7740
8057
  ignores: string[];
7741
8058
  })[];
7742
8059
  //#endregion
7743
- export { _default as default, reactPreset, vuePreset };
8060
+ export { _default as default };