https://github.com/uvarovag/eslint-config-ts
https://github.com/uvarovag/eslint-config-ts
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/uvarovag/eslint-config-ts
- Owner: uvarovag
- Created: 2024-12-10T15:07:54.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2025-02-03T17:36:44.000Z (4 months ago)
- Last Synced: 2025-02-03T18:43:01.325Z (4 months ago)
- Language: JavaScript
- Size: 97.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# eslint-config-ts
Shared ESLint 9 Flat configuration for TypeScript projects.
## Installation
To use this configuration in your project, install the required dependencies:
```bash
npm install --save-dev @uvarovag/eslint-config-ts eslint@^9.16.0
```## Usage
### Step 1: Create a `eslint.config.mjs` file
```js
import tsConfig from '@uvarovag/eslint-config-ts'export default [...tsConfig]
```### Step 2: Run ESLint
```bash
npx eslint '**/*.{ts,tsx}' --fix
```## Use together with Prettier
## Installation
To use this configuration in your project, install the necessary dependencies:
```bash
npm install --save-dev @uvarovag/prettier-config prettier
```### Step 1: Create a `.prettierrc` file
```json
"@uvarovag/prettier-config"
```### Step 2: Format your code
```bash
npx prettier --write '**/*.{ts,tsx,js,json,css,html,md}'
```## Use Prettier and ESLint in Visual Studio Code
### Step 1: Install Plugins
- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)### Step 2: Add the following to settings.json in VSCode
```json
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.requireConfig": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"eslint.experimental.useFlatConfig": true
}
```