Skip to content

Commit 576db87

Browse files
committed
feat: use ts parser even for JS, for better language compatibility
1 parent f737e61 commit 576db87

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/configs/imports.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export function imports(options: OptionsStylistic = {}): FlatESLintConfigItem[]
1717
'antfu/import-dedupe': 'error',
1818
'antfu/no-import-node-modules-by-path': 'error',
1919

20-
'import/export': 'error',
2120
'import/first': 'error',
2221
'import/no-duplicates': 'error',
2322
'import/no-mutable-exports': 'error',

src/configs/typescript.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import process from 'node:process'
22
import type { FlatESLintConfigItem } from 'eslint-define-config'
3-
import { GLOB_JSX, GLOB_TESTS, GLOB_TS, GLOB_TSX } from '../globs'
3+
import { GLOB_JS, GLOB_SRC, GLOB_TESTS, GLOB_TS, GLOB_TSX } from '../globs'
44
import { parserTs, pluginAntfu, pluginImport, pluginTs } from '../plugins'
55
import { OFF } from '../flags'
66
import type { OptionsComponentExts, OptionsOverrides, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes } from '../types'
@@ -49,8 +49,7 @@ export function typescript(
4949
},
5050
{
5151
files: [
52-
GLOB_TS,
53-
GLOB_TSX,
52+
GLOB_SRC,
5453
...componentExts.map(ext => `**/*.${ext}`),
5554
],
5655
languageOptions: {
@@ -100,6 +99,7 @@ export function typescript(
10099
'ts/no-dynamic-delete': OFF,
101100
'ts/no-explicit-any': OFF,
102101
'ts/no-extra-parens': ['error', 'functions'],
102+
'ts/no-extraneous-class': OFF,
103103
'ts/no-invalid-this': 'error',
104104
'ts/no-invalid-void-type': OFF,
105105
'ts/no-loss-of-precision': 'error',
@@ -108,8 +108,10 @@ export function typescript(
108108
'ts/no-require-imports': 'error',
109109
'ts/no-unused-vars': OFF,
110110
'ts/no-use-before-define': ['error', { classes: false, functions: false, variables: true }],
111+
'ts/no-useless-constructor': OFF,
111112
'ts/prefer-ts-expect-error': 'error',
112113
'ts/triple-slash-reference': OFF,
114+
'ts/unified-signatures': OFF,
113115

114116
...tsconfigPath ? typeAwareRules : {},
115117
...overrides,
@@ -130,7 +132,7 @@ export function typescript(
130132
},
131133
},
132134
{
133-
files: [GLOB_JSX],
135+
files: [GLOB_JS],
134136
rules: {
135137
'ts/no-require-imports': OFF,
136138
'ts/no-var-requires': OFF,

0 commit comments

Comments
 (0)