@averay/codeformat 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -5,6 +5,7 @@ import typescriptParser from '@typescript-eslint/parser';
5
5
  import prettierConfig from 'eslint-config-prettier';
6
6
  import eslintCommentsPlugin from 'eslint-plugin-eslint-comments';
7
7
  import importPlugin from 'eslint-plugin-import';
8
+ import jsdocPlugin from 'eslint-plugin-jsdoc';
8
9
  import promisePlugin from 'eslint-plugin-promise';
9
10
  import regexpPlugin from 'eslint-plugin-regexp';
10
11
  import sonarjsPlugin from 'eslint-plugin-sonarjs';
@@ -21,6 +22,10 @@ export const extensions = {
21
22
  ts: ['ts', 'tsx', 'cts', 'cts', 'mts', 'mtsx'],
22
23
  };
23
24
 
25
+ /**
26
+ * @param {{ tsconfigPath?: string }} options Project-specific customisations
27
+ * @returns {object[]} The complete ESLint config
28
+ */
24
29
  export function makeEslintConfig(options = {}) {
25
30
  return [
26
31
  // JavaScript & TypeScript
@@ -34,6 +39,7 @@ export function makeEslintConfig(options = {}) {
34
39
  plugins: {
35
40
  'eslint-comments': eslintCommentsPlugin,
36
41
  import: importPlugin,
42
+ jsdoc: jsdocPlugin,
37
43
  promise: promisePlugin,
38
44
  regexp: regexpPlugin,
39
45
  sonarjs: sonarjsPlugin,
@@ -52,7 +58,7 @@ export function makeEslintConfig(options = {}) {
52
58
  files: [`**/*.{${extensions.ts.join(',')}}`],
53
59
  languageOptions: {
54
60
  parser: typescriptParser,
55
- parserOptions: { project: options.tsconfigPath },
61
+ parserOptions: options.tsconfigPath == null ? {} : { project: options.tsconfigPath },
56
62
  },
57
63
  plugins: {
58
64
  '@typescript-eslint': typescriptPlugin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@averay/codeformat",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "author": "Adam Averay (https://adamaveray.com.au/)",
5
5
  "homepage": "https://github.com/adamaveray/codeformat",
6
6
  "repository": {
@@ -39,6 +39,7 @@
39
39
  "eslint-config-prettier": "^8.7.0",
40
40
  "eslint-plugin-eslint-comments": "^3.2.0",
41
41
  "eslint-plugin-import": "^2.27.5",
42
+ "eslint-plugin-jsdoc": "^40.0.1",
42
43
  "eslint-plugin-promise": "^6.1.1",
43
44
  "eslint-plugin-regexp": "^1.12.0",
44
45
  "eslint-plugin-sonarjs": "^0.18.0",
@@ -2,6 +2,7 @@
2
2
 
3
3
  import eslintCommentsPlugin from 'eslint-plugin-eslint-comments';
4
4
  import importPlugin from 'eslint-plugin-import';
5
+ import jsdocPlugin from 'eslint-plugin-jsdoc';
5
6
  import promisePlugin from 'eslint-plugin-promise';
6
7
  import regexpPlugin from 'eslint-plugin-regexp';
7
8
  import sonarjsPlugin from 'eslint-plugin-sonarjs';
@@ -258,6 +259,17 @@ export default {
258
259
  ],
259
260
  'import/prefer-default-export': 'error',
260
261
 
262
+ ...jsdocPlugin.configs.recommended.rules,
263
+ 'jsdoc/check-indentation': 'error',
264
+ 'jsdoc/check-syntax': 'error',
265
+ 'jsdoc/match-description': ['error', { matchDescription: '[A-Z]', tags: { param: true, returns: true } }],
266
+ 'jsdoc/no-bad-blocks': 'error',
267
+ 'jsdoc/no-defaults': 'error',
268
+ 'jsdoc/require-asterisk-prefix': 'error',
269
+ 'jsdoc/require-jsdoc': 'off',
270
+ 'jsdoc/require-returns': 'off',
271
+ 'jsdoc/sort-tags': 'error',
272
+
261
273
  ...promisePlugin.configs.recommended.rules,
262
274
  'promise/no-multiple-resolved': 'error',
263
275
 
@@ -219,4 +219,8 @@ export default {
219
219
  '@typescript-eslint/triple-slash-reference': 'error',
220
220
  '@typescript-eslint/unbound-method': 'off', // Does not support @autobind nor recognise binding in constructors
221
221
  '@typescript-eslint/unified-signatures': 'error',
222
+
223
+ 'jsdoc/no-types': 'error',
224
+ 'jsdoc/require-param-type': 'off',
225
+ 'jsdoc/require-returns-type': 'off',
222
226
  };