Skip to content

About

Конфигурация ESLint

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Конфигурация ESLint

Open on npmx.dev Open on npmx.dev Open on npmx.dev

Установка

bun add -D @exer7um/eslint-config
pnpm i -D @exer7um/eslint-config
npm i -D @exer7um/eslint-config
yarn add -D @exer7um/eslint-config

Использование

Для использования нужно создать файл eslint.config.mjs или eslint.config.ts с содержимым:

import createESLintConfig from "@exer7um/eslint-config"

export default createESLintConfig()

Добавить в файл .vscode/settings.json:

{
  "eslint.validate": ["javascript", "json", "vue", "typescript", "yaml", "github-actions-workflow"]
}

Добавить команды для запуска в package.json:

{ "eslint": "eslint --max-warnings=0", "eslint:fix": "eslint --max-warnings=0 --fix" }

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

В функцию createESLintConfig можно передавать параметры для включения/отключения плагинов, а также для управления правилами.

Плагины

import createESLintConfig from "@exer7um/eslint-config"

export default createESLintConfig({ plugins: { vitest: false } })

Правила

import createESLintConfig from "@exer7um/eslint-config"

export default createESLintConfig({ rules: { "no-console": "off" } })

Игнорирование файлов и папок

Дополнительные пути можно добавить в globalIgnores через параметр ignores:

import createESLintConfig from "@exer7um/eslint-config"

export default createESLintConfig({ ignores: ["**/dist/**", "**/coverage/**"] })

React

При использовании React необходимо явно включить соответствующий плагин в конфигурации:

import createESLintConfig from "@exer7um/eslint-config"

export default createESLintConfig({ plugins: { react: true } })

About

Конфигурация ESLint

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages