mirror of
https://github.com/scratchfoundation/eslint-config-scratch.git
synced 2025-08-28 22:40:13 -04:00
fix: re-enable jsdoc checks
I forgot to add `eslint-plugin-jsdoc` when creating our new configuration, even though it's present in the legacy configurations. This change re-adds the plugin and configures it for better interaction with TypeScript.
This commit is contained in:
parent
c6df2b5932
commit
40c86c94ca
2 changed files with 25 additions and 2 deletions
|
@ -3,6 +3,7 @@ import formatjs from 'eslint-plugin-formatjs'
|
||||||
import html from 'eslint-plugin-html'
|
import html from 'eslint-plugin-html'
|
||||||
import htmlSettings from 'eslint-plugin-html/src/settings.js'
|
import htmlSettings from 'eslint-plugin-html/src/settings.js'
|
||||||
import importPlugin from 'eslint-plugin-import'
|
import importPlugin from 'eslint-plugin-import'
|
||||||
|
import jsdoc from 'eslint-plugin-jsdoc'
|
||||||
import jsxA11y from 'eslint-plugin-jsx-a11y'
|
import jsxA11y from 'eslint-plugin-jsx-a11y'
|
||||||
import markdown from 'eslint-plugin-markdown'
|
import markdown from 'eslint-plugin-markdown'
|
||||||
import react from 'eslint-plugin-react'
|
import react from 'eslint-plugin-react'
|
||||||
|
@ -131,6 +132,29 @@ const makeEslintConfig = ({ tsconfigRootDir, globals: globalsIn } = {}) => {
|
||||||
'import/no-duplicates': 'error', // Forbid duplicate imports
|
'import/no-duplicates': 'error', // Forbid duplicate imports
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// eslint-plugin-jsdoc
|
||||||
|
jsdoc.configs['flat/recommended-error'],
|
||||||
|
{
|
||||||
|
files: ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts'],
|
||||||
|
extends: [jsdoc.configs['flat/recommended-typescript-error']],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
// If JSDoc comments are present, they must be informative (non-trivial).
|
||||||
|
// For example, the description "The foo." on a variable called "foo" is not informative.
|
||||||
|
// https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/informative-docs.md
|
||||||
|
'jsdoc/informative-docs': ['error'],
|
||||||
|
|
||||||
|
// Require JSDoc comments on public / exported items.
|
||||||
|
// https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-jsdoc.md
|
||||||
|
'jsdoc/require-jsdoc': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
publicOnly: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
// eslint-plugin-jsx-a11y
|
// eslint-plugin-jsx-a11y
|
||||||
jsxA11y.flatConfigs.recommended,
|
jsxA11y.flatConfigs.recommended,
|
||||||
// eslint-plugin-markdown
|
// eslint-plugin-markdown
|
||||||
|
|
|
@ -23,8 +23,7 @@ const prettierConfig = {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a Prettier configuration for Scratch style.
|
* @returns {import("prettier").Config} A Prettier configuration for Scratch style.
|
||||||
* @returns {import("prettier").Config}
|
|
||||||
*/
|
*/
|
||||||
const makePrettierConfig = () => prettierConfig
|
const makePrettierConfig = () => prettierConfig
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue