Bump the npm group with 2 updates (#1819)

* Bump the npm group with 2 updates

Bumps the npm group with 2 updates: [eslint](https://github.com/eslint/eslint) and [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import).


Updates `eslint` from 8.45.0 to 8.46.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.45.0...v8.46.0)

Updates `eslint-plugin-import` from 2.27.5 to 2.28.0
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.27.5...v2.28.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update checked-in dependencies

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
dependabot[bot] 2023-08-01 03:35:02 -07:00 committed by GitHub
parent a6b0ced86b
commit e7e35baaf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1408 changed files with 27215 additions and 9910 deletions

View file

@ -1,4 +1,5 @@
'use strict';
exports.__esModule = true;
/**
@ -16,14 +17,14 @@ exports.default = function visitModules(visitor, options) {
let ignoreRegExps = [];
if (options.ignore != null) {
ignoreRegExps = options.ignore.map(p => new RegExp(p));
ignoreRegExps = options.ignore.map((p) => new RegExp(p));
}
function checkSourceValue(source, importer) {
if (source == null) return; //?
if (source == null) { return; } //?
// handle ignore
if (ignoreRegExps.some(re => re.test(source.value))) return;
if (ignoreRegExps.some((re) => re.test(source.value))) { return; }
// fire visitor
visitor(source, importer);
@ -41,14 +42,14 @@ exports.default = function visitModules(visitor, options) {
if (node.type === 'ImportExpression') {
modulePath = node.source;
} else if (node.type === 'CallExpression') {
if (node.callee.type !== 'Import') return;
if (node.arguments.length !== 1) return;
if (node.callee.type !== 'Import') { return; }
if (node.arguments.length !== 1) { return; }
modulePath = node.arguments[0];
}
if (modulePath.type !== 'Literal') return;
if (typeof modulePath.value !== 'string') return;
if (modulePath.type !== 'Literal') { return; }
if (typeof modulePath.value !== 'string') { return; }
checkSourceValue(modulePath, node);
}
@ -56,32 +57,35 @@ exports.default = function visitModules(visitor, options) {
// for CommonJS `require` calls
// adapted from @mctep: https://git.io/v4rAu
function checkCommon(call) {
if (call.callee.type !== 'Identifier') return;
if (call.callee.name !== 'require') return;
if (call.arguments.length !== 1) return;
if (call.callee.type !== 'Identifier') { return; }
if (call.callee.name !== 'require') { return; }
if (call.arguments.length !== 1) { return; }
const modulePath = call.arguments[0];
if (modulePath.type !== 'Literal') return;
if (typeof modulePath.value !== 'string') return;
if (modulePath.type !== 'Literal') { return; }
if (typeof modulePath.value !== 'string') { return; }
checkSourceValue(modulePath, call);
}
function checkAMD(call) {
if (call.callee.type !== 'Identifier') return;
if (call.callee.name !== 'require' &&
call.callee.name !== 'define') return;
if (call.arguments.length !== 2) return;
if (call.callee.type !== 'Identifier') { return; }
if (call.callee.name !== 'require' && call.callee.name !== 'define') { return; }
if (call.arguments.length !== 2) { return; }
const modules = call.arguments[0];
if (modules.type !== 'ArrayExpression') return;
if (modules.type !== 'ArrayExpression') { return; }
for (const element of modules.elements) {
if (element.type !== 'Literal') continue;
if (typeof element.value !== 'string') continue;
if (element.type !== 'Literal') { continue; }
if (typeof element.value !== 'string') { continue; }
if (element.value === 'require' ||
element.value === 'exports') continue; // magic modules: https://github.com/requirejs/requirejs/wiki/Differences-between-the-simplified-CommonJS-wrapper-and-standard-AMD-define#magic-modules
if (
element.value === 'require'
|| element.value === 'exports'
) {
continue; // magic modules: https://github.com/requirejs/requirejs/wiki/Differences-between-the-simplified-CommonJS-wrapper-and-standard-AMD-define#magic-modules
}
checkSourceValue(element, element);
}
@ -90,20 +94,20 @@ exports.default = function visitModules(visitor, options) {
const visitors = {};
if (options.esmodule) {
Object.assign(visitors, {
'ImportDeclaration': checkSource,
'ExportNamedDeclaration': checkSource,
'ExportAllDeclaration': checkSource,
'CallExpression': checkImportCall,
'ImportExpression': checkImportCall,
ImportDeclaration: checkSource,
ExportNamedDeclaration: checkSource,
ExportAllDeclaration: checkSource,
CallExpression: checkImportCall,
ImportExpression: checkImportCall,
});
}
if (options.commonjs || options.amd) {
const currentCallExpression = visitors['CallExpression'];
visitors['CallExpression'] = function (call) {
if (currentCallExpression) currentCallExpression(call);
if (options.commonjs) checkCommon(call);
if (options.amd) checkAMD(call);
const currentCallExpression = visitors.CallExpression;
visitors.CallExpression = function (call) {
if (currentCallExpression) { currentCallExpression(call); }
if (options.commonjs) { checkCommon(call); }
if (options.amd) { checkAMD(call); }
};
}
@ -116,19 +120,19 @@ exports.default = function visitModules(visitor, options) {
*/
function makeOptionsSchema(additionalProperties) {
const base = {
'type': 'object',
'properties': {
'commonjs': { 'type': 'boolean' },
'amd': { 'type': 'boolean' },
'esmodule': { 'type': 'boolean' },
'ignore': {
'type': 'array',
'minItems': 1,
'items': { 'type': 'string' },
'uniqueItems': true,
type: 'object',
properties: {
commonjs: { type: 'boolean' },
amd: { type: 'boolean' },
esmodule: { type: 'boolean' },
ignore: {
type: 'array',
minItems: 1,
items: { type: 'string' },
uniqueItems: true,
},
},
'additionalProperties': false,
additionalProperties: false,
};
if (additionalProperties) {