Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit 3138d15

Browse files
committed
Provide support for repo vue-vben-admin
1 parent 2de977c commit 3138d15

9 files changed

+75
-30
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ module.exports = defineConfig({
112112
'tsconfig',
113113
'typedarrays',
114114
'unix',
115+
'vue',
115116
'webextensions',
116117
'webworker',
117118
'wellknown',

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Next
22

3-
[diff](https://github.com/Shinigami92/eslint-define-config/compare/1.0.3...main)
3+
[diff](https://github.com/Shinigami92/eslint-define-config/compare/1.0.4...main)
4+
5+
# 1.0.4
6+
7+
[diff](https://github.com/Shinigami92/eslint-define-config/compare/1.0.3...1.0.4)
8+
9+
- Provide support for repo [vue-vben-admin](https://github.com/anncwb/vue-vben-admin)
410

511
# 1.0.3
612

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = defineConfig({
5050
Improve your eslint configuration experience with:
5151

5252
- auto-suggestions
53-
- type checking
53+
- type checking (Use `// @ts-check` at the first line in your `.eslintrc.js`)
5454
- documentation
5555
- deprecation warnings
5656

src/extends/eslint-plugin-import.d.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@
33
*
44
* @see [Eslint import extensions](https://github.com/benmosher/eslint-plugin-import#installation)
55
*/
6-
export type EslintPluginImportExtensions =
7-
| 'plugin:import/errors'
8-
| 'plugin:import/warnings'
9-
| 'plugin:import/typescript';
6+
export type ImportExtensions = 'plugin:import/errors' | 'plugin:import/warnings' | 'plugin:import/typescript';

src/extends/eslint-plugin-jsdoc.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
*
44
* @see [Eslint JSDoc extensions](https://github.com/gajus/eslint-plugin-jsdoc#configuration)
55
*/
6-
export type EslintPluginJsdocExtensions = 'plugin:jsdoc/recommended';
6+
export type JsdocExtensions = 'plugin:jsdoc/recommended';

src/extends/eslint-plugin-prettier.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
*
44
* @see [Eslint Prettier extensions](https://github.com/prettier/eslint-plugin-prettier#recommended-configuration)
55
*/
6-
export type EslintPluginPrettierExtensions = 'plugin:prettier/recommended' | 'prettier';
6+
export type PrettierExtensions = 'plugin:prettier/recommended' | 'prettier';

src/extends/eslint-plugin-vue.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Eslint Vue extensions.
3+
*
4+
* @see [Eslint Vue extensions](https://eslint.vuejs.org/user-guide/#usage)
5+
*/
6+
export type VueExtensions =
7+
| 'plugin:vue/base'
8+
| 'plugin:vue/vue3-essential'
9+
| 'plugin:vue/vue3-strongly-recommended'
10+
| 'plugin:vue/vue3-recommended'
11+
| 'plugin:vue/essential'
12+
| 'plugin:vue/strongly-recommended'
13+
| 'plugin:vue/recommended';

src/extends/index.d.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import type { LiteralUnion } from '../utility-types';
22
import type { EslintExtensions } from './eslint';
3-
import type { EslintPluginImportExtensions } from './eslint-plugin-import';
4-
import type { EslintPluginJsdocExtensions } from './eslint-plugin-jsdoc';
5-
import type { EslintPluginPrettierExtensions } from './eslint-plugin-prettier';
3+
import type { ImportExtensions } from './eslint-plugin-import';
4+
import type { JsdocExtensions } from './eslint-plugin-jsdoc';
5+
import type { PrettierExtensions } from './eslint-plugin-prettier';
6+
import type { VueExtensions } from './eslint-plugin-vue';
67
import type { TypescriptEslintExtensions } from './typescript-eslint';
78

89
/**
@@ -11,9 +12,10 @@ import type { TypescriptEslintExtensions } from './typescript-eslint';
1112
export type KnownExtensions = LiteralUnion<
1213
| EslintExtensions
1314
| TypescriptEslintExtensions
14-
| EslintPluginPrettierExtensions
15-
| EslintPluginImportExtensions
16-
| EslintPluginJsdocExtensions
15+
| PrettierExtensions
16+
| ImportExtensions
17+
| JsdocExtensions
18+
| VueExtensions
1719
>;
1820

1921
/**

src/parser-options.d.ts

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LiteralUnion } from './utility-types';
1+
import type { LiteralUnion } from './utility-types';
22

33
/**
44
* Set to 3, 5 (default), 6, 7, 8, 9, 10, 11, or 12 to specify the version of ECMAScript syntax you want to use. You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), or 2021 (same as 12) to use the year-based naming.
@@ -12,6 +12,24 @@ export type EcmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 2015 | 2016 | 2
1212
*/
1313
export type SourceType = 'script' | 'module';
1414

15+
/**
16+
* An object indicating which additional language features you'd like to use.
17+
*/
18+
export interface EcmaFeatures extends Partial<Record<string, boolean>> {
19+
/**
20+
* Allow `return` statements in the global scope.
21+
*/
22+
globalReturn?: boolean;
23+
/**
24+
* Enable global [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode) (if `ecmaVersion` is 5 or greater).
25+
*/
26+
impliedStrict?: boolean;
27+
/**
28+
* Enable [JSX](https://facebook.github.io/jsx).
29+
*/
30+
jsx?: boolean;
31+
}
32+
1533
/** Lib. */
1634
export type Lib = LiteralUnion<
1735
| 'es5'
@@ -81,7 +99,7 @@ export type Lib = LiteralUnion<
8199
export type DebugLevel = boolean | Array<'eslint' | 'typescript' | 'typescript-eslint'>;
82100

83101
/** Parser. */
84-
export type Parser = LiteralUnion<'@typescript-eslint/parser'>;
102+
export type Parser = LiteralUnion<'babel-eslint' | '@typescript-eslint/parser' | 'vue-eslint-parser'>;
85103

86104
/**
87105
* Parser options.
@@ -102,20 +120,7 @@ export interface ParserOptions extends Partial<Record<string, unknown>> {
102120
/**
103121
* An object indicating which additional language features you'd like to use.
104122
*/
105-
ecmaFeatures?: {
106-
/**
107-
* Allow `return` statements in the global scope.
108-
*/
109-
globalReturn?: boolean;
110-
/**
111-
* Enable global [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode) (if `ecmaVersion` is 5 or greater).
112-
*/
113-
impliedStrict?: boolean;
114-
/**
115-
* Enable [JSX](https://facebook.github.io/jsx/).
116-
*/
117-
jsx?: boolean;
118-
};
123+
ecmaFeatures?: EcmaFeatures;
119124
jsxPragma?: string;
120125
jsxFragmentName?: string | null;
121126
/**
@@ -169,4 +174,25 @@ export interface ParserOptions extends Partial<Record<string, unknown>> {
169174
* @see [warnOnUnsupportedTypeScriptVersion](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionswarnonunsupportedtypescriptversion)
170175
*/
171176
warnOnUnsupportedTypeScriptVersion?: boolean;
177+
/**
178+
* @see [vueFeatures](https://github.com/vuejs/vue-eslint-parser#parseroptionsvuefeatures)
179+
*/
180+
vueFeatures?: {
181+
/**
182+
* You can use `parserOptions.vueFeatures.filter` property to specify whether to parse the Vue2 filter.
183+
*
184+
* If you specify `false`, the parser does not parse `|` as a filter.
185+
*
186+
* @see [filter](https://github.com/vuejs/vue-eslint-parser#parseroptionsvuefeaturesfilter)
187+
*/
188+
filter?: boolean;
189+
/**
190+
* You can use `parserOptions.vueFeatures.interpolationAsNonHTML` property to specify whether to parse the interpolation as HTML.
191+
*
192+
* If you specify `true`, the parser handles the interpolation as non-HTML (However, you can use HTML escaping in the interpolation).
193+
*
194+
* @see [interpolationAsNonHTML](https://github.com/vuejs/vue-eslint-parser#parseroptionsvuefeaturesinterpolationasnonhtml)
195+
*/
196+
interpolationAsNonHTML?: boolean;
197+
};
172198
}

0 commit comments

Comments
 (0)