This repository was archived by the owner on Mar 7, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +70
-1
lines changed
scripts/generate-rule-files/src Expand file tree Collapse file tree 7 files changed +70
-1
lines changed Original file line number Diff line number Diff line change 63
63
"eslint" : " ~8.31.0" ,
64
64
"eslint-config-prettier" : " ~8.5.0" ,
65
65
"eslint-gitignore" : " ~0.1.0" ,
66
+ "eslint-plugin-deprecation" : " ~1.3.3" ,
66
67
"eslint-plugin-import" : " ~2.26.0" ,
67
68
"eslint-plugin-inclusive-language" : " ~2.2.0" ,
68
69
"eslint-plugin-jsdoc" : " ~39.6.4" ,
Original file line number Diff line number Diff line change 1
1
import * as eslint from 'eslint' ;
2
+ import * as eslintPluginDeprecation from 'eslint-plugin-deprecation' ;
2
3
// @ts -expect-error
3
4
import * as eslintPluginImport from 'eslint-plugin-import' ;
4
5
// @ts -expect-error
@@ -26,6 +27,12 @@ import type { Plugin } from '../contracts';
26
27
* Map of plugins for which the script will generate rule files.
27
28
*/
28
29
export const PLUGIN_REGISTRY : Readonly < Record < string , Plugin > > = {
30
+ deprecation : {
31
+ name : 'Deprecation' ,
32
+ rules :
33
+ // @ts -expect-error: throw error when plugin successfully updated their type defs
34
+ eslintPluginDeprecation . rules as Plugin [ 'rules' ] ,
35
+ } ,
29
36
eslint : {
30
37
name : 'Eslint' ,
31
38
rules : Object . fromEntries ( new eslint . Linter ( ) . getRules ( ) . entries ( ) ) ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import type { LiteralUnion } from '../utility-types';
3
3
/** Plugin. */
4
4
export type Plugin = LiteralUnion <
5
5
| '@typescript-eslint'
6
+ | 'deprecation'
6
7
| 'import'
7
8
| 'inclusive-language'
8
9
| 'jsdoc'
Original file line number Diff line number Diff line change
1
+ import type { RuleConfig } from '../rule-config' ;
2
+
3
+ /**
4
+ * Do not use deprecated APIs.
5
+ *
6
+ * @see [deprecation](https://github.com/gund/eslint-plugin-deprecation)
7
+ */
8
+ export type DeprecationRuleConfig = RuleConfig < [ ] > ;
9
+
10
+ /**
11
+ * Do not use deprecated APIs.
12
+ *
13
+ * @see [deprecation](https://github.com/gund/eslint-plugin-deprecation)
14
+ */
15
+ export interface DeprecationRule {
16
+ /**
17
+ * Do not use deprecated APIs.
18
+ *
19
+ * @see [deprecation](https://github.com/gund/eslint-plugin-deprecation)
20
+ */
21
+ 'deprecation/deprecation' : DeprecationRuleConfig ;
22
+ }
Original file line number Diff line number Diff line change
1
+ import type { DeprecationRule } from './deprecation' ;
2
+
3
+ /**
4
+ * All Deprecation rules.
5
+ */
6
+ export type DeprecationRules = DeprecationRule ;
Original file line number Diff line number Diff line change
1
+ import type { DeprecationRules } from './deprecation' ;
1
2
import type { EslintRules } from './eslint' ;
2
3
import type { ImportRules } from './import' ;
3
4
import type { JSDocRules } from './jsdoc' ;
@@ -17,7 +18,8 @@ import type { VuePugRules } from './vue-pug';
17
18
* @see [Rules](https://eslint.org/docs/user-guide/configuring/rules)
18
19
*/
19
20
export type Rules = Partial <
20
- EslintRules &
21
+ DeprecationRules &
22
+ EslintRules &
21
23
ImportRules &
22
24
JSDocRules &
23
25
NodeRules &
You can’t perform that action at this time.
0 commit comments