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

@n3/eslint-config

Package Overview
Dependencies
Maintainers
5
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@n3/eslint-config

N3 ESLint config, following our styleguide

  • 0.14.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

@n3/eslint-config

Установка

npm install @n3/eslint-config --save-dev

или

yarn add @n3/eslint-config --dev

Конфигурация .eslinrc

По умолчанию, нужно настроить только import/resolver. Самый распространённый конфиг:

// .eslintrc.js
module.exports = {
  extends: ['@n3/eslint-config'],

  settings: {
    'import/resolver': {
      node: {
        extensions: ['.js', '.jsx'],
      },

      'babel-module': {
        alias: {
          common: './src/js/common',
          staff: './src/js/staff',
          ...
        },
      },
    },
  },
};

Проверка кода

Добавить в scripts в package.json следующую команду:

"lint": "eslint <path_to_src1> <path_to_src2> <...> --ext .js,.jsx",

typescript

  1. Конфигурация .eslintrc.js
// .eslintrc.js
module.exports = {
  extends: ['@n3/eslint-config/typescript'],
};
  1. Необходимо добавить файл tsconfig.validate.json, он будет использоваться для линтинга файлов

  2. Скрипт проверки должен выглядеть так

"lint": "eslint <path_to_src1> <path_to_src2> <...> --ext .ts,.tsx",

Keywords

FAQs

Package last updated on 14 Jul 2023

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