Skip to content

Enable the no-undefined-types rule #38

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

Closed
wants to merge 1 commit into from
Closed
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
19 changes: 19 additions & 0 deletions examples/base/mod.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,22 @@ export class Restaurant {
this.menu_ = [];
}
}

const ELEMENT_ARRAY_BUFFER = 0x8893;
const ARRAY_BUFFER = 0x8892;

/**
* Returns a typed array constructor based on the given buffer type
* @param {number} type Buffer type, either ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER.
* @return {Float32ArrayConstructor|Uint32ArrayConstructor} The typed array class to use for this buffer.
*/
export function getArrayClassForType(type) {
switch (type) {
case ARRAY_BUFFER:
return Float32Array;
case ELEMENT_ARRAY_BUFFER:
return Uint32Array;
default:
return Float32Array;
}
}
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ module.exports = {
'jsdoc/empty-tags': 'error',
'jsdoc/implements-on-classes': 'error',
'jsdoc/no-bad-blocks': 'error',
// 'jsdoc/no-undefined-types': ['error', {'definedTypes': ['ol']}], // blocked by https://github.com/gajus/eslint-plugin-jsdoc/issues/887
'jsdoc/no-undefined-types': [
'error',
{
'definedTypes': ['Float32ArrayConstructor', 'Uint32ArrayConstructor'],
},
],
'jsdoc/require-hyphen-before-param-description': ['error', 'never'],
'jsdoc/require-param': 'error',
'jsdoc/require-param-description': 'error',
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"dependencies": {
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.1",
"eslint-plugin-jsdoc": "^39.3.0",
"eslint-plugin-jsdoc": "^39.3.2",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-sort-imports-es6-autofix": "^0.6.0",
"prettier": "^2.4.1"
Expand Down