@killerchip/eslint-config v0.0.14
@killerchip/eslint-config
This package provides various shareable ESLint configuration for various development environments.
It includes eslint configuration for the following project types:
- javascript
- typescript
All the configuration consider that your project uses
prettierformatting so, it disables all the rules that conflict withprettierformatting.
Installation
Regardless of your project type install the package with:
npm:
npm install --save-dev eslint @killerchip/eslint-configyarn:
yarn install -D eslint @killerchip/eslint-configpnpm:
pnpm install -D eslint @killerchip/eslint-configConfiguration - Javascript
For javascript projects, add this to your .eslintrc.js file:
module.exports = {
env: {
node: true,
},
extends: '@killerchip/eslint-config/javascript',
};add a script in your package.json:
{
"scripts": {
"lint": "eslint ."
}
}Configuration - Typescript
For typescript projects, need to install additional package:
npm:
npm install --save-dev @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latestyarn:
yarn install -D eslint @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latestpnpm:
pnpm install -D eslint @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latestAdd .eslintrc.js file to your project with the following content:
module.exports = {
extends: ['@killerchip/eslint-config/typescript'],
parserOptions: {
tsconfigRootDir: __dirname,
project: true,
},
};add a script in your package.json:
{
"scripts": {
"lint": "eslint ."
}
}If you get an error like: "ESLint was configured to run ... However, that TSConfig does not / none of those TSConfigs include this file", then add these files in an .eslintignore file. Find more details here: https://typescript-eslint.io/linting/troubleshooting/#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file
Configuration - NextJS
Install the needed packages:
npm install -D @killerchip/eslint-config @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latest eslintIn .eslintrc.js file add the following content:
module.exports = {
extends: [
"next/core-web-vitals",
"@killerchip/eslint-config/typescript",
"prettier",
],
parserOptions: {
tsconfigRootDir: __dirname,
project: true,
},
overrides: require("@killerchip/eslint-config/next.override").overrides,
};