From d41573f12c856977906bf87fbdf4ce8e79316b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20LUDWIG?= Date: Tue, 29 Oct 2024 23:48:40 +0100 Subject: [PATCH] docs: eslint.config.js --- README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 864edc2..ce5ec54 100644 --- a/README.md +++ b/README.md @@ -59,15 +59,22 @@ Dependencies are: ### Configuration -#### `eslint.config.js` (JavaScript and TypeScript) +#### `eslint.config.js` ```js -// @ts-check - import typescriptESLint from "typescript-eslint" import configConventions from "eslint-config-conventions" -export default typescriptESLint.config(...configConventions) +export default typescriptESLint.config(...configConventions, { + files: ["**/*.ts", "**/*.tsx"], + languageOptions: { + parser: typescriptESLint.parser, + parserOptions: { + projectService: true, + tsconfigRootDir: import.meta.dirname, + }, + }, +}) ``` #### Configuration with [Prettier](https://prettier.io/) (recommended)