diff --git a/.eslintrc.js b/.eslintrc.js index f1dd57cda..f59291d44 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -71,11 +71,17 @@ module.exports = { globals, }, { - files: ['src/**/*', 'dangerfile.ts'], + files: ['src/**/*', 'dangerfile.ts', 'tools/*'], parserOptions: { sourceType: 'module', }, }, + { + files: ['tools/*'], + rules: { + 'node/shebang': 'off', + }, + }, { files: ['.eslintrc.js', 'babel.config.js'], rules: { diff --git a/README.md b/README.md index ae8aa58b9..aad622061 100644 --- a/README.md +++ b/README.md @@ -125,49 +125,53 @@ installations requiring long-term consistency. ## Rules -| Rule | Description | Configurations | Fixable | -| ------------------------------ | ----------------------------------------------------------------- | ---------------- | ------------------- | -| [consistent-test-it][] | Enforce consistent test or it keyword | | ![fixable-green][] | -| [expect-expect][] | Enforce assertion to be made in a test body | ![recommended][] | | -| [lowercase-name][] | Disallow capitalized test names | | ![fixable-green][] | -| [no-alias-methods][] | Disallow alias methods | ![style][] | ![fixable-green][] | -| [no-commented-out-tests][] | Disallow commented out tests | ![recommended][] | | -| [no-deprecated-functions][] | Disallow use of deprecated functions | | ![fixable-green][] | -| [no-disabled-tests][] | Disallow disabled tests | ![recommended][] | | -| [no-duplicate-hooks][] | Disallow duplicate hooks within a `describe` block | | | -| [no-expect-resolves][] | Disallow using `expect().resolves` | | | -| [no-export][] | Disallow export from test files | ![recommended][] | | -| [no-focused-tests][] | Disallow focused tests | ![recommended][] | | -| [no-hooks][] | Disallow setup and teardown hooks | | | -| [no-identical-title][] | Disallow identical titles | ![recommended][] | | -| [no-if][] | Disallow conditional logic | | | -| [no-jasmine-globals][] | Disallow Jasmine globals | ![recommended][] | ![fixable-yellow][] | -| [no-jest-import][] | Disallow importing `jest` | ![recommended][] | | -| [no-large-snapshots][] | Disallow large snapshots | | | -| [no-mocks-import][] | Disallow manually importing from `__mocks__` | ![recommended][] | | -| [no-standalone-expect][] | Prevents `expect` statements outside of a `test` or `it` block | ![recommended][] | | -| [no-test-callback][] | Using a callback in asynchronous tests | ![recommended][] | ![fixable-green][] | -| [no-test-prefixes][] | Disallow using `f` & `x` prefixes to define focused/skipped tests | ![recommended][] | ![fixable-green][] | -| [no-test-return-statement][] | Disallow explicitly returning from tests | | | -| [no-truthy-falsy][] | Disallow using `toBeTruthy()` & `toBeFalsy()` | | | -| [no-try-expect][] | Prevent `catch` assertions in tests | ![recommended][] | | -| [prefer-called-with][] | Suggest using `toBeCalledWith()` OR `toHaveBeenCalledWith()` | | | -| [prefer-expect-assertions][] | Suggest using `expect.assertions()` OR `expect.hasAssertions()` | | | -| [prefer-hooks-on-top][] | Suggest to have all hooks at top-level before tests | | | -| [prefer-inline-snapshots][] | Suggest using `toMatchInlineSnapshot()` | | ![fixable-green][] | -| [prefer-spy-on][] | Suggest using `jest.spyOn()` | | ![fixable-green][] | -| [prefer-strict-equal][] | Suggest using `toStrictEqual()` | | ![fixable-green][] | -| [prefer-to-be-null][] | Suggest using `toBeNull()` | ![style][] | ![fixable-green][] | -| [prefer-to-be-undefined][] | Suggest using `toBeUndefined()` | ![style][] | ![fixable-green][] | -| [prefer-to-contain][] | Suggest using `toContain()` | ![style][] | ![fixable-green][] | -| [prefer-to-have-length][] | Suggest using `toHaveLength()` | ![style][] | ![fixable-green][] | -| [prefer-todo][] | Suggest using `test.todo()` | | ![fixable-green][] | -| [require-top-level-describe][] | Require a top-level `describe` block | | | -| [require-to-throw-message][] | Require that `toThrow()` and `toThrowError` includes a message | | | -| [valid-describe][] | Enforce valid `describe()` callback | ![recommended][] | | -| [valid-expect-in-promise][] | Enforce having return statement when testing with promises | ![recommended][] | | -| [valid-expect][] | Enforce valid `expect()` usage | ![recommended][] | | -| [valid-title][] | Enforce valid titles for jest blocks | | | + + +| Rule | Description | Configurations | Fixable | +| ---------------------------------------------------------------------- | --------------------------------------------------------------- | ---------------- | ------------ | +| [consistent-test-it](docs/rules/consistent-test-it.md) | Have control over `test` and `it` usages | | ![fixable][] | +| [expect-expect](docs/rules/expect-expect.md) | Enforce assertion to be made in a test body | ![recommended][] | | +| [lowercase-name](docs/rules/lowercase-name.md) | Enforce lowercase test names | | ![fixable][] | +| [no-alias-methods](docs/rules/no-alias-methods.md) | Disallow alias methods | ![style][] | ![fixable][] | +| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | Disallow commented out tests | ![recommended][] | | +| [no-deprecated-functions](docs/rules/no-deprecated-functions.md) | Disallow use of deprecated functions | | ![fixable][] | +| [no-disabled-tests](docs/rules/no-disabled-tests.md) | Disallow disabled tests | ![recommended][] | | +| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | Disallow duplicate setup and teardown hooks | | | +| [no-expect-resolves](docs/rules/no-expect-resolves.md) | Disallow expect.resolves | | | +| [no-export](docs/rules/no-export.md) | Prevent exporting from test files | ![recommended][] | | +| [no-focused-tests](docs/rules/no-focused-tests.md) | Disallow focused tests | ![recommended][] | ![fixable][] | +| [no-hooks](docs/rules/no-hooks.md) | Disallow setup and teardown hooks | | | +| [no-identical-title](docs/rules/no-identical-title.md) | Disallow identical titles | ![recommended][] | | +| [no-if](docs/rules/no-if.md) | Disallow conditional logic | | | +| [no-jasmine-globals](docs/rules/no-jasmine-globals.md) | Disallow Jasmine globals | ![recommended][] | ![fixable][] | +| [no-jest-import](docs/rules/no-jest-import.md) | Disallow importing Jest | ![recommended][] | | +| [no-large-snapshots](docs/rules/no-large-snapshots.md) | disallow large snapshots | | | +| [no-mocks-import](docs/rules/no-mocks-import.md) | Disallow manually importing from **mocks** | ![recommended][] | | +| [no-standalone-expect](docs/rules/no-standalone-expect.md) | Prevents expects that are outside of an it or test block. | ![recommended][] | | +| [no-test-callback](docs/rules/no-test-callback.md) | Avoid using a callback in asynchronous tests | ![recommended][] | ![fixable][] | +| [no-test-prefixes](docs/rules/no-test-prefixes.md) | Use `.only` and `.skip` over `f` and `x` | ![recommended][] | ![fixable][] | +| [no-test-return-statement](docs/rules/no-test-return-statement.md) | Disallow explicitly returning from tests | | | +| [no-truthy-falsy](docs/rules/no-truthy-falsy.md) | Disallow using `toBeTruthy()` & `toBeFalsy()` | | | +| [no-try-expect](docs/rules/no-try-expect.md) | Prefer using toThrow for exception tests | ![recommended][] | | +| [prefer-called-with](docs/rules/prefer-called-with.md) | Suggest using `toBeCalledWith()` OR `toHaveBeenCalledWith()` | | | +| [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md) | Suggest using `expect.assertions()` OR `expect.hasAssertions()` | | | +| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | Suggest to have all hooks at top level | | | +| [prefer-inline-snapshots](docs/rules/prefer-inline-snapshots.md) | Suggest using inline snapshots | | ![fixable][] | +| [prefer-spy-on](docs/rules/prefer-spy-on.md) | Suggest using `jest.spyOn()` | | ![fixable][] | +| [prefer-strict-equal](docs/rules/prefer-strict-equal.md) | Suggest using toStrictEqual() | | ![fixable][] | +| [prefer-to-be-null](docs/rules/prefer-to-be-null.md) | Suggest using `toBeNull()` | ![style][] | ![fixable][] | +| [prefer-to-be-undefined](docs/rules/prefer-to-be-undefined.md) | Suggest using `toBeUndefined()` | ![style][] | ![fixable][] | +| [prefer-to-contain](docs/rules/prefer-to-contain.md) | Suggest using `toContain()` | ![style][] | ![fixable][] | +| [prefer-to-have-length](docs/rules/prefer-to-have-length.md) | Suggest using `toHaveLength()` | ![style][] | ![fixable][] | +| [prefer-todo](docs/rules/prefer-todo.md) | Suggest using `test.todo` | | ![fixable][] | +| [require-to-throw-message](docs/rules/require-to-throw-message.md) | Require a message for `toThrow()` | | | +| [require-top-level-describe](docs/rules/require-top-level-describe.md) | Prevents test cases and hooks to be outside of a describe block | | | +| [valid-describe](docs/rules/valid-describe.md) | Enforce valid `describe()` callback | ![recommended][] | | +| [valid-expect](docs/rules/valid-expect.md) | Enforce valid `expect()` usage | ![recommended][] | | +| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | Enforce having return statement when testing with promises | ![recommended][] | | +| [valid-title](docs/rules/valid-title.md) | Enforce valid titles | | ![fixable][] | + + ## Credit @@ -183,48 +187,6 @@ ensure consistency and readability in jest test suites. https://github.com/dangreenisrael/eslint-plugin-jest-formatting -[consistent-test-it]: docs/rules/consistent-test-it.md -[expect-expect]: docs/rules/expect-expect.md -[lowercase-name]: docs/rules/lowercase-name.md -[no-alias-methods]: docs/rules/no-alias-methods.md -[no-commented-out-tests]: docs/rules/no-commented-out-tests.md -[no-deprecated-functions]: docs/rules/no-deprecated-functions.md -[no-disabled-tests]: docs/rules/no-disabled-tests.md -[no-duplicate-hooks]: docs/rules/no-duplicate-hooks.md -[no-expect-resolves]: docs/rules/no-expect-resolves.md -[no-export]: docs/rules/no-export.md -[no-focused-tests]: docs/rules/no-focused-tests.md -[no-hooks]: docs/rules/no-hooks.md -[no-identical-title]: docs/rules/no-identical-title.md -[no-if]: docs/rules/no-if.md -[no-jasmine-globals]: docs/rules/no-jasmine-globals.md -[no-jest-import]: docs/rules/no-jest-import.md -[no-large-snapshots]: docs/rules/no-large-snapshots.md -[no-mocks-import]: docs/rules/no-mocks-import.md -[no-standalone-expect]: docs/rules/no-standalone-expect.md -[no-test-callback]: docs/rules/no-test-callback.md -[no-test-prefixes]: docs/rules/no-test-prefixes.md -[no-test-return-statement]: docs/rules/no-test-return-statement.md -[no-truthy-falsy]: docs/rules/no-truthy-falsy.md -[no-try-expect]: docs/rules/no-try-expect.md -[prefer-called-with]: docs/rules/prefer-called-with.md -[prefer-expect-assertions]: docs/rules/prefer-expect-assertions.md -[prefer-inline-snapshots]: docs/rules/prefer-inline-snapshots.md -[prefer-hooks-on-top]: docs/rules/prefer-hooks-on-top.md -[prefer-spy-on]: docs/rules/prefer-spy-on.md -[prefer-strict-equal]: docs/rules/prefer-strict-equal.md -[prefer-to-be-null]: docs/rules/prefer-to-be-null.md -[prefer-to-be-undefined]: docs/rules/prefer-to-be-undefined.md -[prefer-to-contain]: docs/rules/prefer-to-contain.md -[prefer-to-have-length]: docs/rules/prefer-to-have-length.md -[prefer-todo]: docs/rules/prefer-todo.md -[require-top-level-describe]: docs/rules/require-top-level-describe.md -[require-to-throw-message]: docs/rules/require-to-throw-message.md -[valid-describe]: docs/rules/valid-describe.md -[valid-expect-in-promise]: docs/rules/valid-expect-in-promise.md -[valid-expect]: docs/rules/valid-expect.md -[valid-title]: docs/rules/valid-title.md -[fixable-green]: https://img.shields.io/badge/-fixable-green.svg -[fixable-yellow]: https://img.shields.io/badge/-fixable-yellow.svg [recommended]: https://img.shields.io/badge/-recommended-lightgrey.svg +[fixable]: https://img.shields.io/badge/-fixable-green.svg [style]: https://img.shields.io/badge/-style-blue.svg diff --git a/docs/rules/consistent-test-it.md b/docs/rules/consistent-test-it.md index 9b6270b5c..5ea70eb1d 100644 --- a/docs/rules/consistent-test-it.md +++ b/docs/rules/consistent-test-it.md @@ -1,4 +1,4 @@ -# Have control over `test` and `it` usages (consistent-test-it) +# Have control over `test` and `it` usages (`consistent-test-it`) Jest allows you to choose how you want to define your tests, using the `it` or the `test` keywords, with multiple permutations for each: diff --git a/docs/rules/expect-expect.md b/docs/rules/expect-expect.md index 9be3a2b32..af61b1ec8 100644 --- a/docs/rules/expect-expect.md +++ b/docs/rules/expect-expect.md @@ -1,4 +1,4 @@ -# Enforce assertion to be made in a test body (expect-expect) +# Enforce assertion to be made in a test body (`expect-expect`) Ensure that there is at least one `expect` call made in a test. diff --git a/docs/rules/lowercase-name.md b/docs/rules/lowercase-name.md index f16380e38..603d830f4 100644 --- a/docs/rules/lowercase-name.md +++ b/docs/rules/lowercase-name.md @@ -1,4 +1,4 @@ -# Enforce lowercase test names (lowercase-name) +# Enforce lowercase test names (`lowercase-name`) ## Rule details diff --git a/docs/rules/no-alias-methods.md b/docs/rules/no-alias-methods.md index 9439abe3c..91c5bf8e3 100644 --- a/docs/rules/no-alias-methods.md +++ b/docs/rules/no-alias-methods.md @@ -1,4 +1,4 @@ -# Don't use alias methods (no-alias-methods) +# Don't use alias methods (`no-alias-methods`) Several Jest methods have alias names, such as `toThrow` having the alias of `toThrowError`. This rule ensures that only the canonical name as used in the diff --git a/docs/rules/no-commented-out-tests.md b/docs/rules/no-commented-out-tests.md index 829c44291..b12755c47 100644 --- a/docs/rules/no-commented-out-tests.md +++ b/docs/rules/no-commented-out-tests.md @@ -1,4 +1,4 @@ -# Disallow commented out tests (no-commented-out-tests) +# Disallow commented out tests (`no-commented-out-tests`) This rule raises a warning about commented out tests. It's similar to no-disabled-tests rule. diff --git a/docs/rules/no-disabled-tests.md b/docs/rules/no-disabled-tests.md index 896649953..c6726686a 100644 --- a/docs/rules/no-disabled-tests.md +++ b/docs/rules/no-disabled-tests.md @@ -1,4 +1,4 @@ -# Disallow disabled tests (no-disabled-tests) +# Disallow disabled tests (`no-disabled-tests`) Jest has a feature that allows you to temporarily mark tests as disabled. This feature is often helpful while debugging or to create placeholders for future diff --git a/docs/rules/no-duplicate-hooks.md b/docs/rules/no-duplicate-hooks.md index c11388e12..adeb463ae 100644 --- a/docs/rules/no-duplicate-hooks.md +++ b/docs/rules/no-duplicate-hooks.md @@ -1,4 +1,4 @@ -# Disallow duplicate setup and teardown hooks (no-duplicate-hooks) +# Disallow duplicate setup and teardown hooks (`no-duplicate-hooks`) A describe block should not contain duplicate hooks. diff --git a/docs/rules/no-expect-resolves.md b/docs/rules/no-expect-resolves.md index c15d08300..59510f5fb 100644 --- a/docs/rules/no-expect-resolves.md +++ b/docs/rules/no-expect-resolves.md @@ -1,4 +1,4 @@ -# Avoid using `expect().resolves` (no-expect-resolves) +# Avoid using `expect().resolves` (`no-expect-resolves`) Jest allows you to test a promise resolve value using `await expect().resolves`. For consistency and readability this rule bans `expect().resolves` in favor of diff --git a/docs/rules/no-export.md b/docs/rules/no-export.md index b31745a79..1f64c5db8 100644 --- a/docs/rules/no-export.md +++ b/docs/rules/no-export.md @@ -1,4 +1,4 @@ -# no export from test file (no-export) +# Prevent exporting from test files (`no-export`) Prevents exports from test files. If a file has at least 1 test in it, then this rule will prevent exports. diff --git a/docs/rules/no-focused-tests.md b/docs/rules/no-focused-tests.md index 93923887e..a728fb1f0 100644 --- a/docs/rules/no-focused-tests.md +++ b/docs/rules/no-focused-tests.md @@ -1,4 +1,4 @@ -# Disallow focused tests (no-focused-tests) +# Disallow focused tests (`no-focused-tests`) Jest has a feature that allows you to focus tests by appending `.only` or prepending `f` to a test-suite or a test-case. This feature is really helpful to diff --git a/docs/rules/no-hooks.md b/docs/rules/no-hooks.md index f80196f89..1b037db83 100644 --- a/docs/rules/no-hooks.md +++ b/docs/rules/no-hooks.md @@ -1,4 +1,4 @@ -# Disallow setup and teardown hooks (no-hooks) +# Disallow setup and teardown hooks (`no-hooks`) Jest provides global functions for setup and teardown tasks, which are called before/after each test case and each test suite. The use of these hooks promotes diff --git a/docs/rules/no-identical-title.md b/docs/rules/no-identical-title.md index 1daf04683..e907160b7 100644 --- a/docs/rules/no-identical-title.md +++ b/docs/rules/no-identical-title.md @@ -1,4 +1,4 @@ -# Disallow identical titles (no-identical-title) +# Disallow identical titles (`no-identical-title`) Having identical titles for two different tests or test suites may create confusion. For example, when a test with the same title as another test in the diff --git a/docs/rules/no-if.md b/docs/rules/no-if.md index cdc2d3cb6..88756de46 100644 --- a/docs/rules/no-if.md +++ b/docs/rules/no-if.md @@ -1,4 +1,4 @@ -# Disallow conditional logic. (no-if) +# Disallow conditional logic (`no-if`) Conditional logic in tests is usually an indication that a test is attempting to cover too much, and not testing the logic it intends to. Each branch of code diff --git a/docs/rules/no-jasmine-globals.md b/docs/rules/no-jasmine-globals.md index 71e8366d6..26d0ea867 100644 --- a/docs/rules/no-jasmine-globals.md +++ b/docs/rules/no-jasmine-globals.md @@ -1,4 +1,4 @@ -# Disallow Jasmine globals +# Disallow Jasmine globals (`no-jasmine-globals`) `jest` uses `jasmine` as a test runner. A side effect of this is that both a `jasmine` object, and some jasmine-specific globals, are exposed to the test diff --git a/docs/rules/no-jest-import.md b/docs/rules/no-jest-import.md index 16e960630..8c759ffec 100644 --- a/docs/rules/no-jest-import.md +++ b/docs/rules/no-jest-import.md @@ -1,4 +1,4 @@ -# Disallow importing Jest(no-jest-import) +# Disallow importing Jest (`no-jest-import`) The `jest` object is automatically in scope within every test file. The methods in the `jest` object help create mocks and let you control Jest's overall diff --git a/docs/rules/no-large-snapshots.md b/docs/rules/no-large-snapshots.md index f9a402bfb..f6f075154 100644 --- a/docs/rules/no-large-snapshots.md +++ b/docs/rules/no-large-snapshots.md @@ -1,4 +1,4 @@ -# disallow large snapshots (no-large-snapshots) +# disallow large snapshots (`no-large-snapshots`) When using Jest's snapshot capability one should be mindful of the size of created snapshots. As a best practice snapshots should be limited in size in diff --git a/docs/rules/no-mocks-import.md b/docs/rules/no-mocks-import.md index 4441dec11..429ed3241 100644 --- a/docs/rules/no-mocks-import.md +++ b/docs/rules/no-mocks-import.md @@ -1,4 +1,4 @@ -# Disallow manually importing from `__mocks__` (no-mocks-import) +# Disallow manually importing from `__mocks__` (`no-mocks-import`) When using `jest.mock`, your tests (just like the code being tested) should import from `./x`, not `./__mocks__/x`. Not following this rule can lead to diff --git a/docs/rules/no-standalone-expect.md b/docs/rules/no-standalone-expect.md index 025f8c86c..9cb036232 100644 --- a/docs/rules/no-standalone-expect.md +++ b/docs/rules/no-standalone-expect.md @@ -1,4 +1,4 @@ -# No standalone expect in a describe block (no-standalone-expect) +# No standalone expect in a describe block (`no-standalone-expect`) Prevents `expect` statements outside of a `test` or `it` block. An `expect` within a helper function (but outside of a `test` or `it` block) will not diff --git a/docs/rules/no-test-callback.md b/docs/rules/no-test-callback.md index 304fbf2d0..30599be74 100644 --- a/docs/rules/no-test-callback.md +++ b/docs/rules/no-test-callback.md @@ -1,4 +1,4 @@ -# Avoid using a callback in asynchronous tests (no-test-callback) +# Avoid using a callback in asynchronous tests (`no-test-callback`) Jest allows you to pass a callback to test definitions, typically called `done`, that is later invoked to indicate that the asynchronous test is complete. diff --git a/docs/rules/no-test-prefixes.md b/docs/rules/no-test-prefixes.md index 1b201e559..21b0ba059 100644 --- a/docs/rules/no-test-prefixes.md +++ b/docs/rules/no-test-prefixes.md @@ -1,4 +1,4 @@ -# Use `.only` and `.skip` over `f` and `x` (no-test-prefixes) +# Use `.only` and `.skip` over `f` and `x` (`no-test-prefixes`) Jest allows you to choose how you want to define focused and skipped tests, with multiple permutations for each: diff --git a/docs/rules/no-test-return-statement.md b/docs/rules/no-test-return-statement.md index a8ac7161e..fdb0b087b 100644 --- a/docs/rules/no-test-return-statement.md +++ b/docs/rules/no-test-return-statement.md @@ -1,4 +1,4 @@ -# Disallow explicitly returning from tests (no-test-return-statement) +# Disallow explicitly returning from tests (`no-test-return-statement`) Tests in Jest should be void and not return values. diff --git a/docs/rules/no-truthy-falsy.md b/docs/rules/no-truthy-falsy.md index d679156cb..06d56208c 100644 --- a/docs/rules/no-truthy-falsy.md +++ b/docs/rules/no-truthy-falsy.md @@ -1,4 +1,4 @@ -# Disallow using `toBeTruthy()` & `toBeFalsy()` (no-truthy-falsy) +# Disallow using `toBeTruthy()` & `toBeFalsy()` (`no-truthy-falsy`) Tests against boolean values should assert true or false. Asserting `toBeTruthy` or `toBeFalsy` matches non-boolean values as well and encourages weaker tests. diff --git a/docs/rules/no-try-expect.md b/docs/rules/no-try-expect.md index d257bf0bb..bbe980db8 100644 --- a/docs/rules/no-try-expect.md +++ b/docs/rules/no-try-expect.md @@ -1,4 +1,4 @@ -# Prevent catch assertions in tests (no-try-expect) +# Prevent catch assertions in tests (`no-try-expect`) This rule prevents the use of `expect` inside `catch` blocks. diff --git a/docs/rules/prefer-called-with.md b/docs/rules/prefer-called-with.md index 38aac36c1..a62035109 100644 --- a/docs/rules/prefer-called-with.md +++ b/docs/rules/prefer-called-with.md @@ -1,4 +1,4 @@ -# Suggest using `toBeCalledWith` OR `toHaveBeenCalledWith` (prefer-called-with) +# Suggest using `toBeCalledWith` OR `toHaveBeenCalledWith` (`prefer-called-with`) The `toBeCalled()` matcher is used to assert that a mock function has been called one or more times, without checking the arguments passed. The assertion diff --git a/docs/rules/prefer-expect-assertions.md b/docs/rules/prefer-expect-assertions.md index d77966cc3..c46a8390c 100644 --- a/docs/rules/prefer-expect-assertions.md +++ b/docs/rules/prefer-expect-assertions.md @@ -1,4 +1,4 @@ -# Suggest using `expect.assertions()` OR `expect.hasAssertions()` (prefer-expect-assertions) +# Suggest using `expect.assertions()` OR `expect.hasAssertions()` (`prefer-expect-assertions`) Ensure every test to have either `expect.assertions()` OR `expect.hasAssertions()` as its first expression. diff --git a/docs/rules/prefer-hooks-on-top.md b/docs/rules/prefer-hooks-on-top.md index a403dab48..e9c05cdda 100644 --- a/docs/rules/prefer-hooks-on-top.md +++ b/docs/rules/prefer-hooks-on-top.md @@ -1,4 +1,4 @@ -# Suggest to have all hooks at top-level before tests (prefer-hooks-on-top) +# Suggest to have all hooks at top-level before tests (`prefer-hooks-on-top`) All hooks should be defined before the start of the tests diff --git a/docs/rules/prefer-inline-snapshots.md b/docs/rules/prefer-inline-snapshots.md index 319419f52..7922eb5bc 100644 --- a/docs/rules/prefer-inline-snapshots.md +++ b/docs/rules/prefer-inline-snapshots.md @@ -1,4 +1,4 @@ -# Suggest using inline snapshots (prefer-inline-snapshots) +# Suggest using inline snapshots (`prefer-inline-snapshots`) In order to make snapshot tests more managable and reviewable `toMatchInlineSnapshot()` and `toThrowErrorMatchingInlineSnapshot` should be diff --git a/docs/rules/prefer-spy-on.md b/docs/rules/prefer-spy-on.md index 03f15da5f..25877d629 100644 --- a/docs/rules/prefer-spy-on.md +++ b/docs/rules/prefer-spy-on.md @@ -1,4 +1,4 @@ -# Suggest using `jest.spyOn()` (prefer-spy-on) +# Suggest using `jest.spyOn()` (`prefer-spy-on`) When mocking a function by overwriting a property you have to manually restore the original implementation when cleaning up. When using `jest.spyOn()` Jest diff --git a/docs/rules/prefer-strict-equal.md b/docs/rules/prefer-strict-equal.md index 7d475e84a..81a2b5f92 100644 --- a/docs/rules/prefer-strict-equal.md +++ b/docs/rules/prefer-strict-equal.md @@ -1,4 +1,4 @@ -# Suggest using `toStrictEqual()` (prefer-strict-equal) +# Suggest using `toStrictEqual()` (`prefer-strict-equal`) `toStrictEqual` not only checks that two objects contain the same data but also that they have the same structure. It is common to expect objects to not only diff --git a/docs/rules/prefer-to-be-null.md b/docs/rules/prefer-to-be-null.md index 0ee83c3f8..5bdbe525e 100644 --- a/docs/rules/prefer-to-be-null.md +++ b/docs/rules/prefer-to-be-null.md @@ -1,4 +1,4 @@ -# Suggest using `toBeNull()` (prefer-to-be-null) +# Suggest using `toBeNull()` (`prefer-to-be-null`) In order to have a better failure message, `toBeNull()` should be used upon asserting expections on null value. diff --git a/docs/rules/prefer-to-be-undefined.md b/docs/rules/prefer-to-be-undefined.md index a2351e5ac..e9ce8a903 100644 --- a/docs/rules/prefer-to-be-undefined.md +++ b/docs/rules/prefer-to-be-undefined.md @@ -1,4 +1,4 @@ -# Suggest using `toBeUndefined()` (prefer-to-be-undefined) +# Suggest using `toBeUndefined()` (`prefer-to-be-undefined`) In order to have a better failure message, `toBeUndefined()` should be used upon asserting expections on undefined value. diff --git a/docs/rules/prefer-to-contain.md b/docs/rules/prefer-to-contain.md index fa19c7fdb..b1144bc26 100644 --- a/docs/rules/prefer-to-contain.md +++ b/docs/rules/prefer-to-contain.md @@ -1,4 +1,4 @@ -# Suggest using `toContain()` (prefer-to-contain) +# Suggest using `toContain()` (`prefer-to-contain`) In order to have a better failure message, `toContain()` should be used upon asserting expectations on an array containing an object. diff --git a/docs/rules/prefer-to-have-length.md b/docs/rules/prefer-to-have-length.md index b26e72bbd..4acfffaec 100644 --- a/docs/rules/prefer-to-have-length.md +++ b/docs/rules/prefer-to-have-length.md @@ -1,4 +1,4 @@ -# Suggest using `toHaveLength()` (prefer-to-have-length) +# Suggest using `toHaveLength()` (`prefer-to-have-length`) In order to have a better failure message, `toHaveLength()` should be used upon asserting expectations on object's length property. diff --git a/docs/rules/prefer-todo.md b/docs/rules/prefer-todo.md index 322fec17e..01ee8fda2 100644 --- a/docs/rules/prefer-todo.md +++ b/docs/rules/prefer-todo.md @@ -1,4 +1,4 @@ -# Suggest using `test.todo` (prefer-todo) +# Suggest using `test.todo` (`prefer-todo`) When test cases are empty then it is better to mark them as `test.todo` as it will be highlighted in the summary output. diff --git a/docs/rules/require-to-throw-message.md b/docs/rules/require-to-throw-message.md index 0109e13a3..760f9020a 100644 --- a/docs/rules/require-to-throw-message.md +++ b/docs/rules/require-to-throw-message.md @@ -1,4 +1,4 @@ -# Require a message for `toThrow()` (require-to-throw-message) +# Require a message for `toThrow()` (`require-to-throw-message`) `toThrow()`, and its alias `toThrowError()`, are used to check if an error is thrown by a function call, such as in `expect(() => a()).toThrow()`. However, if diff --git a/docs/rules/require-top-level-describe.md b/docs/rules/require-top-level-describe.md index 4e43bbc07..69c0ffa21 100644 --- a/docs/rules/require-top-level-describe.md +++ b/docs/rules/require-top-level-describe.md @@ -1,4 +1,4 @@ -# Require top-level describe block (require-top-level-describe) +# Require top-level describe block (`require-top-level-describe`) Jest allows you to organise your test files the way you want it. However, the more your codebase grows, the more it becomes hard to navigate in your test diff --git a/docs/rules/valid-describe.md b/docs/rules/valid-describe.md index 724405ff6..0a603c2c5 100644 --- a/docs/rules/valid-describe.md +++ b/docs/rules/valid-describe.md @@ -1,4 +1,4 @@ -# Enforce valid `describe()` callback (valid-describe) +# Enforce valid `describe()` callback (`valid-describe`) Using an improper `describe()` callback function can lead to unexpected test errors. diff --git a/docs/rules/valid-expect-in-promise.md b/docs/rules/valid-expect-in-promise.md index be35da7af..89f90368d 100644 --- a/docs/rules/valid-expect-in-promise.md +++ b/docs/rules/valid-expect-in-promise.md @@ -1,4 +1,4 @@ -# Enforce having return statement when testing with promises (valid-expect-in-promise) +# Enforce having return statement when testing with promises (`valid-expect-in-promise`) Ensure to return promise when having assertions in `then` or `catch` block of promise diff --git a/docs/rules/valid-expect.md b/docs/rules/valid-expect.md index 8d198730f..b01504e83 100644 --- a/docs/rules/valid-expect.md +++ b/docs/rules/valid-expect.md @@ -1,4 +1,4 @@ -# Enforce valid `expect()` usage (valid-expect) +# Enforce valid `expect()` usage (`valid-expect`) Ensure `expect()` is called with a single argument and there is an actual expectation made. diff --git a/docs/rules/valid-title.md b/docs/rules/valid-title.md index 38fef1bb7..6ab5cfbb0 100644 --- a/docs/rules/valid-title.md +++ b/docs/rules/valid-title.md @@ -1,4 +1,4 @@ -# describe/test titles should be valid (valid-title) +# describe/test titles should be valid (`valid-title`) Checks that the title of Jest blocks are valid by ensuring that titles are: diff --git a/package.json b/package.json index 4cfeafaf1..419ef0dac 100644 --- a/package.json +++ b/package.json @@ -2,82 +2,45 @@ "name": "eslint-plugin-jest", "version": "23.10.0", "description": "Eslint rules for Jest", - "repository": "jest-community/eslint-plugin-jest", - "license": "MIT", "keywords": [ "eslint", "eslintplugin", "eslint-plugin" ], + "repository": "jest-community/eslint-plugin-jest", + "license": "MIT", "author": { "name": "Jonathan Kim", "email": "hello@jkimbo.com", "url": "jkimbo.com" }, + "main": "lib/", "files": [ "docs/", "lib/" ], - "main": "lib/", - "engines": { - "node": ">=8" - }, - "peerDependencies": { - "eslint": ">=5" - }, "scripts": { - "prepare": "yarn build && yarn postbuild", + "build": "babel --extensions .js,.ts src --out-dir lib --copy-files", + "postbuild": "rimraf lib/__tests__ lib/**/__tests__", "lint": "eslint . --ignore-pattern '!.eslintrc.js' --ext js,ts", - "prettylint": "prettylint docs/**/*.md README.md package.json", + "prepare": "yarn build && yarn postbuild", "prepublishOnly": "yarn build", + "prettylint": "prettylint docs/**/*.md README.md package.json", "pretest": "yarn build", "test": "jest", - "build": "babel --extensions .js,.ts src --out-dir lib --copy-files", - "postbuild": "rimraf lib/__tests__ lib/**/__tests__", + "tools:generate-rules-table": "ts-node -T tools/generate-rules-table", "typecheck": "tsc -p ." }, - "dependencies": { - "@typescript-eslint/experimental-utils": "^2.5.0" - }, - "devDependencies": { - "@babel/cli": "^7.4.4", - "@babel/core": "^7.4.4", - "@babel/preset-env": "^7.4.4", - "@babel/preset-typescript": "^7.3.3", - "@commitlint/cli": "^8.2.0", - "@commitlint/config-conventional": "^8.2.0", - "@schemastore/package": "^0.0.5", - "@semantic-release/changelog": "^3.0.5", - "@semantic-release/git": "^7.0.17", - "@types/eslint": "^6.1.3", - "@types/jest": "^25.1.0", - "@types/node": "^12.6.6", - "@typescript-eslint/eslint-plugin": "^2.5.0", - "@typescript-eslint/parser": "^2.5.0", - "babel-jest": "^25.2.0", - "babel-plugin-replace-ts-export-assignment": "^0.0.2", - "eslint": "^5.1.0 || ^6.0.0", - "eslint-config-prettier": "^6.5.0", - "eslint-plugin-eslint-comments": "^3.1.2", - "eslint-plugin-eslint-plugin": "^2.0.0", - "eslint-plugin-import": "^2.20.2", - "eslint-plugin-node": "^11.0.0", - "eslint-plugin-prettier": "^3.0.0", - "husky": "^3.0.9", - "jest": "^25.2.0", - "jest-runner-eslint": "^0.8.0", - "lint-staged": "^9.4.2", - "prettier": "^1.19.1", - "prettylint": "^1.0.0", - "resolve-from": "^5.0.0", - "rimraf": "^3.0.0", - "semantic-release": "^15.13.28", - "typescript": "^3.5.3" + "husky": { + "hooks": { + "pre-commit": "lint-staged", + "commit-msg": "commitlint -e $HUSKY_GIT_PARAMS" + } }, - "prettier": { - "proseWrap": "always", - "singleQuote": true, - "trailingComma": "all" + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] }, "lint-staged": { "*.{js,ts}": [ @@ -89,6 +52,11 @@ "git add" ] }, + "prettier": { + "proseWrap": "always", + "singleQuote": true, + "trailingComma": "all" + }, "jest": { "coverageThreshold": { "global": { @@ -118,16 +86,50 @@ } ] }, - "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] + "dependencies": { + "@typescript-eslint/experimental-utils": "^2.5.0" }, - "husky": { - "hooks": { - "commit-msg": "commitlint -e $HUSKY_GIT_PARAMS", - "pre-commit": "lint-staged" - } + "devDependencies": { + "@babel/cli": "^7.4.4", + "@babel/core": "^7.4.4", + "@babel/preset-env": "^7.4.4", + "@babel/preset-typescript": "^7.3.3", + "@commitlint/cli": "^8.2.0", + "@commitlint/config-conventional": "^8.2.0", + "@schemastore/package": "^0.0.5", + "@semantic-release/changelog": "^3.0.5", + "@semantic-release/git": "^7.0.17", + "@types/eslint": "^6.1.3", + "@types/jest": "^25.1.0", + "@types/node": "^12.6.6", + "@typescript-eslint/eslint-plugin": "^2.5.0", + "@typescript-eslint/parser": "^2.5.0", + "babel-jest": "^25.2.0", + "babel-plugin-replace-ts-export-assignment": "^0.0.2", + "eslint": "^5.1.0 || ^6.0.0", + "eslint-config-prettier": "^6.5.0", + "eslint-plugin-eslint-comments": "^3.1.2", + "eslint-plugin-eslint-plugin": "^2.0.0", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-node": "^11.0.0", + "eslint-plugin-prettier": "^3.0.0", + "husky": "^3.0.9", + "jest": "^25.2.0", + "jest-runner-eslint": "^0.8.0", + "lint-staged": "^9.4.2", + "prettier": "^1.19.1", + "prettylint": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "semantic-release": "^15.13.28", + "ts-node": "^8.10.1", + "typescript": "^3.5.3" + }, + "peerDependencies": { + "eslint": ">=5" + }, + "engines": { + "node": ">=8" }, "release": { "plugins": [ diff --git a/src/rules/lowercase-name.ts b/src/rules/lowercase-name.ts index 81fa1f9dd..f89aa1d7d 100644 --- a/src/rules/lowercase-name.ts +++ b/src/rules/lowercase-name.ts @@ -69,8 +69,7 @@ export default createRule< meta: { type: 'suggestion', docs: { - description: - 'Enforce `it`, `test` and `describe` to have descriptions that begin with a lowercase letter. This provides more readable test failures.', + description: 'Enforce lowercase test names', category: 'Best Practices', recommended: false, }, diff --git a/src/rules/no-commented-out-tests.ts b/src/rules/no-commented-out-tests.ts index 1ee838df8..96e16da98 100644 --- a/src/rules/no-commented-out-tests.ts +++ b/src/rules/no-commented-out-tests.ts @@ -12,8 +12,7 @@ export default createRule({ meta: { docs: { category: 'Best Practices', - description: - "This rule raises a warning about commented out tests. It's similar to no-disabled-tests rule.", + description: 'Disallow commented out tests', recommended: false, }, messages: { diff --git a/src/rules/no-export.ts b/src/rules/no-export.ts index 552ca6bdf..b837f3ac5 100644 --- a/src/rules/no-export.ts +++ b/src/rules/no-export.ts @@ -9,8 +9,7 @@ export default createRule({ meta: { docs: { category: 'Best Practices', - description: - 'Prevents exports from test files. If a file has at least 1 test in it, then this rule will prevent exports.', + description: 'Prevent exporting from test files', recommended: false, }, messages: { diff --git a/src/rules/no-jest-import.ts b/src/rules/no-jest-import.ts index 3399f328f..a0ad90888 100644 --- a/src/rules/no-jest-import.ts +++ b/src/rules/no-jest-import.ts @@ -6,8 +6,7 @@ export default createRule({ meta: { type: 'problem', docs: { - description: - "The `jest` object is automatically in scope within every test file. The methods in the `jest` object help create mocks and let you control Jest's overall behavior. It is therefore completely unnecessary to import in `jest`, as Jest doesn't export anything in the first place.", + description: 'Disallow importing Jest', category: 'Best Practices', recommended: 'error', }, diff --git a/src/rules/no-mocks-import.ts b/src/rules/no-mocks-import.ts index 3c1b80097..a12b3fc48 100644 --- a/src/rules/no-mocks-import.ts +++ b/src/rules/no-mocks-import.ts @@ -16,8 +16,7 @@ export default createRule({ type: 'problem', docs: { category: 'Best Practices', - description: - 'When using `jest.mock`, your tests (just like the code being tested) should import from `./x`, not `./__mocks__/x`. Not following this rule can lead to confusion, because you will have multiple instances of the mocked module', + description: 'Disallow manually importing from __mocks__ ', recommended: 'error', }, messages: { diff --git a/src/rules/valid-describe.ts b/src/rules/valid-describe.ts index 6815f9221..28ec20e5d 100644 --- a/src/rules/valid-describe.ts +++ b/src/rules/valid-describe.ts @@ -28,8 +28,7 @@ export default createRule({ type: 'problem', docs: { category: 'Possible Errors', - description: - 'Using an improper `describe()` callback function can lead to unexpected test errors.', + description: 'Enforce valid `describe()` callback', recommended: 'warn', }, messages: { diff --git a/tools/generate-rules-table.ts b/tools/generate-rules-table.ts new file mode 100644 index 000000000..374a6fa15 --- /dev/null +++ b/tools/generate-rules-table.ts @@ -0,0 +1,107 @@ +#!/usr/bin/env ts-node-transpile-only + +import * as fs from 'fs'; +import * as path from 'path'; +import ESLint from 'eslint'; +import prettier from 'prettier'; +import config from '../src/index'; + +interface RuleDetails { + name: string; + description: string; + fixable: boolean; +} + +const staticElements = { + listHeaderRow: ['Rule', 'Description', 'Configurations', 'Fixable'], + listSpacerRow: Array(5).fill('-'), +}; + +const getConfigurationColumnValueForRule = (rule: RuleDetails): string => { + if (`jest/${rule.name}` in config.configs.recommended.rules) { + return '![recommended][]'; + } + + if (`jest/${rule.name}` in config.configs.style.rules) { + return '![style][]'; + } + + return ''; +}; + +const buildRuleRow = (rule: RuleDetails): string[] => [ + `[${rule.name}](docs/rules/${rule.name}.md)`, + rule.description, + getConfigurationColumnValueForRule(rule), + rule.fixable ? '![fixable][]' : '', +]; + +const generateRulesListMarkdown = (details: RuleDetails[]): string => + [ + staticElements.listHeaderRow, + staticElements.listSpacerRow, + ...details + .sort(({ name: a }, { name: b }) => a.localeCompare(b)) + .map(buildRuleRow), + ] + .map(column => [...column, ' '].join('|')) + .join('\n'); + +const updateRulesList = (details: RuleDetails[], markdown: string): string => { + const listBeginMarker = ``; + const listEndMarker = ``; + + const listStartIndex = markdown.indexOf(listBeginMarker); + const listEndIndex = markdown.indexOf(listEndMarker); + + if (listStartIndex === -1 || listEndIndex === -1) { + throw new Error(`cannot find start or end of rules list`); + } + + return [ + markdown.substring(0, listStartIndex - 1), + listBeginMarker, + '', + generateRulesListMarkdown(details), + '', + markdown.substring(listEndIndex), + ].join('\n'); +}; + +// copied from https://github.com/babel/babel/blob/d8da63c929f2d28c401571e2a43166678c555bc4/packages/babel-helpers/src/helpers.js#L602-L606 +/* istanbul ignore next */ +const interopRequireDefault = (obj: any): { default: any } => + obj && obj.__esModule ? obj : { default: obj }; + +const importDefault = (moduleName: string) => + // eslint-disable-next-line @typescript-eslint/no-require-imports + interopRequireDefault(require(moduleName)).default; + +const requireJestRule = (name: string): ESLint.Rule.RuleModule => + importDefault( + `../src/rules/${name}`, + // path.join('..', 'src', 'rules', name), + ) as ESLint.Rule.RuleModule; + +const details: RuleDetails[] = Object.keys(config.configs.all.rules) + .map(name => name.split('/')[1]) + .map(name => [name, requireJestRule(name)] as const) + .filter( + (nameAndRule): nameAndRule is [string, Required] => + !!nameAndRule[1].meta && !nameAndRule[1].meta.deprecated, + ) + .map( + ([name, rule]): RuleDetails => ({ + name, + description: rule.meta.docs?.description ?? '', + fixable: !!rule.meta.fixable, + }), + ); + +let readme = fs.readFileSync(path.resolve(__dirname, '../README.md'), 'utf8'); + +readme = updateRulesList(details, readme); + +readme = prettier.format(readme, { parser: 'markdown' }); + +fs.writeFileSync(path.resolve(__dirname, '../README.md'), readme, 'utf8'); diff --git a/yarn.lock b/yarn.lock index 4b6fc0558..2f048bbd5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1776,6 +1776,11 @@ are-we-there-yet@~1.1.2: delegates "^1.0.0" readable-stream "^2.0.6" +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -3004,6 +3009,11 @@ diff-sequences@^25.2.1: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.2.1.tgz#fcfe8aa07dd9b0c648396a478dabca8e76c6ab27" integrity sha512-foe7dXnGlSh3jR1ovJmdv+77VQj98eKCHHwJPbZ2eEf0fHwKbkZicpPxEch9smZ+n2dnF6QFwkOQdLq9hpeJUg== +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + dir-glob@^3.0.0, dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -5909,6 +5919,11 @@ make-dir@^3.0.0: dependencies: semver "^6.0.0" +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + make-fetch-happen@^5.0.0: version "5.0.2" resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz#aa8387104f2687edca01c8687ee45013d02d19bd" @@ -8145,6 +8160,14 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" +source-map-support@^0.5.17: + version "0.5.19" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" + integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + source-map-support@^0.5.6: version "0.5.16" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042" @@ -8746,6 +8769,17 @@ trim-off-newlines@^1.0.0: resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3" integrity sha1-n5up2e+odkw4dpi8v+sshI8RrbM= +ts-node@^8.10.1: + version "8.10.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.10.1.tgz#77da0366ff8afbe733596361d2df9a60fc9c9bd3" + integrity sha512-bdNz1L4ekHiJul6SHtZWs1ujEKERJnHs4HxN7rjTyyVOFf3HaJ6sLqe6aPG62XTzAB/63pKRh5jTSWL0D7bsvw== + dependencies: + arg "^4.1.0" + diff "^4.0.1" + make-error "^1.1.1" + source-map-support "^0.5.17" + yn "3.1.1" + tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: version "1.11.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35" @@ -9341,3 +9375,8 @@ yargs@^8.0.2: which-module "^2.0.0" y18n "^3.2.1" yargs-parser "^7.0.0" + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==