Skip to content

Commit

Permalink
fix(TS): use flat config; fixes #1130
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed Jan 1, 2024
1 parent 5f61575 commit 3677e43
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import validTypes from './rules/validTypes.js';
* "flat/recommended-typescript-error"|
* "flat/recommended-typescript-flavor"|
* "flat/recommended-typescript-flavor-error",
* import('eslint').ESLint.ConfigData|{}
* import('eslint').Linter.FlatConfig
* >
* }}
*/
Expand Down Expand Up @@ -129,10 +129,11 @@ const index = {
/**
* @param {"warn"|"error"} warnOrError
* @param {boolean} [flat]
* @returns {import('eslint').ESLint.ConfigData | {plugins: {}, rules: {}}}
* @returns {import('eslint').Linter.FlatConfig}
*/
const createRecommendedRuleset = (warnOrError, flat) => {
return {
// @ts-expect-error Ok
plugins: flat ? {
jsdoc: index,
} : [
Expand Down Expand Up @@ -199,7 +200,7 @@ const createRecommendedRuleset = (warnOrError, flat) => {
/**
* @param {"warn"|"error"} warnOrError
* @param {boolean} [flat]
* @returns {import('eslint').ESLint.ConfigData|{}}
* @returns {import('eslint').Linter.FlatConfig}
*/
const createRecommendedTypeScriptRuleset = (warnOrError, flat) => {
const ruleset = createRecommendedRuleset(warnOrError, flat);
Expand Down Expand Up @@ -227,7 +228,7 @@ const createRecommendedTypeScriptRuleset = (warnOrError, flat) => {
/**
* @param {"warn"|"error"} warnOrError
* @param {boolean} [flat]
* @returns {import('eslint').ESLint.ConfigData|{}}
* @returns {import('eslint').Linter.FlatConfig}
*/
const createRecommendedTypeScriptFlavorRuleset = (warnOrError, flat) => {
const ruleset = createRecommendedRuleset(warnOrError, flat);
Expand Down

0 comments on commit 3677e43

Please sign in to comment.