From cead805d6cbac9624be03dd38b16743127d5d9c8 Mon Sep 17 00:00:00 2001 From: Jack Kelly Date: Wed, 4 Dec 2024 14:34:18 +0000 Subject: [PATCH] chore(experimental): make eslint respect .gitignore --- .../license-inventory/eslint.config.mjs | 9 +++++++++ .../license-inventory/package-lock.json | 19 +++++++++++++++++++ experimental/license-inventory/package.json | 1 + 3 files changed, 29 insertions(+) diff --git a/experimental/license-inventory/eslint.config.mjs b/experimental/license-inventory/eslint.config.mjs index 757cffd7..9524c8bc 100644 --- a/experimental/license-inventory/eslint.config.mjs +++ b/experimental/license-inventory/eslint.config.mjs @@ -1,9 +1,18 @@ import globals from 'globals'; import pluginJs from '@eslint/js'; import tseslint from 'typescript-eslint'; +import { includeIgnoreFile } from '@eslint/compat'; + +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const gitignorePath = path.resolve(__dirname, '.gitignore'); /** @type {import('eslint').Linter.Config[]} */ export default [ + includeIgnoreFile(gitignorePath), { files: ['**/*.{js,mjs,cjs,ts}'] }, { languageOptions: { globals: globals.node } }, pluginJs.configs.recommended, diff --git a/experimental/license-inventory/package-lock.json b/experimental/license-inventory/package-lock.json index 8979af51..23738725 100644 --- a/experimental/license-inventory/package-lock.json +++ b/experimental/license-inventory/package-lock.json @@ -23,6 +23,7 @@ "zod": "^3.23.8" }, "devDependencies": { + "@eslint/compat": "^1.2.3", "@eslint/js": "^9.15.0", "@jest/globals": "^29.7.0", "@swc/cli": "^0.5.1", @@ -652,6 +653,24 @@ "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@eslint/compat": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-1.2.3.tgz", + "integrity": "sha512-wlZhwlDFxkxIZ571aH0FoK4h4Vwx7P3HJx62Gp8hTc10bfpwT2x0nULuAHmQSJBOWPgPeVf+9YtnD4j50zVHmA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": "^9.10.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, "node_modules/@eslint/config-array": { "version": "0.19.0", "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.0.tgz", diff --git a/experimental/license-inventory/package.json b/experimental/license-inventory/package.json index 162d72c1..f0560339 100644 --- a/experimental/license-inventory/package.json +++ b/experimental/license-inventory/package.json @@ -26,6 +26,7 @@ "zod": "^3.23.8" }, "devDependencies": { + "@eslint/compat": "^1.2.3", "@eslint/js": "^9.15.0", "@jest/globals": "^29.7.0", "@swc/cli": "^0.5.1",