Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-testing-library

Package Overview
Dependencies
Maintainers
0
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-testing-library - npm Package Compare versions

Comparing version 6.2.2 to 6.3.0

20

dist/index.js

@@ -7,5 +7,21 @@ "use strict";

const rules_1 = __importDefault(require("./rules"));
module.exports = {
configs: configs_1.default,
const { name: packageName, version: packageVersion, } = require('../package.json');
const plugin = {
meta: {
name: packageName,
version: packageVersion,
},
configs: {},
rules: rules_1.default,
};
plugin.configs = {
...configs_1.default,
...Object.fromEntries(Object.entries(configs_1.default).map(([framework, config]) => [
`flat/${framework}`,
{
plugins: { 'testing-library': plugin },
rules: config.rules,
},
])),
};
module.exports = plugin;

2

package.json
{
"name": "eslint-plugin-testing-library",
"version": "6.2.2",
"version": "6.3.0",
"description": "ESLint plugin to follow best practices and anticipate common mistakes when writing tests with Testing Library",

@@ -5,0 +5,0 @@ "keywords": [

@@ -111,2 +111,12 @@ <div align="center">

> [!NOTE]
>
> `eslint.config.js` compatible versions of configs are available prefixed with
> `flat/`, though most of the plugin documentation still currently uses
> `.eslintrc` syntax.
>
> Refer to the
> [ESLint documentation on the new configuration file format](https://eslint.org/docs/latest/use/configure/configuration-files-new)
> for more.
This plugin exports several recommended configurations that enforce good practices for specific Testing Library packages.

@@ -144,2 +154,18 @@ You can find more info about enabled rules in the [Supported Rules section](#supported-rules), under the `Configurations` column.

To enable this configuration with `eslint.config.js`, use
`testingLibrary.configs['flat/dom']`:
```js
const testingLibrary = require('eslint-plugin-testing-library');
module.exports = [
{
files: [
/* glob matching your test files */
],
...testingLibrary.configs['flat/dom'],
},
];
```
### Angular

@@ -158,2 +184,18 @@

To enable this configuration with `eslint.config.js`, use
`testingLibrary.configs['flat/angular']`:
```js
const testingLibrary = require('eslint-plugin-testing-library');
module.exports = [
{
files: [
/* glob matching your test files */
],
...testingLibrary.configs['flat/angular'],
},
];
```
### React

@@ -172,2 +214,18 @@

To enable this configuration with `eslint.config.js`, use
`testingLibrary.configs['flat/react']`:
```js
const testingLibrary = require('eslint-plugin-testing-library');
module.exports = [
{
files: [
/* glob matching your test files */
],
...testingLibrary.configs['flat/react'],
},
];
```
### Vue

@@ -186,2 +244,18 @@

To enable this configuration with `eslint.config.js`, use
`testingLibrary.configs['flat/vue']`:
```js
const testingLibrary = require('eslint-plugin-testing-library');
module.exports = [
{
files: [
/* glob matching your test files */
],
...testingLibrary.configs['flat/vue'],
},
];
```
### Marko

@@ -200,2 +274,18 @@

To enable this configuration with `eslint.config.js`, use
`testingLibrary.configs['flat/marko']`:
```js
const testingLibrary = require('eslint-plugin-testing-library');
module.exports = [
{
files: [
/* glob matching your test files */
],
...testingLibrary.configs['flat/marko'],
},
];
```
## Supported Rules

@@ -436,2 +526,3 @@

<td align="center" valign="top" width="14.28%"><a href="https://aryabov.com"><img src="https://avatars.githubusercontent.com/u/10157660?v=4?s=100" width="100px;" alt="Alexey Ryabov"/><br /><sub><b>Alexey Ryabov</b></sub></a><br /><a href="#maintenance-lesha1201" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Chamion"><img src="https://avatars.githubusercontent.com/u/22522302?v=4?s=100" width="100px;" alt="Jemi Salo"/><br /><sub><b>Jemi Salo</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-testing-library/commits?author=Chamion" title="Code">💻</a> <a href="https://github.com/testing-library/eslint-plugin-testing-library/commits?author=Chamion" title="Tests">⚠️</a></td>
</tr>

@@ -438,0 +529,0 @@ </tbody>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc