eslint-config-frontwerk-typescript
v1.2.2
Published
Frontwerk's ESLint config with Typescript support
Downloads
19
Maintainers
Readme
eslint-config-frontwerk-typescript
This package provides Frontwerk's TypeScript .eslintrc as an extensible shared ESLint config.
Usage
- 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
- 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
'sproject
inside of your.eslintrc
. When using the recommended (default) config, be sure to pass atsconfig.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
eslint-config-frontwerk-typescript
is based on the ESLint rules defined in eslint-config-frontwerk.- If you're using ReactJS, check out eslint-config-frontwerk-react.
Contributing
- Run tests with
npm run test
oryarn test
. - Run the lint with
npm run lint
oryarn lint
.
For details, check out the Contributing guide.
LICENSE
MIT