https://github.com/kristijorgji/eslint-config-typescript
https://github.com/kristijorgji/eslint-config-typescript
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kristijorgji/eslint-config-typescript
- Owner: kristijorgji
- License: mit
- Created: 2022-06-17T14:25:26.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-09T16:25:35.000Z (over 3 years ago)
- Last Synced: 2025-01-19T22:14:18.025Z (10 months ago)
- Language: JavaScript
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @kristijorgji/eslint-config-typescript
A general-purpose ESLint and Prettier configuration for TypeScript projects (non-browser environments).
If you need rules specific to React, Next.js, or other frameworks, you can extend or override these rules after including this config.
# Table of Contents
- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
- [Configuration](#configuration)
- [Development](#development)
- [License](#license)
## Requirements
- ESLint version **>= 8.21.0** with support for Flat Config.
## Installation
Install the package and peer dependencies using:
```bash
yarn add --dev @kristijorgji/eslint-config-typescript@latest
```
> **Note:**
> When migrating from an older ESLint setup, please remove conflicting or duplicate dependencies first, for example:
> `yarn remove eslint prettier @typescript-eslint/eslint-plugin`
## Usage
### Configuration
For ESLint **>= 9.x**, use `FlatCompat.extends` for compatibility.
Example `eslint.config.js`:
```js
const { FlatCompat } = require('@eslint/eslintrc');
const js = require('@eslint/js');
const { defineConfig } = require('eslint/config');
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
module.exports = defineConfig([
{
files: ['src/**/*.ts', '__tests__/**/*.ts'],
extends: compat.extends('@kristijorgji/eslint-config-typescript'),
},
]);
```
## Development
Learn more about creating custom ESLint configs here:
[ESLint Shareable Configs Guide](https://eslint.org/docs/developer-guide/shareable-configs)
To develop locally, you can link your local package using:
```bash
yarn add --dev /path/to/local/eslint-config-typescript
```
> You need to run this command after every change to your local plugin.
## License
[MIT](LICENSE)