@pkg-tools/lint
v1.0.7
Published
A utility/tool for linting packages
Downloads
21
Readme
@pkg-tools/lint
A code linting tool with typed configuration.
This CLI is a thin abstraction on top of eslint.
Install
# w/ pnpm
pnpm add -D @pkg-tools/lint @pkg-tools/config
# w/ yarn
yarn add -D @pkg-tools/lint @pkg-tools/config
# w/ npm
npm install -D @pkg-tools/lint @pkg-tools/config
Usage
In your package.json
, you can use the exported cli lint
in your lint script e.g.
"scripts": {
"lint": "lint"
}
Configure
Define a pkg.config.ts
in the root of your package and add the following.
import { defineConfig } from '@pkg-tools/config';
export default defineConfig({
lint: {
rules: {
'no-unused-vars': 0,
},
},
});
Since @pkg-tools/lint leverage eslint, you'll still need to create a eslint configuration file for @pkg-tools/lint to work in your editor.
To do so create a file named .eslintrc.cjs
with the following contents in the root of your package.
const { getConfig } = require('@pkg-tools/lint/config');
module.exports = getConfig();