Compare commits

...

2 Commits

Author SHA1 Message Date
Anthony Fu
f8014b745e chore: release v0.29.4 2022-11-07 21:04:08 +08:00
Anthony Fu
95e28e4a4a fix(generic-spacing): improve cases 2022-11-07 21:03:56 +08:00
9 changed files with 11 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config-monorepo",
"version": "0.29.3",
"version": "0.29.4",
"private": true,
"packageManager": "pnpm@7.1.0",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config",
"version": "0.29.3",
"version": "0.29.4",
"description": "Anthony's ESLint config",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT",

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config-basic",
"version": "0.29.3",
"version": "0.29.4",
"description": "",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT",

View File

@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-antfu",
"version": "0.29.3",
"version": "0.29.4",
"license": "MIT",
"homepage": "https://github.com/antfu/eslint-config",
"main": "./dist/index.cjs",

View File

@@ -20,6 +20,9 @@ type Foo<
`interface Log {
<T>(name: T): void
}`,
`interface Foo {
foo?: <T>(name: T) => void
}`,
]
const invalids = [
['type Foo<T=true> = T', 'type Foo<T = true> = T'],

View File

@@ -23,7 +23,7 @@ export default createEslintRule<Options, MessageIds>({
const sourceCode = context.getSourceCode()
return {
TSTypeParameterDeclaration: (node) => {
if (!['TSCallSignatureDeclaration', 'ArrowFunctionExpression'].includes(node.parent.type)) {
if (!['TSCallSignatureDeclaration', 'ArrowFunctionExpression', 'TSFunctionType'].includes(node.parent.type)) {
const pre = sourceCode.text.slice(0, node.range[0])
const preSpace = pre.match(/(\s+)$/)?.[0]
// strip space before <T>

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config-react",
"version": "0.29.3",
"version": "0.29.4",
"description": "",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT",

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config-ts",
"version": "0.29.3",
"version": "0.29.4",
"description": "",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT",

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config-vue",
"version": "0.29.3",
"version": "0.29.4",
"description": "",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT",