Skip to content

Commit cead805

Browse files
committed
chore(experimental): make eslint respect .gitignore
1 parent 309b522 commit cead805

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

experimental/license-inventory/eslint.config.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
import globals from 'globals';
22
import pluginJs from '@eslint/js';
33
import tseslint from 'typescript-eslint';
4+
import { includeIgnoreFile } from '@eslint/compat';
5+
6+
import path from 'node:path';
7+
import { fileURLToPath } from 'node:url';
8+
9+
const __filename = fileURLToPath(import.meta.url);
10+
const __dirname = path.dirname(__filename);
11+
const gitignorePath = path.resolve(__dirname, '.gitignore');
412

513
/** @type {import('eslint').Linter.Config[]} */
614
export default [
15+
includeIgnoreFile(gitignorePath),
716
{ files: ['**/*.{js,mjs,cjs,ts}'] },
817
{ languageOptions: { globals: globals.node } },
918
pluginJs.configs.recommended,

experimental/license-inventory/package-lock.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

experimental/license-inventory/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"zod": "^3.23.8"
2727
},
2828
"devDependencies": {
29+
"@eslint/compat": "^1.2.3",
2930
"@eslint/js": "^9.15.0",
3031
"@jest/globals": "^29.7.0",
3132
"@swc/cli": "^0.5.1",

0 commit comments

Comments
 (0)