1.2.4 • Published 8 months ago

@ilyasemenov/lint-config v1.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@ilyasemenov/lint-config

A set of reusable linter configs that I use in the projects that I develop or supervise:

Install

pnpm add -D @ilyasemenov/lint-config eslint stylelint

Setup eslint

Create eslint.config.js:

import { defineEslintConfig } from "@ilyasemenov/lint-config"

export default defineEslintConfig()

Available options:

export default defineEslintConfig({
  // Lint Vue. Unlike antfu, must be enabled explicitly.
  vue: true,

  // Lint pug in Vue templates.
  vuePug: true,

  // ...and all @antfu/eslint-config options.
})

Setup stylelint

Create stylelint.config.js:

import { defineStylelintConfig } from "@ilyasemenov/lint-config"

export default defineStylelintConfig()

Available options:

export default defineStylelintConfig({
  // Use tabs for indentation.
  tabs: true,

  // Use single quotes.
  quotes: "single",

  // ...and all stylelint options.
})

Add command line script

Add to package.json:

{
  "scripts": {
    "lint": "eslint --fix . && stylelint --fix '**/*.{css,scss,vue}'"
  }
}

and run:

pnpm lint

Setup lint-staged

Create lint-staged.config.js:

export default {
  "*.{cjs,js,ts,json,md,yaml,toml}": "eslint --fix",
  "*.{css,scss}": "stylelint --fix",
  "*.vue": ["eslint --fix", "stylelint --fix"],
}
1.2.4

8 months ago

1.2.3

9 months ago

1.2.0

9 months ago

1.2.2

9 months ago

1.2.1

9 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.0

10 months ago