arui-presets-lint
Config files for arui-apps
Last updated 8 days ago by heymdall .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install arui-presets-lint 
SYNC missed versions from official npm registry.

Alfa Laboratory UI Presets

npm license travis


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

Установка

Для установки всех зависимостей проекта рекомендуется использовать install-peerdeps

npx install-peerdeps --dev arui-presets-lint

Если вы используете yarn на данный момент у вас могут возникнуть проблемы при использовании install-peerdeps. См. этот issue. Временным решением может служить использование версии 1.11.0.

npx install-peerdeps@1.11.0 --dev arui-presets-lint

Так же вы можете поставить все необходимые peerDependencies вручную. Для этого узнайте требуемые версии с помощью команды

npm info "arui-presets-lint@latest" peerDependencies

И добавьте их себе в проект как dev зависимости.

Конфигурация всех линтеров через package.json:

{
    "prettier": "arui-presets-lint/prettier",
    "eslintConfig": {
        "extends": "./node_modules/arui-presets-lint/eslint/index.js"
    },
    "stylelint": {
        "extends": "arui-presets-lint/stylelint"
    },
    "commitlint": {
        "extends": [
            "./node_modules/arui-presets-lint/commitlint"
        ]
    }
}

Конфигурация скриптов для запуска линтеров и форматтера в package.json:

{
    "script": {
        "lint:css": "stylelint ./src/**/*.css",
        "lint:scripts": "eslint \"**/*.{js,jsx,ts,tsx}\" --ext .js,.jsx,.ts,.tsx",
        "lint": "yarn lint:css && yarn lint:scripts",
        "format": "prettier --ignore-path \"./.gitignore\" --write \"./**/*.{ts,tsx,js,jsx,css}\""
    }
}

Если eslint пытается валидировать файлы, над которыми вы не имеете контроль, вы можете исключить их с помощью .eslintignore

.build
.idea
coverage

Конфигурация husky и lint-staged:

{
    "lint-staged": {
        "src/**/*.{js,jsx,ts,tsx}": [
            "prettier --write",
            "eslint"
        ],
        "*.css": [
            "prettier --write",
            "stylelint"
        ]
    },
    "husky": {
        "hooks": {
            "pre-commit": "yarn lint-staged",
            "commit-msg": "commitlint -e"
        }
    }
}

Итоговая конфигурация линтеров:

{
    "script": {
        "lint:css": "stylelint ./src/**/*.css",
        "lint:scripts": "eslint \"**/*.{js,jsx,ts,tsx}\" --ext .js,.jsx,.ts,.tsx",
        "lint": "yarn lint:css && yarn lint:scripts",
        "format": "prettier --ignore-path \"./.gitignore\" --write \"./**/*.{ts,tsx,js,jsx,css}\""
    },
    "lint-staged": {
        "src/**/*.{js,jsx,ts,tsx}": [
            "prettier --write",
            "eslint"
        ],
        "*.css": [
            "prettier --write",
            "stylelint"
        ]
    },
    "husky": {
        "hooks": {
            "pre-commit": "yarn lint-staged",
            "commit-msg": "commitlint -e"
        }
    },
    "prettier": "arui-presets-lint/prettier",
    "eslintConfig": {
        "extends": "./node_modules/arui-presets-lint/eslint/index.js"
    },
    "stylelint": {
        "extends": "arui-presets-lint/stylelint"
    },
    "commitlint": {
        "extends": [
            "./node_modules/arui-presets-lint/commitlint"
        ]
    }
}

Лицензия

The MIT License (MIT)

Copyright (c) 2020 Alfa-Bank

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.

Current Tags

  • 2.0.1-beta                                ...           beta (4 months ago)
  • 4.1.0                                ...           latest (8 days ago)
  • 4.0.0-beta.5                                ...           next (15 days ago)

22 Versions

  • 4.1.0                                ...           8 days ago
  • 4.0.0                                ...           15 days ago
  • 4.0.0-beta.5                                ...           15 days ago
  • 4.0.0-beta.4                                ...           15 days ago
  • 4.0.0-beta.3                                ...           20 days ago
  • 4.0.0-beta.2                                ...           20 days ago
  • 4.0.0-beta                                ...           21 days ago
  • 3.0.1-next.2                                ...           21 days ago
  • 3.0.1-next                                ...           21 days ago
  • 3.0.1                                ...           2 months ago
  • 3.0.0-rc                                ...           2 months ago
  • 2.0.1                                ...           3 months ago
  • 2.0.0-next.3                                ...           3 months ago
  • 2.0.0-next.2                                ...           3 months ago
  • 2.0.0-next                                ...           3 months ago
  • 2.0.0                                ...           4 months ago
  • 2.0.1-beta                                ...           4 months ago
  • 2.0.0-beta                                ...           5 months ago
  • 1.2.1                                ...           7 months ago
  • 1.2.0                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.0                                ...           a year ago

Copyright 2014 - 2016 © taobao.org |