1.2.0 • Published 2 years 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-typescriptInstead, 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 
.prettierrcfile in project root with the following content: 
"@littlegrey/eslint-config-typescript/prettier-config.json"- Create a 
tsconfig.jsonfile 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"
  ]
}