1.2.0 • Published 1 month ago
@littlegrey/eslint-config-typescript v1.2.0
Shared ESLint and Prettier configuration for TypeScript projects
An ESLint and Prettier configuration for sharing among TypeScript projects. Inspired by:
Integrate into new project
- Install this package as devDependency
# with Yarn
$ yarn add -D @littlegrey/eslint-config-typescript
# with npm
$ npm i -D @littlegrey/eslint-config-typescript
# with pnpm
$ pnpm add -D @littlegrey/eslint-config-typescript
- Install peer dependencies of this package in your project as devDependencies
Therefore, you can make use of the tool install-peerdeps:
# with Yarn
$ yarn dlx install-peerdeps --dev @littlegrey/eslint-config-typescript
# with npm
$ npx install-peerdeps --dev @littlegrey/eslint-config-typescript
#with pnpm
$ pnpm dlx install-peerdeps --dev @littlegrey/eslint-config-typescript
Instead, you can do this manually by adding all entries part of the peerDependencies
property (see package.json
).
- Use ESLint config in your project
Create a .eslintrc.js
file in project root with the following content:
module.exports = {
extends: ["@littlegrey/eslint-config-typescript"],
};
- Create a
.prettierrc
file in project root with the following content:
"@littlegrey/eslint-config-typescript/prettier-config.json"
- Create a
tsconfig.json
file in root that contains only settings that need to reference locations relative to the project root. For example:
{
"extends": "@littlegrey/eslint-config-typescript/tsconfig.shared.json",
"compilerOptions": {
"outDir": "./dist",
"baseUrl": "./"
},
"include": [
"src"
]
}