@vue-vine/eslint-parser 1.1.10 → 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -0
- package/README.zh-CN.md +39 -0
- package/dist/index.d.ts +0 -19
- package/dist/index.js +346 -425
- package/package.json +3 -1
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @vue-vine/eslint-parser
|
|
2
|
+
|
|
3
|
+
[中文文档](./README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
6
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
7
|
+
|
|
8
|
+
ESLint parser for [Vue Vine](https://vue-vine.dev).
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @vue-vine/eslint-parser
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
Configure in your ESLint config file:
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
export default {
|
|
22
|
+
parser: '@vue-vine/eslint-parser',
|
|
23
|
+
parserOptions: {
|
|
24
|
+
ecmaVersion: 'latest',
|
|
25
|
+
sourceType: 'module',
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## License
|
|
31
|
+
|
|
32
|
+
MIT License © 2024-PRESENT [ShenQingchuan](https://github.com/shenqingchuan)
|
|
33
|
+
|
|
34
|
+
<!-- Badges -->
|
|
35
|
+
|
|
36
|
+
[npm-version-src]: https://img.shields.io/npm/v/@vue-vine/eslint-parser?style=flat&colorA=080f12&colorB=1fa669
|
|
37
|
+
[npm-version-href]: https://npmjs.com/package/@vue-vine/eslint-parser
|
|
38
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/@vue-vine/eslint-parser?style=flat&colorA=080f12&colorB=1fa669
|
|
39
|
+
[npm-downloads-href]: https://npmjs.com/package/@vue-vine/eslint-parser
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @vue-vine/eslint-parser
|
|
2
|
+
|
|
3
|
+
[English](./README.md)
|
|
4
|
+
|
|
5
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
6
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
7
|
+
|
|
8
|
+
[Vue Vine](https://vue-vine.dev) 的 ESLint 解析器。
|
|
9
|
+
|
|
10
|
+
## 安装
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @vue-vine/eslint-parser
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 使用
|
|
17
|
+
|
|
18
|
+
在 ESLint 配置文件中配置:
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
export default {
|
|
22
|
+
parser: '@vue-vine/eslint-parser',
|
|
23
|
+
parserOptions: {
|
|
24
|
+
ecmaVersion: 'latest',
|
|
25
|
+
sourceType: 'module',
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 许可证
|
|
31
|
+
|
|
32
|
+
MIT License © 2024-PRESENT [ShenQingchuan](https://github.com/shenqingchuan)
|
|
33
|
+
|
|
34
|
+
<!-- Badges -->
|
|
35
|
+
|
|
36
|
+
[npm-version-src]: https://img.shields.io/npm/v/@vue-vine/eslint-parser?style=flat&colorA=080f12&colorB=1fa669
|
|
37
|
+
[npm-version-href]: https://npmjs.com/package/@vue-vine/eslint-parser
|
|
38
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/@vue-vine/eslint-parser?style=flat&colorA=080f12&colorB=1fa669
|
|
39
|
+
[npm-downloads-href]: https://npmjs.com/package/@vue-vine/eslint-parser
|
package/dist/index.d.ts
CHANGED
|
@@ -114,9 +114,6 @@ interface Token extends HasLocation {
|
|
|
114
114
|
}
|
|
115
115
|
//#endregion
|
|
116
116
|
//#region src/ast/nodes.d.ts
|
|
117
|
-
// ------------------------------------------------------------------------------
|
|
118
|
-
// Common
|
|
119
|
-
// ------------------------------------------------------------------------------
|
|
120
117
|
/**
|
|
121
118
|
* Objects which have their parent.
|
|
122
119
|
*/
|
|
@@ -131,9 +128,6 @@ type Node = ESLintNode | VNode | VForExpression | VOnExpression | VSlotScopeExpr
|
|
|
131
128
|
* The union type for all template nodes.
|
|
132
129
|
*/
|
|
133
130
|
type VTemplateNode = VNode | VForExpression | VOnExpression | VSlotScopeExpression | VFilterSequenceExpression | VFilter;
|
|
134
|
-
// ------------------------------------------------------------------------------
|
|
135
|
-
// Script
|
|
136
|
-
// ------------------------------------------------------------------------------
|
|
137
131
|
/**
|
|
138
132
|
* The union type for ESLint nodes.
|
|
139
133
|
*/
|
|
@@ -587,9 +581,6 @@ interface ESLintLegacySpreadProperty extends HasLocation, HasParent {
|
|
|
587
581
|
type: "SpreadProperty" | "ExperimentalSpreadProperty";
|
|
588
582
|
argument: ESLintExpression;
|
|
589
583
|
}
|
|
590
|
-
// ------------------------------------------------------------------------------
|
|
591
|
-
// Template
|
|
592
|
-
// ------------------------------------------------------------------------------
|
|
593
584
|
/**
|
|
594
585
|
* Constants of namespaces.
|
|
595
586
|
* @see https://infra.spec.whatwg.org/#namespaces
|
|
@@ -621,7 +612,6 @@ interface Reference {
|
|
|
621
612
|
id: ESLintIdentifier;
|
|
622
613
|
mode: "rw" | "r" | "w";
|
|
623
614
|
variable: Variable | null;
|
|
624
|
-
// For typescript-eslint
|
|
625
615
|
isValueReference?: boolean;
|
|
626
616
|
isTypeReference?: boolean;
|
|
627
617
|
}
|
|
@@ -787,14 +777,9 @@ interface VTemplateRoot extends HasLocation {
|
|
|
787
777
|
}
|
|
788
778
|
//#endregion
|
|
789
779
|
//#region src/ast/traverse.d.ts
|
|
790
|
-
// ------------------------------------------------------------------------------
|
|
791
|
-
// Helpers
|
|
792
|
-
// ------------------------------------------------------------------------------
|
|
793
780
|
interface VisitorKeys {
|
|
794
781
|
readonly [type: string]: readonly string[];
|
|
795
782
|
}
|
|
796
|
-
// Only export Vue template visitor keys, don't merge with standard ESLint keys
|
|
797
|
-
// to avoid overriding TypeScript visitor keys
|
|
798
783
|
declare const KEYS: VisitorKeys;
|
|
799
784
|
/**
|
|
800
785
|
* Get the keys of the given node to traverse it.
|
|
@@ -802,9 +787,6 @@ declare const KEYS: VisitorKeys;
|
|
|
802
787
|
* @returns The keys to traverse.
|
|
803
788
|
*/
|
|
804
789
|
declare function getFallbackKeys(node: any): string[];
|
|
805
|
-
// ------------------------------------------------------------------------------
|
|
806
|
-
// Exports
|
|
807
|
-
// ------------------------------------------------------------------------------
|
|
808
790
|
interface Visitor {
|
|
809
791
|
visitorKeys?: VisitorKeys;
|
|
810
792
|
enterNode: (node: Node, parent: Node | null) => void;
|
|
@@ -855,7 +837,6 @@ interface ParseForESLintResult {
|
|
|
855
837
|
visitorKeys: TsESLintParseForESLint["visitorKeys"];
|
|
856
838
|
}
|
|
857
839
|
type VineESLintParserOptions = ParserOptions & {
|
|
858
|
-
// ...To be extended
|
|
859
840
|
parser?: boolean | string | ParserObject | Record<string, string | ParserObject | undefined>;
|
|
860
841
|
ecmaFeatures?: ParserOptions["ecmaFeatures"] & {
|
|
861
842
|
[key: string]: any;
|