From a578bb80ba381e7b6f8204d7c225e6bd5d8428d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20LUDWIG?= Date: Tue, 8 Oct 2024 08:10:28 +0200 Subject: [PATCH] docs: add `// @ts-check` to config example --- README.md | 12 +++++++----- eslint.config.js | 2 ++ eslint.config.mjs | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 004b5f4..864edc2 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,8 @@ npm install --save-dev \ eslint-plugin-unicorn@^56.0.0 \ eslint-plugin-import-x@^4.3.1 \ globals@^15.10.0 \ - "typescript@~5.5.4" \ - "typescript-eslint@^8.8.0" \ + typescript@~5.5.4 \ + typescript-eslint@^8.8.0 \ eslint-config-conventions@latest ``` @@ -62,10 +62,12 @@ Dependencies are: #### `eslint.config.js` (JavaScript and TypeScript) ```js -import typescriptESLint from "typescript-eslint" -import eslintConfigConventions from "eslint-config-conventions" +// @ts-check -export default typescriptESLint.config(...eslintConfigConventions) +import typescriptESLint from "typescript-eslint" +import configConventions from "eslint-config-conventions" + +export default typescriptESLint.config(...configConventions) ``` #### Configuration with [Prettier](https://prettier.io/) (recommended) diff --git a/eslint.config.js b/eslint.config.js index 9c37760..903f8e2 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,3 +1,5 @@ +// @ts-check + import promise from "eslint-plugin-promise" import unicorn from "eslint-plugin-unicorn" import importX from "eslint-plugin-import-x" diff --git a/eslint.config.mjs b/eslint.config.mjs index bed9617..ea8e4c4 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,8 +1,8 @@ // @ts-check import typescriptESLint from "typescript-eslint" -import eslintConfigConventions from "./eslint.config.js" +import configConventions from "./eslint.config.js" -export default typescriptESLint.config(...eslintConfigConventions, { +export default typescriptESLint.config(...configConventions, { ignores: ["test/fixtures/*"], })