mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
feat(linter): mark jest/vitest rules as recommended (#27672)
Copying recommended state from upstream Jest/Vitest plugin.
This commit is contained in:
1 parent
6ae6859ecd
commit
780bff398e
36 files changed
+79
-6
No files matched your search
@@ -14,6 +14,7 @@ declare_oxc_lint!(
|
||||
ExpectExpect,
|
||||
jest,
|
||||
correctness,
|
||||
recommended,
|
||||
config = ExpectExpectConfig,
|
||||
docs = DOCUMENTATION,
|
||||
version = "0.0.12",
|
||||
|
||||
@@ -54,6 +54,7 @@ declare_oxc_lint!(
|
||||
NoAliasMethods,
|
||||
jest,
|
||||
style,
|
||||
recommended,
|
||||
fix,
|
||||
version = "0.0.12",
|
||||
short_description = "Enforces Jest's canonical matcher names instead of aliases.",
|
||||
|
||||
@@ -9,7 +9,14 @@ use crate::{
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct NoCommentedOutTests;
|
||||
|
||||
declare_oxc_lint!(NoCommentedOutTests, jest, suspicious, docs = DOCUMENTATION, version = "0.0.8",);
|
||||
declare_oxc_lint!(
|
||||
NoCommentedOutTests,
|
||||
jest,
|
||||
suspicious,
|
||||
recommended,
|
||||
docs = DOCUMENTATION,
|
||||
version = "0.0.8",
|
||||
);
|
||||
|
||||
impl Rule for NoCommentedOutTests {
|
||||
fn run_once(&self, ctx: &LintContext) {
|
||||
|
||||
@@ -10,7 +10,14 @@ use crate::{
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct NoConditionalExpect;
|
||||
|
||||
declare_oxc_lint!(NoConditionalExpect, jest, correctness, docs = DOCUMENTATION, version = "0.0.12",);
|
||||
declare_oxc_lint!(
|
||||
NoConditionalExpect,
|
||||
jest,
|
||||
correctness,
|
||||
recommended,
|
||||
docs = DOCUMENTATION,
|
||||
version = "0.0.12",
|
||||
);
|
||||
|
||||
impl Rule for NoConditionalExpect {
|
||||
fn run_on_jest_node<'a, 'c>(
|
||||
|
||||
@@ -111,6 +111,7 @@ declare_oxc_lint!(
|
||||
NoDeprecatedFunctions,
|
||||
jest,
|
||||
style,
|
||||
recommended,
|
||||
fix,
|
||||
config = NoDeprecatedFunctionsConfig,
|
||||
version = "0.0.18",
|
||||
|
||||
@@ -14,6 +14,7 @@ declare_oxc_lint!(
|
||||
NoDisabledTests,
|
||||
jest,
|
||||
correctness,
|
||||
recommended,
|
||||
docs = DOCUMENTATION,
|
||||
version = "0.0.7",
|
||||
short_description = SHORT_DESCRIPTION,
|
||||
|
||||
@@ -76,6 +76,7 @@ declare_oxc_lint!(
|
||||
jest,
|
||||
// TODO: add suggestion (see jest-community/eslint-plugin-jest#586)
|
||||
style,
|
||||
recommended,
|
||||
pending,
|
||||
version = "0.0.13",
|
||||
short_description = "This rule checks the function parameter of hooks & tests for use of the done argument, suggesting you return a promise instead.",
|
||||
|
||||
@@ -42,6 +42,7 @@ declare_oxc_lint!(
|
||||
NoExport,
|
||||
jest,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.0.13",
|
||||
short_description = "Prevents using exports if a file has one or more tests in it.",
|
||||
);
|
||||
|
||||
@@ -14,6 +14,7 @@ declare_oxc_lint!(
|
||||
NoFocusedTests,
|
||||
jest,
|
||||
correctness,
|
||||
recommended,
|
||||
suggestion,
|
||||
docs = DOCUMENTATION,
|
||||
version = "0.0.8",
|
||||
|
||||
@@ -9,7 +9,14 @@ use crate::{
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct NoIdenticalTitle;
|
||||
|
||||
declare_oxc_lint!(NoIdenticalTitle, jest, style, docs = DOCUMENTATION, version = "0.0.14",);
|
||||
declare_oxc_lint!(
|
||||
NoIdenticalTitle,
|
||||
jest,
|
||||
style,
|
||||
recommended,
|
||||
docs = DOCUMENTATION,
|
||||
version = "0.0.14",
|
||||
);
|
||||
|
||||
impl Rule for NoIdenticalTitle {
|
||||
fn run_once(&self, ctx: &LintContext) {
|
||||
|
||||
@@ -14,6 +14,7 @@ declare_oxc_lint!(
|
||||
NoInterpolationInSnapshots,
|
||||
jest,
|
||||
style,
|
||||
recommended,
|
||||
docs = DOCUMENTATION,
|
||||
version = "0.0.13",
|
||||
);
|
||||
|
||||
@@ -65,6 +65,7 @@ declare_oxc_lint!(
|
||||
NoJasmineGlobals,
|
||||
jest,
|
||||
style,
|
||||
recommended,
|
||||
conditional_fix,
|
||||
version = "0.0.13",
|
||||
short_description = "This rule reports on any usage of Jasmine globals, which are not ported to Jest, and suggests alternatives from Jest's own API.",
|
||||
|
||||
@@ -12,6 +12,7 @@ declare_oxc_lint!(
|
||||
NoMocksImport,
|
||||
jest,
|
||||
style,
|
||||
recommended,
|
||||
docs = SharedNoMocksImport::DOCUMENTATION,
|
||||
version = "0.0.13",
|
||||
);
|
||||
|
||||
@@ -13,6 +13,7 @@ declare_oxc_lint!(
|
||||
NoStandaloneExpect,
|
||||
jest,
|
||||
correctness,
|
||||
recommended,
|
||||
config = SharedNoStandaloneExpect::NoStandaloneExpectConfig,
|
||||
docs = SharedNoStandaloneExpect::DOCUMENTATION,
|
||||
version = "0.0.13",
|
||||
|
||||
@@ -12,7 +12,15 @@ use crate::{
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct NoTestPrefixes;
|
||||
|
||||
declare_oxc_lint!(NoTestPrefixes, jest, style, fix, docs = DOCUMENTATION, version = "0.0.7",);
|
||||
declare_oxc_lint!(
|
||||
NoTestPrefixes,
|
||||
jest,
|
||||
style,
|
||||
recommended,
|
||||
fix,
|
||||
docs = DOCUMENTATION,
|
||||
version = "0.0.7",
|
||||
);
|
||||
|
||||
impl Rule for NoTestPrefixes {
|
||||
fn run_on_jest_node<'a, 'c>(
|
||||
|
||||
@@ -48,6 +48,7 @@ declare_oxc_lint!(
|
||||
ValidDescribeCallback,
|
||||
jest,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.0.8",
|
||||
short_description = "Enforce that the second argument to `describe()` is a valid callback function.",
|
||||
);
|
||||
|
||||
@@ -13,6 +13,7 @@ declare_oxc_lint!(
|
||||
ValidExpect,
|
||||
jest,
|
||||
correctness,
|
||||
recommended,
|
||||
suggestion,
|
||||
config = ValidExpectConfig,
|
||||
docs = DOCUMENTATION,
|
||||
|
||||
@@ -14,6 +14,7 @@ declare_oxc_lint!(
|
||||
ValidExpectInPromise,
|
||||
jest,
|
||||
correctness,
|
||||
recommended,
|
||||
docs = DOCUMENTATION,
|
||||
version = "1.60.0",
|
||||
);
|
||||
|
||||
@@ -14,6 +14,7 @@ declare_oxc_lint!(
|
||||
ValidTitle,
|
||||
jest,
|
||||
correctness,
|
||||
recommended,
|
||||
conditional_fix,
|
||||
// TODO: Replace this with an actual config struct. This is a dummy value to
|
||||
// indicate that this rule has configuration and avoid errors.
|
||||
|
||||
@@ -14,6 +14,7 @@ declare_oxc_lint!(
|
||||
ExpectExpect,
|
||||
vitest,
|
||||
correctness,
|
||||
recommended,
|
||||
config = ExpectExpectConfig,
|
||||
docs = DOCUMENTATION,
|
||||
version = "0.0.12",
|
||||
|
||||
@@ -9,7 +9,14 @@ use crate::{
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct NoCommentedOutTests;
|
||||
|
||||
declare_oxc_lint!(NoCommentedOutTests, vitest, suspicious, docs = DOCUMENTATION, version = "0.0.8",);
|
||||
declare_oxc_lint!(
|
||||
NoCommentedOutTests,
|
||||
vitest,
|
||||
suspicious,
|
||||
recommended,
|
||||
docs = DOCUMENTATION,
|
||||
version = "0.0.8",
|
||||
);
|
||||
|
||||
impl Rule for NoCommentedOutTests {
|
||||
fn run_once(&self, ctx: &LintContext) {
|
||||
|
||||
@@ -14,6 +14,7 @@ declare_oxc_lint!(
|
||||
NoConditionalExpect,
|
||||
vitest,
|
||||
correctness,
|
||||
recommended,
|
||||
docs = DOCUMENTATION,
|
||||
version = "0.0.12",
|
||||
);
|
||||
|
||||
@@ -14,6 +14,7 @@ declare_oxc_lint!(
|
||||
NoDisabledTests,
|
||||
vitest,
|
||||
correctness,
|
||||
recommended,
|
||||
docs = DOCUMENTATION,
|
||||
version = "0.0.7",
|
||||
short_description = SHORT_DESCRIPTION,
|
||||
|
||||
@@ -14,6 +14,7 @@ declare_oxc_lint!(
|
||||
NoFocusedTests,
|
||||
vitest,
|
||||
correctness,
|
||||
recommended,
|
||||
suggestion,
|
||||
docs = DOCUMENTATION,
|
||||
version = "0.0.8",
|
||||
|
||||
@@ -9,7 +9,14 @@ use crate::{
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct NoIdenticalTitle;
|
||||
|
||||
declare_oxc_lint!(NoIdenticalTitle, vitest, style, docs = DOCUMENTATION, version = "0.0.14",);
|
||||
declare_oxc_lint!(
|
||||
NoIdenticalTitle,
|
||||
vitest,
|
||||
style,
|
||||
recommended,
|
||||
docs = DOCUMENTATION,
|
||||
version = "0.0.14",
|
||||
);
|
||||
|
||||
impl Rule for NoIdenticalTitle {
|
||||
fn run_once(&self, ctx: &LintContext) {
|
||||
|
||||
@@ -48,6 +48,7 @@ declare_oxc_lint!(
|
||||
NoImportNodeTest,
|
||||
vitest,
|
||||
style,
|
||||
recommended,
|
||||
suggestion,
|
||||
version = "0.7.0",
|
||||
short_description = "Disallow importing from `node:test`, preferring `vitest` instead.",
|
||||
|
||||
@@ -14,6 +14,7 @@ declare_oxc_lint!(
|
||||
NoInterpolationInSnapshots,
|
||||
vitest,
|
||||
style,
|
||||
recommended,
|
||||
docs = DOCUMENTATION,
|
||||
version = "0.0.13",
|
||||
);
|
||||
|
||||
@@ -11,6 +11,7 @@ declare_oxc_lint!(
|
||||
NoMocksImport,
|
||||
vitest,
|
||||
style,
|
||||
recommended,
|
||||
docs = SharedNoMocksImport::DOCUMENTATION,
|
||||
version = "0.0.13",
|
||||
);
|
||||
|
||||
@@ -12,6 +12,7 @@ declare_oxc_lint!(
|
||||
NoStandaloneExpect,
|
||||
vitest,
|
||||
correctness,
|
||||
recommended,
|
||||
config = SharedNoStandaloneExpect::NoStandaloneExpectConfig,
|
||||
docs = SharedNoStandaloneExpect::DOCUMENTATION,
|
||||
version = "0.0.13",
|
||||
|
||||
@@ -14,6 +14,7 @@ declare_oxc_lint!(
|
||||
NoUnneededAsyncExpectFunction,
|
||||
vitest,
|
||||
style,
|
||||
recommended,
|
||||
fix,
|
||||
docs = DOCUMENTATION,
|
||||
version = "1.39.0",
|
||||
|
||||
@@ -187,6 +187,7 @@ declare_oxc_lint!(
|
||||
PreferCalledExactlyOnceWith,
|
||||
vitest,
|
||||
style,
|
||||
recommended,
|
||||
dangerous_fix,
|
||||
version = "1.58.0",
|
||||
short_description = "It checks when a target is asserted with both `toHaveBeenCalledOnce` and `toHaveBeenCalledWith` instead of `toHaveBeenCalledExactlyOnceWith`.",
|
||||
|
||||
+1
@@ -86,6 +86,7 @@ declare_oxc_lint!(
|
||||
RequireLocalTestContextForConcurrentSnapshots,
|
||||
vitest,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.8.0",
|
||||
short_description = "The rule is intended to ensure that concurrent snapshot tests are executed within a properly configured local test context.",
|
||||
);
|
||||
|
||||
@@ -43,6 +43,7 @@ declare_oxc_lint!(
|
||||
ValidDescribeCallback,
|
||||
vitest,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.0.8",
|
||||
short_description = "Enforce that the second argument to `describe()` is a valid callback function.",
|
||||
);
|
||||
|
||||
@@ -19,6 +19,7 @@ declare_oxc_lint!(
|
||||
ValidExpect,
|
||||
vitest,
|
||||
correctness,
|
||||
recommended,
|
||||
suggestion,
|
||||
config = ValidExpectConfig,
|
||||
docs = DOCUMENTATION,
|
||||
|
||||
@@ -14,6 +14,7 @@ declare_oxc_lint!(
|
||||
ValidExpectInPromise,
|
||||
vitest,
|
||||
correctness,
|
||||
recommended,
|
||||
docs = DOCUMENTATION,
|
||||
version = "1.60.0",
|
||||
);
|
||||
|
||||
@@ -14,6 +14,7 @@ declare_oxc_lint!(
|
||||
ValidTitle,
|
||||
vitest,
|
||||
correctness,
|
||||
recommended,
|
||||
conditional_fix,
|
||||
// TODO: Replace this with an actual config struct. This is a dummy value to
|
||||
// indicate that this rule has configuration and avoid errors.
|
||||
|
||||
Reference in new issue
Block a user