Use `fileURLToPath` for eslint (#230734)

pull/230743/head
Matt Bierner 2024-10-07 12:13:41 -07:00 committed by GitHub
parent ab554de6ca
commit 71f16d9c13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@
import fs from 'fs';
import path from 'path';
import tseslint from 'typescript-eslint';
import { fileURLToPath } from 'url';
import stylisticTs from '@stylistic/eslint-plugin-ts';
import pluginLocal from 'eslint-plugin-local';
@ -14,7 +15,7 @@ import pluginJsdoc from 'eslint-plugin-jsdoc';
import pluginHeader from 'eslint-plugin-header';
pluginHeader.rules.header.meta.schema = false;
const __dirname = path.dirname(new URL(import.meta.url).pathname);
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const ignores = fs.readFileSync(path.join(__dirname, '.eslint-ignore'), 'utf8')
.toString()
.split(/\r\n|\n/)