Skip to content

Bump eslint-config-openlayers from 17.0.0 to 19.0.0 #49

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
36 changes: 18 additions & 18 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ const addInherited = require('jsdoc/augment').addInherited; // eslint-disable-li
const config = env.conf.typescript;
if (!config) {
throw new Error(
'Configuration "typescript" for jsdoc-plugin-typescript missing.'
'Configuration "typescript" for jsdoc-plugin-typescript missing.',
);
}
if (!('moduleRoot' in config)) {
throw new Error(
'Configuration "typescript.moduleRoot" for jsdoc-plugin-typescript missing.'
'Configuration "typescript.moduleRoot" for jsdoc-plugin-typescript missing.',
);
}
const moduleRoot = config.moduleRoot;
Expand All @@ -21,7 +21,7 @@ if (!fs.existsSync(moduleRootAbsolute)) {
throw new Error(
'Directory "' +
moduleRootAbsolute +
'" does not exist. Check the "typescript.moduleRoot" config option for jsdoc-plugin-typescript'
'" does not exist. Check the "typescript.moduleRoot" config option for jsdoc-plugin-typescript',
);
}

Expand All @@ -47,7 +47,7 @@ function getModuleInfo(moduleId, extension, parser) {
const absolutePath = path.join(
process.cwd(),
moduleRoot,
moduleId + extension
moduleId + extension,
);
if (!fs.existsSync(absolutePath)) {
return null;
Expand Down Expand Up @@ -135,7 +135,7 @@ exports.defineTags = function (dictionary) {
}
throw new Error("Missing closing '}'");
};
}
},
);
};

Expand Down Expand Up @@ -229,10 +229,10 @@ exports.astNodeVisitor = {
if (
leadingComments.length === 0 ||
(leadingComments[leadingComments.length - 1].value.indexOf(
'@classdesc'
'@classdesc',
) === -1 &&
noClassdescRegEx.test(
leadingComments[leadingComments.length - 1].value
leadingComments[leadingComments.length - 1].value,
))
) {
// Create a suitable comment node if we don't have one on the class yet
Expand All @@ -250,7 +250,7 @@ exports.astNodeVisitor = {
if (node.superClass) {
// Remove the `@extends` tag because JSDoc does not does not handle generic type. (`@extends {Base<Type>}`)
const extendsIndex = lines.findIndex((line) =>
line.includes('@extends')
line.includes('@extends'),
);
if (extendsIndex !== -1) {
lines.splice(extendsIndex, 1);
Expand All @@ -262,7 +262,7 @@ exports.astNodeVisitor = {
if (identifier) {
const absolutePath = path.resolve(
path.dirname(currentSourceName),
identifier.value
identifier.value,
);
// default to js extension since .js extention is assumed implicitly
const extension = getExtension(absolutePath);
Expand Down Expand Up @@ -295,7 +295,7 @@ exports.astNodeVisitor = {
// Replace typeof Foo with Class<Foo>
comment.value = comment.value.replace(
/typeof ([^,\|\}\>]*)([,\|\}\>])/g,
'Class<$1>$2'
'Class<$1>$2',
);

// Remove `@override` annotations to avoid JSDoc breaking the inheritance chain
Expand Down Expand Up @@ -323,7 +323,7 @@ exports.astNodeVisitor = {
if (replaceAttempt > 100) {
// infinite loop protection
throw new Error(
`Invalid docstring ${comment.value} in ${currentSourceName}.`
`Invalid docstring ${comment.value} in ${currentSourceName}.`,
);
}
} else {
Expand All @@ -332,7 +332,7 @@ exports.astNodeVisitor = {
lastImportPath = importExpression;
const rel = path.resolve(
path.dirname(currentSourceName),
importSource
importSource,
);
// default to js extension since .js extention is assumed implicitly
const extension = getExtension(rel);
Expand All @@ -356,7 +356,7 @@ exports.astNodeVisitor = {
if (replacement) {
comment.value = comment.value.replace(
importExpression,
replacement + remainder
replacement + remainder,
);
}
}
Expand All @@ -377,13 +377,13 @@ exports.astNodeVisitor = {
Object.keys(identifiers).forEach((key) => {
const eventRegex = new RegExp(
`@(event |fires )${key}([^A-Za-z])`,
'g'
'g',
);
replace(eventRegex);

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

Expand All @@ -392,7 +392,7 @@ exports.astNodeVisitor = {
const identifier = identifiers[key];
const absolutePath = path.resolve(
path.dirname(currentSourceName),
identifier.value
identifier.value,
);
// default to js extension since .js extention is assumed implicitly
const extension = getExtension(absolutePath);
Expand All @@ -408,11 +408,11 @@ exports.astNodeVisitor = {
: getDelimiter(moduleId, exportName, parser);
const replacement = `module:${moduleId.replace(
slashRegEx,
'/'
'/',
)}${exportName ? delimiter + exportName : ''}`;
comment.value = comment.value.replace(
regex,
'@$1' + replacement + '$2'
'@$1' + replacement + '$2',
);
}
}
Expand Down
Loading
Loading