1.2.0 • Published 1 month ago

@littlegrey/eslint-config-typescript v1.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

Shared ESLint and Prettier configuration for TypeScript projects

An ESLint and Prettier configuration for sharing among TypeScript projects. Inspired by:

Integrate into new project

  1. 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
  1. 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).

  1. 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"],
};
  1. Create a .prettierrc file in project root with the following content:
"@littlegrey/eslint-config-typescript/prettier-config.json"
  1. 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"
  ]
}
1.2.0

1 month ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago