Socket
Book a DemoInstallSign in
Socket

eslint-config-agoda

Package Overview
Dependencies
Maintainers
4
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-agoda

Agoda's ESLint configuration and rules

4.6.1
latest
Source
npmnpm
Version published
Maintainers
4
Created
Source

npm npm semantic-release Commitizen friendly dependabot badge

eslint-config-agoda

This package contains Agoda's ESLint configuration that can be shared and extended.

Installation

# yarn users
yarn add -D eslint-config-agoda

# npm users
npm install --save-dev eslint-config-agoda

# pnpm users
pnpm add -D eslint-config-agoda

You will also need to have all peer dependencies installed on your project. To do so, please run:

# will use yarn/npm depending on detected configuration.
npx install-peerdeps --dev eslint-config-agoda

Usage

Modify your .eslintrc configuration file, to extend from Agoda's config:

"extends": "agoda"

Example .eslintrc file for Typescript environment:

{
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "project": "./tsconfig.json"
  },
  "extends": ["agoda"],
  "rules": {}
}

Command line

Setup following script in package.json to enable linting via CLI.

    "lint": "eslint --ext .ts,.tsx --ignore-path .gitignore ./packages/",

Above example is using packages directory (like it would be done for a monorepo), so should be replaced by ./src/ in case of regular codebase

Visual Studio Code

You can enable linting to run in background and check currently opened files by setting following configuration:

workspace settings .vscode/settings.json

"eslint.validate": [
    {
      "language": "typescript",
      "autoFix": true
    },
    {
      "language": "typescriptreact",
      "autoFix": true
    }
  ],
  "eslint.options": {
    "extensions": [".ts", ".tsx"]
  },
  "typescript.tsdk": "node_modules\\typescript\\lib",

  "eslint.alwaysShowStatus": true,
  "eslint.autoFixOnSave": true,
  "editor.formatOnSave": false,
  "javascript.format.enable": false

Typescript

Note that this config is created with typescript in mind, so remember to use project key to facilitate type-based rules as well.

Keywords

eslint

FAQs

Package last updated on 07 Nov 2024

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.