@craftworks/eslint-config-typescript
v2.0.0
Published
A ESLint config optimized for TypeScript
Downloads
1,000
Readme
@craftworks/eslint-config-typescript
An ESLint config optimized for TypeScript.
Contains the configs of
- eslint:recommended
- @typescript-eslint/recommended-type-checked
- @typescript-eslint/strict-type-checked
- @typescript-eslint/stylistic-type-checked
- unicorn/recommended
- jsdoc/recommended-typescript
- prettier
and applies a custom config.
Following configurations are provided
- @craftworks/eslint-config-typescript
- @craftworks/eslint-config-typescript/unsafe-typing Use on top of @craftworks/eslint-config-typescript; disables rules regarding
!
andany
which may be convenient for the developer if disabled, although they come with some degree of type safety reduction. - @craftworks/eslint-config-typescript/speed-up Use on top of @craftworks/eslint-config-typescript; disables some of the rules that run for relatively too long compared to the value they provide.
Installation
npm install @craftworks/eslint-config-typescript --save-dev
Check for necessary peer dependencies.
Usage
eslint.config.js
import eslintConfigTypescript from '@craftworks/eslint-config-typescript';
export default [
...eslintConfigTypescript,
{
languageOptions: {
globals: {
// Optional globals such as `...globals.browser`
},
parserOptions: {
project: ['./tsconfig.lint.json'],
},
},
rules: {
// Optional rule overwrites
},
},
];
Create a tsconfig.lint.json
for your TypeScript project that defines all the files that should be linted.
{
"extends": "./tsconfig.json",
"include": ["src"]
}
Install globals via npm install --save-dev globals
.
Note that only flat config is supported.
Peer Dependencies
eslint: ^9.0.0
@eslint/js: ^9.0.0
typescript: ^4.8.4 || ^5.0.0
typescript-eslint: ^8.0.0
The minimal node version is 18.18.0
.
See package.json for more details
Change Log
See CHANGELOG.md