Skip to content

Commit 5740b34

Browse files
authored
Merge pull request #49 from openlayers/dependabot/npm_and_yarn/eslint-config-openlayers-19.0.0
Bump eslint-config-openlayers from 17.0.0 to 19.0.0
2 parents 9e59e47 + c54b070 commit 5740b34

File tree

3 files changed

+258
-191
lines changed

3 files changed

+258
-191
lines changed

index.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ const addInherited = require('jsdoc/augment').addInherited; // eslint-disable-li
77
const config = env.conf.typescript;
88
if (!config) {
99
throw new Error(
10-
'Configuration "typescript" for jsdoc-plugin-typescript missing.'
10+
'Configuration "typescript" for jsdoc-plugin-typescript missing.',
1111
);
1212
}
1313
if (!('moduleRoot' in config)) {
1414
throw new Error(
15-
'Configuration "typescript.moduleRoot" for jsdoc-plugin-typescript missing.'
15+
'Configuration "typescript.moduleRoot" for jsdoc-plugin-typescript missing.',
1616
);
1717
}
1818
const moduleRoot = config.moduleRoot;
@@ -21,7 +21,7 @@ if (!fs.existsSync(moduleRootAbsolute)) {
2121
throw new Error(
2222
'Directory "' +
2323
moduleRootAbsolute +
24-
'" does not exist. Check the "typescript.moduleRoot" config option for jsdoc-plugin-typescript'
24+
'" does not exist. Check the "typescript.moduleRoot" config option for jsdoc-plugin-typescript',
2525
);
2626
}
2727

@@ -47,7 +47,7 @@ function getModuleInfo(moduleId, extension, parser) {
4747
const absolutePath = path.join(
4848
process.cwd(),
4949
moduleRoot,
50-
moduleId + extension
50+
moduleId + extension,
5151
);
5252
if (!fs.existsSync(absolutePath)) {
5353
return null;
@@ -135,7 +135,7 @@ exports.defineTags = function (dictionary) {
135135
}
136136
throw new Error("Missing closing '}'");
137137
};
138-
}
138+
},
139139
);
140140
};
141141

@@ -229,10 +229,10 @@ exports.astNodeVisitor = {
229229
if (
230230
leadingComments.length === 0 ||
231231
(leadingComments[leadingComments.length - 1].value.indexOf(
232-
'@classdesc'
232+
'@classdesc',
233233
) === -1 &&
234234
noClassdescRegEx.test(
235-
leadingComments[leadingComments.length - 1].value
235+
leadingComments[leadingComments.length - 1].value,
236236
))
237237
) {
238238
// Create a suitable comment node if we don't have one on the class yet
@@ -250,7 +250,7 @@ exports.astNodeVisitor = {
250250
if (node.superClass) {
251251
// Remove the `@extends` tag because JSDoc does not does not handle generic type. (`@extends {Base<Type>}`)
252252
const extendsIndex = lines.findIndex((line) =>
253-
line.includes('@extends')
253+
line.includes('@extends'),
254254
);
255255
if (extendsIndex !== -1) {
256256
lines.splice(extendsIndex, 1);
@@ -262,7 +262,7 @@ exports.astNodeVisitor = {
262262
if (identifier) {
263263
const absolutePath = path.resolve(
264264
path.dirname(currentSourceName),
265-
identifier.value
265+
identifier.value,
266266
);
267267
// default to js extension since .js extention is assumed implicitly
268268
const extension = getExtension(absolutePath);
@@ -295,7 +295,7 @@ exports.astNodeVisitor = {
295295
// Replace typeof Foo with Class<Foo>
296296
comment.value = comment.value.replace(
297297
/typeof ([^,\|\}\>]*)([,\|\}\>])/g,
298-
'Class<$1>$2'
298+
'Class<$1>$2',
299299
);
300300

301301
// Remove `@override` annotations to avoid JSDoc breaking the inheritance chain
@@ -323,7 +323,7 @@ exports.astNodeVisitor = {
323323
if (replaceAttempt > 100) {
324324
// infinite loop protection
325325
throw new Error(
326-
`Invalid docstring ${comment.value} in ${currentSourceName}.`
326+
`Invalid docstring ${comment.value} in ${currentSourceName}.`,
327327
);
328328
}
329329
} else {
@@ -332,7 +332,7 @@ exports.astNodeVisitor = {
332332
lastImportPath = importExpression;
333333
const rel = path.resolve(
334334
path.dirname(currentSourceName),
335-
importSource
335+
importSource,
336336
);
337337
// default to js extension since .js extention is assumed implicitly
338338
const extension = getExtension(rel);
@@ -356,7 +356,7 @@ exports.astNodeVisitor = {
356356
if (replacement) {
357357
comment.value = comment.value.replace(
358358
importExpression,
359-
replacement + remainder
359+
replacement + remainder,
360360
);
361361
}
362362
}
@@ -377,13 +377,13 @@ exports.astNodeVisitor = {
377377
Object.keys(identifiers).forEach((key) => {
378378
const eventRegex = new RegExp(
379379
`@(event |fires )${key}([^A-Za-z])`,
380-
'g'
380+
'g',
381381
);
382382
replace(eventRegex);
383383

384384
const typeRegex = new RegExp(
385385
`@(.*[{<|,(!?:]\\s*)${key}([^A-Za-z].*?\}|\})`,
386-
'g'
386+
'g',
387387
);
388388
replace(typeRegex);
389389

@@ -392,7 +392,7 @@ exports.astNodeVisitor = {
392392
const identifier = identifiers[key];
393393
const absolutePath = path.resolve(
394394
path.dirname(currentSourceName),
395-
identifier.value
395+
identifier.value,
396396
);
397397
// default to js extension since .js extention is assumed implicitly
398398
const extension = getExtension(absolutePath);
@@ -408,11 +408,11 @@ exports.astNodeVisitor = {
408408
: getDelimiter(moduleId, exportName, parser);
409409
const replacement = `module:${moduleId.replace(
410410
slashRegEx,
411-
'/'
411+
'/',
412412
)}${exportName ? delimiter + exportName : ''}`;
413413
comment.value = comment.value.replace(
414414
regex,
415-
'@$1' + replacement + '$2'
415+
'@$1' + replacement + '$2',
416416
);
417417
}
418418
}

0 commit comments

Comments
 (0)