@ubic/eslint-config
v6.1.0
Published
Стандартная конфигурация ESLint для проектов.
Downloads
1,138
Readme
UBIC ESLint config
Стандартная конфигурация ESLint для проектов.
Покрывает все нестилистические стандартные правила ESLint на основе стайлгайда и конфигурации Airbnb.
Плагины:
Установка
yarn add -D @ubic/eslint-config prettier
# или
npm install -D @ubic/eslint-config prettier
Требования
- [email protected] и новее
- [email protected] и новее
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