@alexlit/lint-kit

    71.2.0 • Public • Published

    Lint Kit

    Preset of configuration files and dependencies for linting web applications (designed for Vue.js with TypeScript)

    Installation

    npm i @alexlit/lint-kit -D

    Connection

    • Prettier

      // .prettierrc.js
      module.exports = {
        ...require('@alexlit/lint-kit/.prettierrc'),
      };
    • ESLint

      // .eslintrc.js
      module.exports = {
        extends: ['./node_modules/@alexlit/lint-kit/.eslintrc.js'],
      };
    • StyleLint

      // .stylelintrc.js
      module.exports = {
        extends: ['@alexlit/lint-kit/.stylelintrc.js'],
      
        ignoreFiles: [...require('@alexlit/lint-kit/.stylelintrc').ignoreFiles],
      };
    • HTMLLint

      // .linthtmlrc.js
      module.exports = {
        ...require('@alexlit/lint-kit/.linthtmlrc'),
      };
    • MarkdownLint

      // .markdownlintrc.js
      module.exports = {
        ...require('@alexlit/lint-kit/.markdownlintrc'),
      };
    • NPMLint

      // .npmpackagejsonlintrc.json
      {
        "extends": "@alexlit/lint-kit/.npmpackagejsonlintrc.json"
      }
    • CommitLint

      // .commitlintrc.js
      module.exports = {
        extends: ['@alexlit/lint-kit/.commitlintrc.js'],
      };
      // .huskyrc.js
      module.exports = {
        hooks: {
          'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
        },
      };

    Recipes

    Automatic launch linters and code fixes on commit

    // .lintstagedrc.js
    module.exports = {
      ...require('@alexlit/lint-kit/.lintstagedrc'),
    };
    // .huskyrc.js
    module.exports = {
      ...require('@alexlit/lint-kit/.huskyrc'),
    };

    Launching linters manually

    // package.json
    "scripts": {
      "lint": "./node_modules/@alexlit/lint-kit/scripts/lint.sh",
      "lint:eslint": "./node_modules/@alexlit/lint-kit/scripts/lint.eslint.sh",
      "lint:htmllint": "./node_modules/@alexlit/lint-kit/scripts//lint.htmllint.sh",
      "lint:markdownlint": "./node_modules/@alexlit/lint-kit/scripts/lint.markdownlint.sh",
      "lint:npmlint": "./node_modules/@alexlit/lint-kit/scripts/lint.npmlint.sh",
      "lint:stylelint": "./node_modules/@alexlit/lint-kit/scripts/lint.stylelint.sh",
    },
    # lint
    npm run lint
    # autofix errors
    npm run lint fix

    Publishing a package

    # .npmrc
    globalconfig="./node_modules/@alexlit/lint-kit/.npmrc"
    // package.json
    "scripts": {
      "publish": "./node_modules/@alexlit/lint-kit/scripts/publish.sh",
      "semver": "./node_modules/@alexlit/lint-kit/scripts/semver.sh",
      "up": "./node_modules/@alexlit/lint-kit/scripts/up.sh",
      "version": "./node_modules/@alexlit/lint-kit/scripts/version.sh"
    },
    npm run up # Updates dependencies
    npm run semver <patch | minor | major> # Updates package version
    npm publish # Publishes a package to npm repository

    Install

    npm i @alexlit/lint-kit

    DownloadsWeekly Downloads

    111

    Version

    71.2.0

    License

    MIT

    Unpacked Size

    62.7 kB

    Total Files

    26

    Last publish

    Collaborators

    • alex-lit