From 9e8fedc9df63cb3424ad4e17ca655cc819590d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=20G=C3=B3mez?= Date: Fri, 30 Aug 2024 18:18:23 +0200 Subject: [PATCH] docs: improve readme with auto ts config search --- README.md | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 4265a04..7fa1028 100644 --- a/README.md +++ b/README.md @@ -31,17 +31,19 @@ ```bash npm install --save-dev eslint-config-codely ``` -2. Add it to your `eslint.config.js` file. +2. Add it to your `eslint.config.js`: -For JavaScript: ```js import eslintConfigCodely from "eslint-config-codely"; export default [ - ...eslintConfigCodely.js, - { - // Your config here - } + // If you're using js + ...eslintConfigCodely.js, + // Or if you're using ts. The ts config includes the js one, so you don't need to include it manually. + ...eslintConfigCodely.ts, + { + // Your config here + } ] ``` @@ -50,17 +52,17 @@ For TypeScript: import eslintConfigCodely from "eslint-config-codely"; export default [ - ...eslintConfigCodely.ts, - { - // You should add the path to your tsconfig - files: ["**/*.ts", "**/*.tsx"], - languageOptions: { - parserOptions: { - project: ["./tsconfig.json"], - }, - } - // Your config here - } + ...eslintConfigCodely.ts, + { + // You should add the path to your tsconfig + files: ["**/*.ts", "**/*.tsx"], + languageOptions: { + parserOptions: { + project: ["./tsconfig.json"], + }, + } + // Your config here + } ] ```