Giter Club home page Giter Club logo

eslint-config's Introduction

@vaddk/eslint-config

  • Одинарные кавычки, без точки запятой
  • Автоматическое форматирование кода при сохранении (предназначено для использования)
  • Разработан для работы с Vue + Typescript (есть fallback под js)
  • Lint json, yaml, markdown
  • Сортировка импортов, висячие запятые

Установка

pnpm add -D eslint @vaddk/eslint-config

Конфиг .eslintrc

{
  "extends": "@vaddk/eslint-config"
}

.eslintignore не нужен, настройки учтены в конфиге.

Добавление скрипта в package.json

{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  }
}

Настройка VS Code

Необходимо установить VS Code ESLint и создать .vscode/settings.json в корне проекта.

{
  "prettier.enable": false,
  "editor.formatOnSave": false,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }
}

Изменение правил TypeScript

Изменить правила линтинга TypeScript можно, добавив файл tsconfig.eslint.json в корень проекта, и указав в нем необходимые правила. Если вы хотите использовать более строгие правила линтинга TypeScript, не создавая файл tsconfig.eslint.json, вы можете изменить переменную окружения ESLINT_TSCONFIG, указав в ней название текущего конфигурационного файла ts.

// .eslintrc.js
process.env.ESLINT_TSCONFIG = 'tsconfig.json'

module.exports = {
  extends: '@vaddk/eslint-config'
}

eslint-config's People

Contributors

vaddk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.