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

eslint-config-oy

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-oy

Shared ESLint config for my projects

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by500%
Maintainers
0
Weekly downloads
 
Created
Source

eslint-config-oy

Shared ESLint config for my projects.
(Lints both JavaScript & TypeScript projects.)

Installation

$ npm install --save-dev eslint-config-oy

Usage

.eslintrc.json in TypeScript project:

{
    "extends": [
        "eslint-config-oy/ts"
    ]
}

.eslintrc.json in JavaScript project:

{
    "extends": [
        "eslint-config-oy"
    ]
}

Evironment Set Up

  • Install eslint extension for VSCode.

  • Add files below in the project's .vscode directory and paste related contents:

    • .vscode/extensions.json:
      {
        "recommendations": [
            "dbaeumer.vscode-eslint"
        ]
      }
      
    • .vscode/tasks.json:
      {
        "version": "2.0.0",
        "tasks": [
            {
              "type": "npm",
              "script": "lint",
              "problemMatcher": ["$eslint-stylish"],
              "label": "npm: lint",
              "detail": ""
            }
        ]
      }
      
    • .vscode/settings.json:
      {
          "eslint.validate": [
              "typescript",
              "typescriptreact"
          ]
      }
      

Contributing

  • index.js is eslint config for JavaScript projects.

  • ts.js is eslint config for TypeScript projects; and extends from index.js.

  • If @typescript-eslint has an override rule of an eslint rule; first make sure you turn off the eslint rule in ts.js.

    {
      quotes: "off",
      '@typescript-eslint/quotes': [
        'error',
        'single',
        {
            avoidEscape: true,
            allowTemplateLiterals: true
        }
      ],
    }
    
  • If a rule works the same way for both JavaScript and TypeScript, add the rule's value (configuration) in _common.js and reference in both index.js and ts.js.

    // _common.js
    {
      QUOTES: [
        'error',
        'single',
        {
          avoidEscape: true,
          allowTemplateLiterals: true
        }
      ],
      // ...
    }
    
    // index.js
    {
      quotes: common.QUOTES,
      // ...
    }
    
    // ts.js
    {
      quotes: 'off',
      '@typescript-eslint/quotes': common.QUOTES,
      // ...
    }
    

Keywords

FAQs

Package last updated on 15 Aug 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

  • 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