Tangany ESLint Config
Shareable config that is designed to work with the extends feature of .eslintrc files. Install the package via:
npm i -D @tangany/eslint-config@latest eslint-plugin-simple-import-sort eslint-plugin-import eslint-plugin-unused-imports
or
yarn add eslint @tangany/eslint-config@latest eslint-plugin-simple-import-sort eslint-plugin-import eslint-plugin-unused-imports -D
and add it as a dependency to your .eslintrc:
{
"extends": ["@tangany"]
}
Your file should look something like this:
.eslintrc.js
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
project: "tsconfig.json",
sourceType: "module",
},
plugins: ["@typescript-eslint/eslint-plugin"],
extends: [
"plugin:@typescript-eslint/recommended",
"@tangany/eslint-config"
],
env: {
node: true,
jest: true,
},
rules: {}
};
Package scripts
You can add a script to your package.json
to run the linter, including between the curly braces the folders you want to be linted (or remove the curly braces if it's only one folder):
"lint": "eslint \"{src,apps,libs,tests}/**/*.ts\" --fix",