Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
edg2s committed May 16, 2024
1 parent de74730 commit e67655d
Show file tree
Hide file tree
Showing 13 changed files with 1,274 additions and 523 deletions.
1,767 changes: 1,252 additions & 515 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"dependencies": {
"chalk": "^4.1.2",
"ejs": "^3.1.9",
"ejs": "^3.1.10",
"eslint": ">=8.0.0",
"import-fresh": "^3.3.0",
"jsonschema": "^1.4.1",
Expand All @@ -36,9 +36,9 @@
"upath": "^2.0.1"
},
"devDependencies": {
"eslint-config-wikimedia": "^0.25.1",
"eslint-config-wikimedia": "^0.27.0",
"eslint-plugin-node": "^11.1.0",
"mocha": "^10.2.0",
"mocha": "^10.4.0",
"nyc": "^15.1.0"
}
}
1 change: 1 addition & 0 deletions src/build-docs-from-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ async function buildDocsFromTests(
const fs = require( 'fs' );
const packagePath = require( './package-path' );
const ruleTemplatePath = packagePath( config.ruleTemplatePath.replace( '{name}', name ) );
// eslint-disable-next-line security/detect-non-literal-fs-filename
if ( fs.existsSync( ruleTemplatePath ) ) {
index = loadRuleTemplate( ruleTemplatePath );
}
Expand Down
1 change: 1 addition & 0 deletions src/default-config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const packagePath = require( './package-path' );
// eslint-disable-next-line security/detect-non-literal-require
const packageName = require( packagePath( './package' ) ).name;
const naming = require( './naming' );
const pluginName = naming.getShorthandName( packageName, 'eslint-plugin' );
Expand Down
1 change: 1 addition & 0 deletions src/fix.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ async function lintFix( code, testerConfig ) {
// TODO
// istanbul ignore next
if ( typeof mergedConfig.parser === 'string' ) {
// eslint-disable-next-line security/detect-non-literal-require
linter.defineParser( mergedConfig.parser, require( mergedConfig.parser ) );
}

Expand Down
1 change: 1 addition & 0 deletions src/get-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function getConfig() {
configFilenames.some( ( configFilename ) => {
configPath = packagePath( configFilename );

// eslint-disable-next-line security/detect-non-literal-fs-filename
if ( fs.existsSync( configPath ) ) {
config = importFresh( configPath );
return true;
Expand Down
3 changes: 3 additions & 0 deletions src/load-templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ const path = require( 'upath' );
const ejs = require( 'ejs' );

function loadTemplatesFromPath( dirPath ) {
// eslint-disable-next-line security/detect-non-literal-fs-filename
const files = fs.readdirSync( dirPath );
const templates = {};
files.forEach( ( filename ) => {
templates[ path.parse( filename ).name ] =
// eslint-disable-next-line security/detect-non-literal-fs-filename
fs.readFileSync( path.join( dirPath, filename ) ).toString();
} );
return templates;
Expand Down Expand Up @@ -47,6 +49,7 @@ function loadTemplates( dirPaths ) {

function loadRuleTemplate( ruleTemplatePath ) {
return compile(
// eslint-disable-next-line security/detect-non-literal-fs-filename
fs.readFileSync( ruleTemplatePath ).toString()
);
}
Expand Down
1 change: 1 addition & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const packagePath = require( './package-path' );
// eslint-disable-next-line security/detect-non-literal-require
const main = require( packagePath( './package' ) ).main || 'index.js';

module.exports = packagePath( main );
10 changes: 6 additions & 4 deletions src/naming.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@
*/
function getShorthandName( fullname, prefix ) {
if ( fullname[ 0 ] === '@' ) {
let matchResult = new RegExp( `^(@[^/]+)/${prefix}$`, 'u' ).exec( fullname );
// eslint-disable-next-line security/detect-non-literal-regexp
let matchResult = new RegExp( `^(@[^/]+)/${ prefix }$`, 'u' ).exec( fullname );

if ( matchResult ) {
return matchResult[ 1 ];
}

matchResult = new RegExp( `^(@[^/]+)/${prefix}-(.+)$`, 'u' ).exec( fullname );
// eslint-disable-next-line security/detect-non-literal-regexp
matchResult = new RegExp( `^(@[^/]+)/${ prefix }-(.+)$`, 'u' ).exec( fullname );
if ( matchResult ) {
return `${matchResult[ 1 ]}/${matchResult[ 2 ]}`;
return `${ matchResult[ 1 ] }/${ matchResult[ 2 ] }`;
}
} else if ( fullname.startsWith( `${prefix}-` ) ) {
} else if ( fullname.startsWith( `${ prefix }-` ) ) {
return fullname.slice( prefix.length + 1 );
}

Expand Down
1 change: 1 addition & 0 deletions src/rule-tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const packagePath = require( './package-path' );
// Use plugin's version of ESLint
// eslint-disable-next-line security/detect-non-literal-require
const ESLintRuleTester = require( packagePath( 'node_modules/eslint' ) ).RuleTester;
const inDocMode = !!process.env.DOCGEN;

Expand Down
1 change: 1 addition & 0 deletions src/rules-with-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

// eslint-disable-next-line security/detect-non-literal-require
const main = require( require( './main' ) );
const pluginName = require( './get-config' )().config.pluginName;
const configs = main.configs;
Expand Down
1 change: 1 addition & 0 deletions src/write-docs-from-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ async function writeDocsFromTests( name, rule, tests, testerConfig, done ) {

const outputDir = path.dirname( outputPath );
mkdirp( outputDir ).then( () => {
// eslint-disable-next-line security/detect-non-literal-fs-filename
fs.writeFile(
outputPath,
output,
Expand Down
3 changes: 2 additions & 1 deletion tests/build-docs-from-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function makeVueFileContent( scriptContents ) {
<p>Placeholder...</p>
</template>
<script>
${scriptContents}
${ scriptContents }
</script>`;
}

Expand Down Expand Up @@ -442,6 +442,7 @@ describe( 'buildDocsFromTests', () => {
defaultConfig.testPath = 'tests/{name}.js';

function loadCase( filename ) {
// eslint-disable-next-line security/detect-non-literal-fs-filename
return fs.readFileSync( path.join( __dirname, filename ) ).toString();
}

Expand Down

0 comments on commit e67655d

Please sign in to comment.