/vite-plugin-ls-lint

Vite plugin to use ls-lint in vite projects

Primary LanguageJavaScriptMIT LicenseMIT

vite-plugin-ls-lint logo

vite-plugin-ls-lint

Vite npm plugin to use the directory and filename linter ls-lint npm .

npm License

Project structure
├── src
├── node_modules
└── .gitignore
└── ...
├── .ls-lint.yml
├── ...
├── package.json
├── package-lock.json
└── vite.config.js/ts


🚀 Quickstart

  1. Install with your favorite package manager:
    • pnpm : pnpm i vite-plugin-ls-lint --save-dev
    • npm : npm i vite-plugin-ls-lint --save-dev

Note:
You also need to install ls-lint >= 2, if you haven't already:
  npm i @ls-lint/ls-lint --save-dev
🤙🏼Or install both with:
  npm i @ls-lint/ls-lint vite-plugin-ls-lint --save-dev

  1. Add the plugin into vite.config.js/ts:
import { defineConfig } from 'vite'
// other imports
import lsLintPlugin from 'vite-plugin-ls-lint'

export default defineConfig({
  plugins: [
    // ... other plugins
    lsLintPlugin()
  ],
})

  1. Add your ls-lint.yml configuration file, example:
ls:
  .js: snake_case
  .ts: snake_case | camelCase
  .d.ts: PascalCase
  .html: regex:[a-z0-9]+

ignore:
  - node_modules

📝 License

Copyright © 2023 Alonso Galicia.
This project is under MIT license.