🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@amedia/eslint-config-svelte

Package Overview
Dependencies
Maintainers
54
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amedia/eslint-config-svelte

ESLint Svelte configuration to be used by developers at Amedia

Source
npmnpm
Version
0.0.0-kragl-20220427170212
Version published
Weekly downloads
2.3K
-25.72%
Maintainers
54
Weekly downloads
 
Created
Source

@amedia/eslint-config-svelte

Common ESLint/Prettier configuration for Svelte that extends @amedia/eslint-config-base.

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-svelte

Then, to install the peer dependencies you can use install-peerdeps like this:

npx install-peerdeps --dev @amedia/eslint-config-svelte

Or you can do it manually by running:

npm info "@amedia/eslint-config-svelte" peerDependencies
npm install --save-dev @amedia/eslint-config-svelte

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:

{
  "eslintConfig": {
    "extends": ["@amedia/eslint-config-svelte", "plugin:import/recommended"]
  }
}

Using .eslintrc:

{
  "extends": ["@amedia/eslint-config-svelte", "plugin:import/recommended"]
}

or .eslintrc.js:

module.exports = {
  extends: ['@amedia/eslint-config-svelte', 'plugin:import/recommended'],
};

You also need to set up a prettier config.

Prettier

This is how you use or extend the @amedia/eslint-config-svelte prettier config in your app. Select one of options below:

Using package.json:

{
  "prettier": "@amedia/eslint-config-svelte/prettier.config"
}

Using .prettierrc:

"@amedia/eslint-config-svelte/prettier.config"

or prettier.config.js:

module.exports = require('@amedia/eslint-config-svelte/prettier.config');

Are you using VS Code?

Install these extensions for VS Code:

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.

"scripts": {
  "lint": "eslint src assets",
  "lint-fix": "eslint --fix src assets"
},

Keywords

eslint

FAQs

Package last updated on 27 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts