@ubic/eslint-config

6.1.0 • Public • Published

UBIC ESLint config

Стандартная конфигурация ESLint для проектов.

Покрывает все нестилистические стандартные правила ESLint на основе стайлгайда и конфигурации Airbnb.

Плагины:

Установка

yarn add -D @ubic/eslint-config prettier
# или
npm install -D @ubic/eslint-config prettier

Требования

  • eslint@8.0.0 и новее
  • prettier@3.0.0 и новее

Vanilla

module.exports = {
  root: true,
  extends: ['@ubic/eslint-config'],
};

Typescript

Установить пакеты:

yarn add -D @typescript-eslint/eslint-plugin @typescript-eslint/parser
module.exports = {
  root: true,
  extends: ['@ubic/eslint-config/typescript'],
};

React.js

module.exports = {
  root: true,
  extends: ['@ubic/eslint-config/react'],
};

React.js + Typescript

Установить пакеты:

yarn add -D @typescript-eslint/eslint-plugin @typescript-eslint/parser
module.exports = {
  root: true,
  extends: ['@ubic/eslint-config/react-typescript'],
};

Vue.js

При использовании vue-cli:

module.exports = {
  root: true,
  extends: ['@ubic/eslint-config/vue'],
  parserOptions: {
    parser: '@babel/eslint-parser',
  },
};

В случае, если используется другое окружение, необходимо так же указать путь до файла конфигурации webpack:

module.exports = {
  root: true,
  extends: ['@ubic/eslint-config/vue'],
  parserOptions: {
    parser: '@babel/eslint-parser',
  },
  settings: {
    'import/resolver': {
      webpack: {
        config: './webpack.config.js',
      },
    },
  },
};

Jest

module.exports = {
  root: true,
  extends: ['@ubic/eslint-config', '@ubic/eslint-config/jest'],
  env: {
    jest: true,
  },
};

Разработка

Процесс разработки подробно описан в CONTRIBUTING.md

Readme

Keywords

none

Package Sidebar

Install

npm i @ubic/eslint-config

Weekly Downloads

181

Version

6.1.0

License

MIT

Unpacked Size

3.02 MB

Total Files

37

Last publish

Collaborators

  • olegkireev
  • ubicnpm