0.1.18 • Published 6 months ago
@clabnet/configs-eslint-ts v0.1.18
Shared eslint configuration
The purpose of the eslint is linting javascript and typescript languages (js, ts, tsx).
This configuration targets monorepo packages.
Contents
Setup
Add workspace reference to
@clabnet/configs-eslint-tsand its peer dependencies:pnpm add -w @clabnet/configs-eslint-ts eslintAdd eslint configuration file:
// .eslintrc.js module.exports = require('@clabnet/configs-eslint-ts')Add eslint ignore patterns file:
# .eslintignore !.* node_modules/ # Next ignore patterns .next/ .build/ .coverage/ # Custom ignore patterns ...Add eslint scripts:
// package.json "scripts": { ... "lint": "eslint --ext js,cjs,mjs,ts,tsx", "lint:fix": "pnpm lint --fix" ... }
Automation
- Setup ➡ eslint vscode plugin to integrate
eslintwith vscode environment.
Usage
- Automatic validation file with
eslinton save. - Automatic validation of staged files with
eslinton commit. Manual usage from command line:
pnpm lint . pnpm lint:fix .