New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@amedia/eslint-config-jest

Package Overview
Dependencies
Maintainers
55
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amedia/eslint-config-jest - npm Package Compare versions

Comparing version 6.0.0 to 7.0.0

13

index.js
module.exports = {
extends: [
// https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb
'@amedia/eslint-config-base',
],
globals: {
__DEV__: true,
},
extends: ['plugin:jest/recommended', 'plugin:jest/style'],
plugins: ['jest'],
env: {

@@ -33,4 +28,2 @@ browser: true,

'jest/prefer-strict-equal': 'error',
'jest/prefer-to-be-null': 'error',
'jest/prefer-to-be-undefined': 'error',
'jest/prefer-to-have-length': 'error',

@@ -41,5 +34,5 @@ 'jest/valid-expect': 'error',

{
files: ['./src/**/*.test.js', './src/**/*.spec.js'],
files: ['**/*.test.js', '**/*.spec.js'],
},
],
};
{
"name": "@amedia/eslint-config-jest",
"version": "6.0.0",
"version": "7.0.0",
"description": "ESLint configuration to be used by developers at Amedia",
"main": "index.js",
"files": [
"index.js",
"prettier.config.js"
"index.js"
],
"scripts": {
"lint": "(cd example && npm run lint)",
"test": "echo \"Error: no test specified\" && exit 1"
},
"scripts": {},
"repository": {

@@ -30,11 +26,12 @@ "type": "git",

"peerDependencies": {
"eslint-plugin-jest": "*"
"eslint": "8.x",
"eslint-plugin-jest": "26.x"
},
"dependencies": {
"@amedia/eslint-config-base": "^6.0.0"
"devDependencies": {
"eslint": "8.16.0",
"eslint-plugin-jest": "26.4.6"
},
"publishConfig": {
"access": "public"
},
"gitHead": "2dbf3aaaf79822cda8903a2b132f317fa76b7ceb"
}
}
# @amedia/eslint-config-jest
Common ESLint/Prettier configuration for Jest that extends [@amedia/eslint-config-base](https://www.npmjs.com/package/@amedia/eslint-config-base).
Common ESLint/Prettier configuration for Jest
## Install
You need to install this package and it's peer dependencies. You install the package by running:
```
npm i --save-dev @amedia/eslint-config-jest
```
Then, to install the peer dependencies you can use `install-peerdeps` like this:
```
npx install-peerdeps --dev @amedia/eslint-config-jest
```
Or you can do it manually by running:
```
npm info "@amedia/eslint-config-jest" peerDependencies
npm install --save-dev @amedia/eslint-config-jest
```
## Usage
There are a few ways to include the eslint config in your project. _Make sure you dont have any other settings for eslint or prettier already in your editor workspace or global._ Select one of the options below:
Using `package.json`:
```json
{
"eslintConfig": {
"extends": ["@amedia/eslint-config-jest", "plugin:import/recommended"]
}
}
```sh
npm install --save-dev @amedia/eslint-config-jest eslint eslint-plugin-jest
```
Using `.eslintrc`:
After installing the deps, update your ESLint config file, e.g.
`.eslintrc.js`:
```json
{
"extends": ["@amedia/eslint-config-jest", "plugin:import/recommended"]
}
```
or `.eslintrc.js`:
```js
module.exports = {
extends: ['@amedia/eslint-config-jest', 'plugin:import/recommended'],
extends: ['@amedia/eslint-config-jest'],
};
```
You also need to set up a prettier config.
### Prettier
This is how you use or extend the `@amedia/eslint-config-base` prettier config in your
app. Select one of options below:
Using `package.json`:
```json
{
"prettier": "@amedia/eslint-config-jest/prettier.config"
}
```
Using `.prettierrc`:
```
"@amedia/eslint-config-jest/prettier.config"
```
or `prettier.config.js`:
```js
module.exports = require('@amedia/eslint-config-jest/prettier.config');
```
## Are you using VS Code?
Install these extensions for VS Code:
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Prettier - Code formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
create a folder `.vscode`, and a file `settings.json` with the following:
```
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"[yaml]": {
"editor.formatOnSave": false
},
"[javascript]": {
"editor.detectIndentation": true
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
```
## Linting scripts
You might want to add these two scripts in you `package.json`.
```json
"scripts": {
"lint": "eslint bin lib",
"lint-fix": "eslint --fix bin lib"
},
```
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