Skip to content

Commit 09d9df0

Browse files
committed
chore: linting
1 parent 74ca17d commit 09d9df0

File tree

4 files changed

+23
-9
lines changed

4 files changed

+23
-9
lines changed

eslint.config.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import {
44
import {
55
recommended as canonical,
66
} from 'eslint-config-canonical/canonical';
7-
import {
8-
recommended as canonicalJsdoc,
9-
} from 'eslint-config-canonical/jsdoc';
7+
// import {
8+
// recommended as canonicalJsdoc,
9+
// } from 'eslint-config-canonical/jsdoc';
1010
import globals from 'globals';
1111

1212
const common = {
@@ -18,7 +18,10 @@ const common = {
1818

1919
export default [
2020
...canonical,
21-
...canonicalJsdoc,
21+
// ...canonicalJsdoc,
22+
jsdoc({
23+
config: 'flat/recommended',
24+
}),
2225
...jsdoc({
2326
config: 'examples-and-default-expressions',
2427
}),
@@ -43,6 +46,9 @@ export default [
4346
'filenames/match-regex': 0,
4447
'import/extensions': 0,
4548
'import/no-useless-path-segments': 0,
49+
'jsdoc/require-param-description': 0,
50+
'jsdoc/require-returns': 0,
51+
'jsdoc/require-returns-description': 0,
4652
'linebreak-style': 0,
4753
'no-inline-comments': 0,
4854
'prefer-named-capture-group': 0,

src/getJsdocProcessorPlugin.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ const getLinesCols = (text) => {
8383
/**
8484
* @typedef {number} Integer
8585
*/
86-
8786
/**
8887
* @typedef {object} JsdocProcessorOptions
8988
* @property {boolean} [captionRequired] Require captions for example tags
@@ -110,6 +109,13 @@ const getLinesCols = (text) => {
110109
* @returns {ESLint.Plugin}
111110
*/
112111
export const getJsdocProcessorPlugin = (options = {}) => {
112+
/**
113+
* @typedef {{
114+
* text: string,
115+
* filename: string|null|undefined
116+
* }} TextAndFileName
117+
*/
118+
113119
const {
114120
allowedLanguagesToProcess = [
115121
'js', 'ts', 'javascript', 'typescript',
@@ -169,10 +175,7 @@ export const getJsdocProcessorPlugin = (options = {}) => {
169175
*/
170176
const getTextsAndFileNames = (jsdoc, jsFileName, commentLineCols) => {
171177
/**
172-
* @type {{
173-
* text: string,
174-
* filename: string|null|undefined
175-
* }[]}
178+
* @type {TextAndFileName[]}
176179
*/
177180
const textsAndFileNames = [];
178181

@@ -666,6 +669,7 @@ export const getJsdocProcessorPlugin = (options = {}) => {
666669
);
667670
}).filter(
668671
/**
672+
* @param {TextAndFileName} file
669673
* @returns {file is Linter.ProcessorFile}
670674
*/
671675
(file) => {

test/iterateJsdoc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ import {
77
expect,
88
} from 'chai';
99

10+
/* eslint-disable jsdoc/reject-any-type -- Deliberate error */
1011
/**
1112
* @typedef {any} BadArgument
1213
*/
14+
/* eslint-enable jsdoc/reject-any-type -- Deliberate error */
1315

1416
describe('iterateJsdoc', () => {
1517
describe('constructor', () => {

test/jsdocUtils.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import {
33
expect,
44
} from 'chai';
55

6+
/* eslint-disable jsdoc/reject-any-type -- Deliberate error */
67
/**
78
* @typedef {any} BadArgument
89
*/
10+
/* eslint-enable jsdoc/reject-any-type -- Deliberate error */
911

1012
describe('jsdocUtils', () => {
1113
describe('getPreferredTagName()', () => {

0 commit comments

Comments
 (0)