Skip to content
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

Add JSDoc lint rules to follow style guide #48

Merged
merged 3 commits into from
Sep 27, 2023
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
68 changes: 52 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @file .eslintrc.js - ESLint configuration file, following Distributive's
* JS Style Guide.
*
* @author Wes Garland <[email protected]>
* @date Mar. 2022
*/

'use strict';

/**
Expand All @@ -12,20 +20,17 @@ module.exports = {
},
'extends': 'eslint:recommended',
'parserOptions': {
'ecmaVersion': 13,
'ecmaVersion': 'latest',
'sourceType': 'script',
},
globals: {
dcpConfig: true
},
'plugins': [
'@distributive'
'@distributive',
'jsdoc',
],
'rules': {
'indent': [
'warn',
2,
{
2, {
'SwitchCase': 1,
'ignoredNodes': ['CallExpression', 'ForStatement']
}
Expand Down Expand Up @@ -53,9 +58,6 @@ module.exports = {
'no-multi-spaces': [
'off',
],
'prettier/prettier': [
'off',
],
'vars-on-top': [
'error',
],
Expand All @@ -65,9 +67,6 @@ module.exports = {
'spaced-comment': [
'warn',
],
'brace-style': [
'off',
],
'no-eval': [
'error',
],
Expand Down Expand Up @@ -119,6 +118,43 @@ module.exports = {
allow: ['!!'] /* really only want to allow if(x) and if(!x) but not if(!!x) */
}],
'strict': [ 'error', 'safe' ],
'@distributive/brace-style': 'warn'
}
}
'brace-style': 'off',
'@distributive/brace-style': 'warn',
'jsdoc/require-file-overview': [
'error', {
tags: {
file: {
initialCommentsOnly: true,
mustExist: true,
preventDuplicates: true,
},
author: {
mustExist: true,
},
date: {
mustExist: true,
preventDuplicates: true,
},
},
},
],
'jsdoc/require-jsdoc': [
'error', {
publicOnly: true,
require: {
ArrowFunctionExpression: true,
ClassDeclaration: true,
ClassExpression: true,
FunctionDeclaration: true,
FunctionExpression: true,
MethodDefinition: true,
},
},
],
'jsdoc/require-description': [
'error', {
exemptedBy: ['type', 'typedef'],
},
],
},
};
149 changes: 148 additions & 1 deletion package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"scripts": {},
"peerDependencies": {
"@distributive/eslint-plugin": "^1.0.0",
"eslint": ">=8"
"eslint": ">=8",
"eslint-plugin-jsdoc": ">=46"
},
"engines": {
"node": ">=18",
Expand Down