Skip to content

Commit

Permalink
fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshay committed Sep 23, 2023
1 parent 793c141 commit aebd09a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 26 deletions.
5 changes: 5 additions & 0 deletions .changeset/serious-kiwis-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lshay/eslint-config-flat": patch
---

Always import jsdoc
6 changes: 2 additions & 4 deletions packages/lshay-eslint-config-flat/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const CHERRY_PICKED_BASE_RULES = {
"etc/no-const-enum": "error",
"etc/no-enum": "error",
"etc/no-implicit-any-catch": "error",
"etc/no-misused-generics": "error",
// "etc/no-misused-generics": "error",
"etc/no-t": "error",
"etc/prefer-interface": "off",
"fp/no-arguments": "error",
Expand Down Expand Up @@ -134,6 +134,7 @@ const BASE_CONFIG = {
etc,
fp,
import: imprt,
jsdoc,
perfectionist,
promise,
regexp,
Expand Down Expand Up @@ -180,9 +181,6 @@ const BASE_CONFIG = {
}

const JSDOC_CONFIG = {
plugins: {
jsdoc,
},
rules: {
...jsdoc.configs["recommended-typescript-error"].rules,
"jsdoc/require-jsdoc": "error",
Expand Down
6 changes: 4 additions & 2 deletions packages/lshay-eslint-config/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,7 @@ const createSmartConfig = (...configs) =>
...configs,
)

exports.createConfig = createConfig
exports.createSmartConfig = createSmartConfig
module.exports = {
createConfig,
createSmartConfig,
}
41 changes: 21 additions & 20 deletions packages/lshay-eslint-config/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,26 @@ const supportedFileTypes = `**/*{${allExtensions.join(",")}}`
* @param {import(".").Options} options - The options.
* @returns {string} The source type. @default "commonjs".
*/
exports.getSourceType = (options) =>
const getSourceType = (options) =>
options.sourceType ?? mergedPackageJson.type ?? "commonjs"

exports.allTestDirectories = allTestDirectories
exports.allTestExtensions = allTestExtensions
exports.allTsExtensions = allTsExtensions
exports.allJsExtensions = allJsExtensions
exports.allExtensions = allExtensions
exports.allTsTestExtensions = allTsTestExtensions
exports.allJsTestExtensions = allJsTestExtensions
exports.allTestExtensions = allTestExtensions
exports.supportedTsTestFileTypes = supportedTsTestFileTypes
exports.supportedJsTestFileTypes = supportedJsTestFileTypes
exports.supportedTestFileTypes = supportedTestFileTypes
exports.supportedTsFileTypes = supportedTsFileTypes
exports.supportedJsFileTypes = supportedJsFileTypes
exports.supportedFileTypes = supportedFileTypes

exports.packageJson = mergedPackageJson
exports.hasDependency = hasDependency
exports.getVersion = getVersion
exports.log = log
module.exports = {
allExtensions,
allJsExtensions,
allJsTestExtensions,
allTestDirectories,
allTestExtensions,
allTsExtensions,
allTsTestExtensions,
getSourceType,
getVersion,
hasDependency,
log,
mergedPackageJson,
supportedFileTypes,
supportedJsFileTypes,
supportedJsTestFileTypes,
supportedTestFileTypes,
supportedTsFileTypes,
supportedTsTestFileTypes,
}
3 changes: 3 additions & 0 deletions packages/lshay-prettier-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ const config = {
},
{
files: ["**/*.astro"],
options: {
parser: "astro",
},
plugins: [require.resolve("prettier-plugin-astro")],
},
],
Expand Down

0 comments on commit aebd09a

Please sign in to comment.