This library contains suitable configurations for various projects. It's designed to simplify and standardize your project setup for less boilerplate and faster development.
npm i @ehubbell/configs --save-dev
npm install
Add one of the following to your package.json
file:
"eslintConfig": { "extends": "./node_modules/@ehubbell/configs/src/eslint-config-node.js" },
"eslintConfig": { "extends": "./node_modules/@ehubbell/configs/src/eslint-config-web.js" },
Add the following to your package.json
file:
"prettier": "@ehubbell/configs/prettier-config",
Create a tsconfig.json
file and add one of the following:
{
"extends": "@ehubbell/configs/tsconfig-web",
"include": ["src"],
"exclude": ["node_modules"]
}
{
"extends": "@ehubbell/configs/tsconfig-package",
"include": ["src"],
"exclude": ["node_modules"]
}
{
"extends": "@ehubbell/configs/tsconfig-node",
"include": ["src"],
"exclude": ["node_modules"]
}
- eslint v9 doesn't allow nested
extends
- this means we need to import each one separately
- eslint v9 also doesn't allow placement in package.json
- module.exports >> export default
- https://eslint.org/docs/latest/use/configure/configuration-files#using-a-shareable-configuration-package
- when using the typescript configs above in a monorepo, you may have to specify the
baseUrl
,rootDir
, andoutDir
properties