Package Exports
- @clabnet/configs-eslint-ts
- @clabnet/configs-eslint-ts/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@clabnet/configs-eslint-ts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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-ts
and its peer dependencies:pnpm add -w @clabnet/configs-eslint-ts eslint
Add 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
eslint
with vscode environment.
Usage
Automatic validation file with
eslint
on save.Automatic validation of staged files with
eslint
on commit.Manual usage from command line:
pnpm lint . pnpm lint:fix .