Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to eslint 9 #40555

Merged
merged 9 commits into from
Dec 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions tools/js-tools/load-eslint-ignore.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const fs = require( 'fs' );
const path = require( 'path' );
const debugload = require( 'debug' )( 'load-eslint-ignore:load' );
const debugrp = require( 'debug' )( 'load-eslint-ignore:reverse-prefix' );
const debugrp = require( 'debug' )( 'load-eslint-ignore:rule-process' );
tbradsha marked this conversation as resolved.
Show resolved Hide resolved
const debugrules = require( 'debug' )( 'load-eslint-ignore:rules' );
const makeIgnore = require( 'ignore' );

Expand Down Expand Up @@ -42,9 +42,12 @@ function loadIgnorePatterns( basedir ) {
reverseRulesPrefix = reverseRulesPrefixStr.split( '/' ).map( p => p + '/' );
if ( reverseRulesPrefix[ 0 ] === '../' ) {
reverseRulesPrefix = null;
debugrp( `No rulesPrefix or reverseRulesPrefix?` );
} else {
debugrp( `Checking reverse-prefix match on ${ reverseRulesPrefixStr }` );
}
} else {
debugrp( `Using rulesPrefix ${ rulesPrefix }` );
}

fs.readFileSync( file, { encoding: 'utf8' } )
Expand Down Expand Up @@ -72,7 +75,9 @@ function loadIgnorePatterns( basedir ) {

ignore.add( n + ignorePrefix + b );
if ( rulesPrefix ) {
rules.push( n + rulesPrefix + b );
const rule = ( rulesPrefix + b ).replace( /^\/+/, '' );
debugrp( ` Accepted ${ l } as ${ n + rule }` );
rules.push( n + rule );
}
if ( reverseRulesPrefix ) {
for ( const part of reverseRulesPrefix ) {
Expand All @@ -98,8 +103,9 @@ function loadIgnorePatterns( basedir ) {
}
}
if ( b ) {
debugrp( ` Accepted ${ l } as ${ n + '/' + b }` );
rules.push( n + '/' + b );
const rule = b.replace( /^\/+/, '' );
debugrp( ` Accepted ${ l } as ${ n + rule }` );
rules.push( n + rule );
tbradsha marked this conversation as resolved.
Show resolved Hide resolved
} else {
debugrp( ` Rejected ${ l }` );
}
Expand Down