A set of presets for arui-feather-based projects
Switch branches/tags
PublicFess-patch-1 feat/add-no-target-blank-rule feat/add-postcss-color-function feat/add-postcss-import-resolve-option feat/add-postcss-inherit feat/add-postcss-plugins feat/add-postcss-strip-units feat/eslint-plugins-as-peer feat/node-compilation feat/production-config-builder feat/ts-no-unused-variable feat/tslint feat/update-eslint-prefer-destructuring feat/use-colors-from-primitives feat/use-file-loader-for-fonts feat/webpack2 fix-arui-presets-packages fix/babel-production-plugins fix/babel-runtime fix/browserlist-shared-config fix/fix-ie10-support fix/linting-from-other-package fix/loader-search fix/post-css-nested fix/react-undefined fix/use-before-define greenkeeper/autoprefixer-8.3.0 greenkeeper/autoprefixer-8.4.0 greenkeeper/autoprefixer-8.4.1 greenkeeper/autoprefixer-8.5.0 greenkeeper/autoprefixer-8.5.1 greenkeeper/autoprefixer-8.6.0 greenkeeper/autoprefixer-8.6.1 greenkeeper/autoprefixer-8.6.2 greenkeeper/autoprefixer-8.6.3 greenkeeper/autoprefixer-8.6.4 greenkeeper/autoprefixer-8.6.5 greenkeeper/autoprefixer-9.0.0 greenkeeper/autoprefixer-9.0.1 greenkeeper/autoprefixer-9.0.2 greenkeeper/autoprefixer-9.1.0 greenkeeper/autoprefixer-9.1.1 greenkeeper/autoprefixer-9.1.2 greenkeeper/autoprefixer-9.1.4 greenkeeper/autoprefixer-9.1.5 greenkeeper/autoprefixer-9.2.0 greenkeeper/autoprefixer-9.2.1 greenkeeper/autoprefixer-9.3.0 greenkeeper/autoprefixer-9.3.1 greenkeeper/autoprefixer-9.4.0 greenkeeper/autoprefixer-9.4.1 greenkeeper/autoprefixer-9.4.2 greenkeeper/babel-eslint-8.2.4 greenkeeper/babel-eslint-8.2.5 greenkeeper/babel-eslint-8.2.6 greenkeeper/babel-eslint-9.0.0 greenkeeper/babel-eslint-10.0.0 greenkeeper/babel-eslint-10.0.1 greenkeeper/babel-loader-7.1.3 greenkeeper/babel-loader-7.1.4 greenkeeper/babel-loader-7.1.5 greenkeeper/babel-loader-8.0.0-beta.3 greenkeeper/babel-loader-8.0.0 greenkeeper/babel-loader-8.0.1 greenkeeper/babel-loader-8.0.2 greenkeeper/babel-loader-8.0.3 greenkeeper/babel-loader-8.0.4 greenkeeper/babel-plugin-transform-decorators-legacy-1.3.5 greenkeeper/babel-plugin-transform-react-remove-prop-types-0.4.14 greenkeeper/babel-plugin-transform-react-remove-prop-types-0.4.15 greenkeeper/babel-plugin-transform-react-remove-prop-types-0.4.16 greenkeeper/babel-plugin-transform-react-remove-prop-types-0.4.17 greenkeeper/babel-plugin-transform-react-remove-prop-types-0.4.18 greenkeeper/babel-plugin-transform-react-remove-prop-types-0.4.19 greenkeeper/babel-plugin-transform-react-remove-prop-types-0.4.20 greenkeeper/babel-plugin-transform-react-remove-prop-types-0.4.21 greenkeeper/case-sensitive-paths-webpack-plugin-2.1.2 greenkeeper/@commitlint/cli-6.2.0 greenkeeper/@commitlint/cli-7.0.0 greenkeeper/@commitlint/cli-7.1.0 greenkeeper/@commitlint/cli-7.1.1 greenkeeper/@commitlint/cli-7.1.2 greenkeeper/@commitlint/cli-7.2.0 greenkeeper/@commitlint/cli-7.2.1 greenkeeper/@commitlint/config-conventional-7.0.0 greenkeeper/@commitlint/config-conventional-7.0.1 greenkeeper/@commitlint/config-conventional-7.1.0 greenkeeper/@commitlint/config-conventional-7.1.1 greenkeeper/@commitlint/config-conventional-7.1.2 greenkeeper/compression-webpack-plugin-1.1.8 greenkeeper/compression-webpack-plugin-1.1.9 greenkeeper/compression-webpack-plugin-1.1.10 greenkeeper/compression-webpack-plugin-1.1.11 greenkeeper/compression-webpack-plugin-1.1.12 greenkeeper/compression-webpack-plugin-2.0.0 greenkeeper/conventional-changelog-cli-1.3.22 greenkeeper/conventional-changelog-cli-2.0.0 greenkeeper/conventional-changelog-cli-2.0.1 greenkeeper/conventional-changelog-cli-2.0.7 greenkeeper/conventional-changelog-cli-2.0.8 greenkeeper/conventional-changelog-cli-2.0.9 greenkeeper/conventional-changelog-cli-2.0.10 greenkeeper/conventional-changelog-cli-2.0.11 greenkeeper/conventional-github-releaser-3.0.0 greenkeeper/conventional-github-releaser-3.1.0 greenkeeper/conventional-github-releaser-3.1.1 greenkeeper/conventional-github-releaser-3.1.2 greenkeeper/css-loader-0.28.10 greenkeeper/css-loader-0.28.11 greenkeeper/css-loader-1.0.0 greenkeeper/css-loader-1.0.1 greenkeeper/css-loader-2.0.0 greenkeeper/eslint-5.0.0 greenkeeper/eslint-5.0.1 greenkeeper/eslint-config-airbnb-17.0.0 greenkeeper/eslint-config-airbnb-17.1.0 greenkeeper/file-loader-1.1.10 greenkeeper/file-loader-1.1.11 greenkeeper/file-loader-2.0.0 greenkeeper/husky-0.15.0-rc.2 greenkeeper/husky-1.0.0 greenkeeper/husky-1.0.1 greenkeeper/husky-1.1.0 greenkeeper/husky-1.1.1 greenkeeper/husky-1.1.2 greenkeeper/husky-1.1.3 greenkeeper/husky-1.1.4 greenkeeper/husky-1.2.0 greenkeeper/initial greenkeeper/lint-staged-7.0.5 greenkeeper/lint-staged-7.1.1 greenkeeper/lint-staged-7.1.2 greenkeeper/lint-staged-7.1.3 greenkeeper/lint-staged-7.2.0 greenkeeper/lint-staged-7.2.1 greenkeeper/lint-staged-7.2.2 greenkeeper/lint-staged-7.3.0 greenkeeper/lint-staged-8.0.0 greenkeeper/lint-staged-8.0.1 greenkeeper/lint-staged-8.0.2 greenkeeper/lint-staged-8.0.3 greenkeeper/lint-staged-8.0.4 greenkeeper/lint-staged-8.0.5 greenkeeper/lint-staged-8.1.0 greenkeeper/npm-run-all-4.1.3 greenkeeper/npm-run-all-4.1.4 greenkeeper/npm-run-all-4.1.5 greenkeeper/optimize-css-assets-webpack-plugin-4.0.0 greenkeeper/optimize-css-assets-webpack-plugin-4.0.2 greenkeeper/optimize-css-assets-webpack-plugin-4.0.3 greenkeeper/optimize-css-assets-webpack-plugin-5.0.0 greenkeeper/optimize-css-assets-webpack-plugin-5.0.1 greenkeeper/postcss-6.0.22 greenkeeper/postcss-6.0.23 greenkeeper/postcss-7.0.0 greenkeeper/postcss-7.0.1 greenkeeper/postcss-7.0.2 greenkeeper/postcss-7.0.3 greenkeeper/postcss-7.0.4 greenkeeper/postcss-7.0.5 greenkeeper/postcss-7.0.6 greenkeeper/postcss-calc-6.0.2 greenkeeper/postcss-calc-7.0.0 greenkeeper/postcss-calc-7.0.1 greenkeeper/postcss-custom-media-7.0.0 greenkeeper/postcss-custom-media-7.0.1 greenkeeper/postcss-custom-media-7.0.2 greenkeeper/postcss-custom-media-7.0.3 greenkeeper/postcss-custom-media-7.0.4 greenkeeper/postcss-custom-media-7.0.5 greenkeeper/postcss-custom-media-7.0.6 greenkeeper/postcss-custom-media-7.0.7 greenkeeper/postcss-custom-properties-8.0.0 greenkeeper/postcss-custom-properties-8.0.1 greenkeeper/postcss-custom-properties-8.0.2 greenkeeper/postcss-custom-properties-8.0.3 greenkeeper/postcss-custom-properties-8.0.4 greenkeeper/postcss-custom-properties-8.0.5 greenkeeper/postcss-custom-properties-8.0.6 greenkeeper/postcss-custom-properties-8.0.7 greenkeeper/postcss-custom-properties-8.0.8 greenkeeper/postcss-custom-properties-8.0.9 greenkeeper/postcss-discard-comments-4.0.0 greenkeeper/postcss-discard-comments-4.0.1 greenkeeper/postcss-import-12.0.0 greenkeeper/postcss-import-12.0.1 greenkeeper/postcss-loader-2.1.1 greenkeeper/postcss-loader-2.1.2 greenkeeper/postcss-loader-2.1.3 greenkeeper/postcss-loader-2.1.4 greenkeeper/postcss-loader-2.1.5 greenkeeper/postcss-loader-2.1.6 greenkeeper/postcss-loader-3.0.0 greenkeeper/postcss-mixins-6.2.1 greenkeeper/postcss-nested-4.0.0 greenkeeper/postcss-nested-4.1.0 greenkeeper/postcss-url-7.3.1 greenkeeper/postcss-url-7.3.2 greenkeeper/postcss-url-8.0.0 greenkeeper/react-dev-utils-5.0.2 greenkeeper/react-dev-utils-6.0.3 greenkeeper/react-dev-utils-6.0.4 greenkeeper/react-dev-utils-6.0.5 greenkeeper/react-dev-utils-6.1.0 greenkeeper/react-dev-utils-6.1.1 greenkeeper/style-loader-0.20.3 greenkeeper/style-loader-0.21.0 greenkeeper/style-loader-0.22.0 greenkeeper/style-loader-0.22.1 greenkeeper/style-loader-0.23.0 greenkeeper/style-loader-0.23.1 greenkeeper/stylelint-9.2.1 greenkeeper/stylelint-9.3.0 greenkeeper/stylelint-9.4.0 greenkeeper/stylelint-9.5.0 greenkeeper/stylelint-9.6.0 greenkeeper/stylelint-9.7.0 greenkeeper/stylelint-9.7.1 greenkeeper/stylelint-9.8.0 greenkeeper/stylelint-9.9.0 greenkeeper/update-to-node-10 greenkeeper/url-loader-1.0.0 greenkeeper/url-loader-1.0.1 greenkeeper/url-loader-1.1.0 greenkeeper/url-loader-1.1.1 greenkeeper/url-loader-1.1.2 greenkeeper/webpack-4.0.0 greenkeeper/webpack-4.0.1 greenkeeper/webpack-4.1.0 greenkeeper/webpack-4.1.1 greenkeeper/webpack-4.2.0 greenkeeper/webpack-4.3.0 greenkeeper/webpack-4.4.0 greenkeeper/webpack-4.5.0 greenkeeper/webpack-4.6.0 greenkeeper/webpack-4.7.0 greenkeeper/webpack-4.8.1 greenkeeper/webpack-4.8.2 greenkeeper/webpack-4.8.3 greenkeeper/webpack-4.9.0 greenkeeper/webpack-4.9.1 greenkeeper/webpack-4.9.2 greenkeeper/webpack-4.10.0 greenkeeper/webpack-4.10.1 greenkeeper/webpack-4.10.2 greenkeeper/webpack-4.11.0 greenkeeper/webpack-4.11.1 greenkeeper/webpack-4.12.0 greenkeeper/webpack-4.12.1 greenkeeper/webpack-4.12.2 greenkeeper/webpack-4.13.0 greenkeeper/webpack-4.14.0 greenkeeper/webpack-4.15.0 greenkeeper/webpack-4.15.1 greenkeeper/webpack-4.16.0 greenkeeper/webpack-4.16.1 greenkeeper/webpack-4.16.2 greenkeeper/webpack-4.16.3 greenkeeper/webpack-4.16.4 greenkeeper/webpack-4.16.5 greenkeeper/webpack-4.17.0 greenkeeper/webpack-4.17.1 greenkeeper/webpack-4.17.2 greenkeeper/webpack-4.18.0 greenkeeper/webpack-4.18.1 greenkeeper/webpack-4.19.0 greenkeeper/webpack-4.19.1 greenkeeper/webpack-4.20.0 greenkeeper/webpack-4.20.1 greenkeeper/webpack-4.20.2 greenkeeper/webpack-4.21.0 greenkeeper/webpack-4.22.0 greenkeeper/webpack-4.23.0 greenkeeper/webpack-4.23.1 greenkeeper/webpack-4.24.0 greenkeeper/webpack-4.25.0 greenkeeper/webpack-4.25.1 greenkeeper/webpack-4.26.0 greenkeeper/webpack-4.26.1 greenkeeper/webpack-4.27.0 greenkeeper/webpack-4.27.1 greenkeeper/webpack-dev-server-3.0.0 greenkeeper/webpack-dev-server-3.1.0 greenkeeper/webpack-dev-server-3.1.1 greenkeeper/webpack-dev-server-3.1.2 greenkeeper/webpack-dev-server-3.1.3 greenkeeper/webpack-dev-server-3.1.4 greenkeeper/webpack-dev-server-3.1.5 greenkeeper/webpack-dev-server-3.1.6 greenkeeper/webpack-dev-server-3.1.7 greenkeeper/webpack-dev-server-3.1.8 greenkeeper/webpack-dev-server-3.1.9 greenkeeper/webpack-dev-server-3.1.10 greenkeeper/webpack-manifest-plugin-2.0.0-rc.2 greenkeeper/webpack-manifest-plugin-2.0.0 greenkeeper/webpack-manifest-plugin-2.0.1 greenkeeper/webpack-manifest-plugin-2.0.2 greenkeeper/webpack-manifest-plugin-2.0.3 greenkeeper/webpack-manifest-plugin-2.0.4 master version-2 ziimir.move-to-new-presets
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
commitlint
eslint feat(eslint): add componentDidCatch handling in plugins (#180) Mar 19, 2018
stylelint fix(eslint): disable func-names rule Mar 30, 2017
test
.browserslistrc fix(*): browserslist config Jul 3, 2018
.editorconfig chore(*): initial commit Feb 20, 2017
.eslintignore feat(*): add babel options, add tests Jul 7, 2017
.eslintrc.js
.gitignore
.npmignore
.travis.yml
CHANGELOG.md chore(*): patch version Aug 23, 2018
README.md feat(eslint): mark eslint plugins as peer dependencies Jun 8, 2018
appveyor.yml chore(*): add appveyor config Nov 28, 2017
babel.js feat(babel): babel-env target node Jan 9, 2018
commitlint.config.js feat(*): add commitlint shareable config (#35) Dec 6, 2017
package-lock.json chore(*): patch version Aug 23, 2018
package.json chore(*): patch version Aug 23, 2018
postcss.js fix(*): use shared browserlist config for all tools Jul 3, 2018
supporting-browsers.js feat(*): add env preset instead of deprecated stage-0 Oct 11, 2017
webpack.base.js fix(webpack): use require-resolve to find loaders Mar 22, 2018
webpack.development.js fix(*): use shared browserlist config for all tools Jul 3, 2018
webpack.production-builder.js
webpack.production.js feat(*): add production config builder Oct 26, 2017
webpack.typescript.js fix(webpack): use require-resolve to find loaders Mar 22, 2018
yarn.lock feat(eslint): mark eslint plugins as peer dependencies Jun 8, 2018

README.md

Alfa Laboratory UI Presets

npm license travis appveyor greenkeeper


Набор конфигурационных файлов для компиляции и валидации проектов, основанных на arui-feather.

Установка

npm install arui-presets --save-dev

Или, если вы используете yarn:

yarn add arui-presets --dev

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

commitlint

Вы можете унаследовать конфигурацию вашего commitlint от arui-presets/commitlint.

Файл commitlint.config.js вашего проекта:

module.exports = {
    extends: ['arui-presets/commitlint']
};

eslint

Вы можете унаследовать конфигурацию вашего eslint от arui-presets/eslint. К сожалению, разработчики eslint очень нехотят делать полноценную систему для общих конфигураций, так что вам необходимо так же установить peerDependencies.

npm install eslint eslint-config-airbnb eslint-plugin-class-methods-use-this-regexp \
  eslint-plugin-import eslint-plugin-jsdoc eslint-plugin-jsx-a11y eslint-plugin-react \
  eslint-plugin-sort-class-members eslint-plugin-chai-friendly --save-dev

Файл .eslintrc.js вашего проекта:

module.exports = {
    extends: require.resolve('arui-presets/eslint')
};

stylelint

Вы можете унаследовать конфигурацию вашего stylelint от arui-presets/stylelint.

Файл stylelint.config.js вашего проекта:

module.exports = {
    extends: 'arui-presets/stylelint'
};

В зависимостях этого проекта уже имеются stylelint и eslint с нужными наборами плагинов, поэтому для использования валидации достаточно добавить в "scripts" вашего package.json

"lint-css": "stylelint ./src/**/*.css",
"lint-js": "eslint ./src/ --ext .js,.jsx",
"lint": "npm run lint-css && npm run lint-js",

Конфигурация компиляторов

babel

Вы можете использовать preset arui-presets/babel.

Файл .babelrc вашего проекта:

{
  "presets": ["arui-presets/babel"]
}

Настройки основаны на babel-presets-env с добавлением плагинов для поддержки декораторов и нескольких оптимизаций для react.

Вы можете передать любые настройки, поддерживаемые babel-presets-env. Если вы хотите получить более адекватную для последних версий node версии компиляцию (например не компилировать async/await) вам необходимо определить env переменную BABEL_TARGET=node. Без этой env переменной сборка будет происходить в расчете на поддерживаемые arui-feather версии браузеров.

postcss

Конфигурация для postcss требует настроек плагина postcss-custom-media. Взять их можно в arui-feather/mq.

Файл postcss.config.js вашего проекта:

const mq = require('arui-feather/mq/mq.json');
const aruiConfig = require('arui-presets/postcss');
module.exports = aruiConfig(mq);

Использование настроек webpack

В пакете также содержатся файлы с конфигурацией webpack.

  • webpack.base.js - общий шаблон для webpack
  • webpack.development.js - настройки для разработческой среды
  • webpack.production.js - настройки для боевой среды
  • webpack.typescript.js - настройки для использования typescript в проекте

Лучший способ использовать их — объединять их пакетом webpack-merge

const ARUI_TEMPLATE = require('arui-presets/webpack.base');
const ARUI_DEV_TEMPLATE = require('arui-presets/webpack.development');
const ARUI_PROD_TEMPLATE = require('arui-presets/webpack.production');
const merge = require('webpack-merge');

module.exports = merge.smart(
    { entry: 'src/index.js' },
    ARUI_TEMPLATE,
    process.env.NODE_ENV === 'production' ? ARUI_PROD_TEMPLATE : ARUI_DEV_TEMPLATE
);

Использование в typescript проектах

Для использования в проекте ts используйте пакет arui-presets-ts.

Лицензия

The MIT License (MIT)

Copyright (c) 2017 Alfa Laboratory

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.