Skip to content

Commit c18efb0

Browse files
ota-meshi9romiseantfu
authored
feat: no longer deps on typescript (#838)
Co-authored-by: Vida Xie <vida_2020@163.com> Co-authored-by: Anthony Fu <github@antfu.me>
1 parent 1b0daad commit c18efb0

7 files changed

Lines changed: 26 additions & 21 deletions

File tree

eslint.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default antfu(
8888
'ts/no-restricted-imports': ['error', {
8989
patterns: [
9090
{
91-
group: ['@typescript-eslint/utils', '@typescript-eslint/utils/*'],
91+
group: ['@typescript-eslint/utils', '@typescript-eslint/utils/*', '@typescript-eslint/types'],
9292
importNames: [
9393
'TSESTree',
9494
'TSESLint',
@@ -137,7 +137,7 @@ export default antfu(
137137
'ts/no-restricted-imports': ['error', {
138138
patterns: [
139139
{
140-
group: ['@typescript-eslint/utils'],
140+
group: ['@typescript-eslint/utils', '@typescript-eslint/types'],
141141
importNames: ['AST_NODE_TYPES', 'AST_TOKEN_TYPES', 'ASTUtils'],
142142
message: 'Import from "#utils/ast" instead',
143143
},

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"@types/picomatch": "catalog:",
4343
"@types/semver": "catalog:",
4444
"@typescript-eslint/parser": "catalog:",
45+
"@typescript-eslint/types": "catalog:",
4546
"@typescript-eslint/utils": "catalog:",
4647
"@vitest/coverage-v8": "catalog:test",
4748
"@vitest/ui": "catalog:test",

packages/eslint-plugin/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@
138138
"eslint": ">=9.0.0"
139139
},
140140
"dependencies": {
141-
"@typescript-eslint/utils": "catalog:",
141+
"@eslint-community/eslint-utils": "catalog:",
142+
"@typescript-eslint/types": "catalog:",
142143
"eslint-visitor-keys": "catalog:",
143144
"espree": "catalog:",
144145
"estraverse": "catalog:",

packages/shared/types/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import type * as ESTree from 'estree'
66
// TypeScript Enabled Types (recommended, should be used in most cases)
77
export type ASTNode = TSESTree.Node
88
export type Token = TSESTree.Token
9-
export { TSESTree as Tree }
9+
export type { TSESTree as Tree }
1010
export type NodeTypes = `${AST_NODE_TYPES}`
11-
export { JSONSchema } from '@typescript-eslint/utils'
12-
export {
11+
export type { JSONSchema } from '@typescript-eslint/utils'
12+
export type {
1313
RuleWithMetaAndName,
1414
} from '@typescript-eslint/utils/eslint-utils'
15-
export {
15+
export type {
1616
EcmaVersion,
1717
ReportDescriptor,
1818
ReportFixFunction,

packages/shared/utils/ast.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export * from './ast/general'
33
export {
44
AST_NODE_TYPES,
55
AST_TOKEN_TYPES,
6-
} from '@typescript-eslint/utils'
6+
} from '@typescript-eslint/types'
77

88
// eslint-disable-next-line ts/no-restricted-imports
99
export * from '@typescript-eslint/utils/ast-utils'

pnpm-lock.yaml

Lines changed: 14 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ catalog:
66
'@antfu/eslint-define-config': 1.23.0-2
77
'@antfu/utils': ^9.2.0
88
'@codecov/rollup-plugin': ^1.9.1
9+
'@eslint-community/eslint-utils': ^4.7.0
910
'@rollup/plugin-alias': ^5.1.1
1011
'@rollup/plugin-commonjs': ^28.0.3
1112
'@rollup/plugin-node-resolve': ^16.0.1
@@ -16,6 +17,7 @@ catalog:
1617
'@types/picomatch': ^4.0.0
1718
'@types/semver': ^7.7.0
1819
'@typescript-eslint/parser': ^8.32.1
20+
'@typescript-eslint/types': ^8.32.1
1921
'@typescript-eslint/utils': ^8.32.1
2022
change-case: ^5.4.4
2123
escape-string-regexp: ^5.0.0

0 commit comments

Comments
 (0)