eslint-config-frontwerk-typescript

1.2.2 • Public • Published

eslint-config-frontwerk-typescript

Node Version Npm version Npm downloads License

This package provides Frontwerk's TypeScript .eslintrc as an extensible shared ESLint config.

Usage

  1. Install the versions of the package, including its peerDependencies:
npm install --dev eslint-config-frontwerk-typescript @typescript-eslint/{eslint-plugin,parser} eslint eslint-plugin-import typescript

Or with yarn:

yarn add --dev eslint-config-frontwerk-typescript @typescript-eslint/{eslint-plugin,parser} eslint eslint-plugin-import typescript
  1. Extend your desired config file in your .eslintrc. We expose two configurations:

Semantic rules use the TypeScript compiler to inspect static types and validate code patterns. These rules require that a valid tsconfig.json file be present and referenced in your parserOptions's project inside of your .eslintrc. When using the recommended (default) config, be sure to pass a tsconfig.json in your .eslintrc.

  • The recommended (default) config that includes the TypeScript rules that require type checking. Add "extends": "frontwerk-typescript" to your .eslintrc.
{
  "extends": ["frontwerk-typescript", "plugin:import/typescript"],
  "parserOptions": {
     "project": "./tsconfig.json"
   },
}
  • A config without the TypeScript rules that require type checking. Add "extends": "frontwerk-typescript/no-type-checking" to your .eslintrc.
  • A config with the TypeScript rules that are stricter. Add "extends": "frontwerk-typescript/strict" to your .eslintrc.

Related

Contributing

  • Run tests with npm run test or yarn test.
  • Run the lint with npm run lint or yarn lint.

For details, check out the Contributing guide.

LICENSE

MIT

Package Sidebar

Install

npm i eslint-config-frontwerk-typescript

Weekly Downloads

0

Version

1.2.2

License

MIT

Unpacked Size

50.3 kB

Total Files

12

Last publish

Collaborators

  • tricinel