eslint-config-leomax
v1.1.0
Published
Strict ruleset for eslint
Downloads
13
Maintainers
Readme
esling-config-leomax
Общий набор правил для стиля кода.
Предварительно установите eslint
npm i -g eslint
Установка
Все ждём приватных npm-модулей... Или я забью и опубликую так.
npm i -g esling-config-leomax
Использование в .eslintrc* файле
{
"extends": "leomax"
}
Использование в WebStorm
- Идем в настройки
- File->Settings (windows, настройки текущего проекта)
- File->Default Settings (windows, настройки по-умолчанию)
- WebStorm->Preferences (MacOS)
- Переходим в Languages&Frameworks->JavaScript->Code Quality Tools->ESLint
- Включаем
- Node interpreter - должно быть корректно. Иначе указываем путь к ноде.
- ESLint package - указываем корректный путь (важно) к глобально установленному eslint
- Configuration file
- Выбираем Configuration file и выбираем глобальный eslint-config-leomax/index.js
- Либо выбираем Automatic search и для каждого проекта создаем файл .eslintrc с указаным выше содержимым
- Радуемся, ибо это значительно упрощает отладку.
Вопросы
- Таб или 2 пробела?
- Одинарные или двойные кавычки для строк?
- Нужен ли отступ перед скобками функции: fn () или fn()?
- Нужны ли отступы по границам массива: [ 1, 2, 3 ] или [1, 2, 3]?
- То же самое с объектами, объектами в массиве и вообще см. это