A code linting tool with typed configuration.
This CLI is a thin abstraction on top of eslint.
# 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
In your package.json
, you can use the exported cli lint
in your lint script e.g.
"scripts": {
"lint": "lint"
}
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();