@w5s/dev 3.3.0 → 3.3.2
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/dist/index.cjs +230 -158
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +117 -103
- package/dist/index.d.ts +117 -103
- package/dist/index.js +228 -146
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/ESLintConfig.ts +67 -60
- package/src/Project.ts +141 -133
- package/src/ProjectScript.ts +1 -0
- package/dist/index.d.cts.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
import { ESLint } from "eslint";
|
|
2
2
|
|
|
3
3
|
//#region src/ESLintConfig.d.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param configs
|
|
7
|
+
*/
|
|
8
|
+
declare function concat(...configs: ESLint.ConfigData[]): ESLint.ConfigData;
|
|
9
|
+
/**
|
|
10
|
+
* Always return 'off'. `_status` is the previous rule value.
|
|
11
|
+
*
|
|
12
|
+
* @param _status
|
|
13
|
+
*/
|
|
14
|
+
declare function fixme(_status: string | number | [string | number, ...any[]] | undefined): "off";
|
|
15
|
+
/**
|
|
16
|
+
* Renames rules in the given object according to the given map.
|
|
17
|
+
*
|
|
18
|
+
* Given a map `{ 'old-prefix': 'new-prefix' }`, and a rule object
|
|
19
|
+
* `{ 'old-prefix/rule-name': 'error' }`, this function will return
|
|
20
|
+
* `{ 'new-prefix/rule-name': 'error' }`.
|
|
21
|
+
*
|
|
22
|
+
* @param rules The object containing the rules to rename.
|
|
23
|
+
* @param map The object containing the rename map.
|
|
24
|
+
*/
|
|
25
|
+
declare function renameRules(rules: Record<string, any>, map: Record<string, string>): Record<string, any>;
|
|
26
|
+
/**
|
|
27
|
+
* @namespace
|
|
28
|
+
*/
|
|
29
|
+
declare const ESLintConfig: Readonly<{
|
|
30
|
+
concat: typeof concat;
|
|
31
|
+
fixme: typeof fixme;
|
|
32
|
+
renameRules: typeof renameRules;
|
|
33
|
+
}>;
|
|
28
34
|
//#endregion
|
|
29
35
|
//#region src/interopDefault.d.ts
|
|
30
36
|
/**
|
|
@@ -85,84 +91,91 @@ declare const meta: Readonly<{
|
|
|
85
91
|
}>;
|
|
86
92
|
//#endregion
|
|
87
93
|
//#region src/Project.d.ts
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
94
|
+
/**
|
|
95
|
+
* A type of a file extension
|
|
96
|
+
*/
|
|
97
|
+
type Extension = `.${string}`;
|
|
98
|
+
/**
|
|
99
|
+
* Object hash of all well-known file extension category to file extensions mapping
|
|
100
|
+
*/
|
|
101
|
+
type ExtensionRegistry = { [K in LanguageId]: readonly Extension[] };
|
|
102
|
+
/**
|
|
103
|
+
* Supported ECMA version
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* Project.ecmaVersion() // 2022
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
declare function ecmaVersion(): 2022;
|
|
111
|
+
/**
|
|
112
|
+
* Return a list of extensions
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```ts
|
|
116
|
+
* Project.queryExtensions(['javascript']); // ['.js', '.cjs', ...]
|
|
117
|
+
* Project.queryExtensions(['typescript', 'typescriptreact']); // ['.ts', '.mts', ..., '.tsx']
|
|
118
|
+
* ```
|
|
119
|
+
*
|
|
120
|
+
* @param languages
|
|
121
|
+
*/
|
|
122
|
+
declare function queryExtensions(languages: LanguageId[]): readonly Extension[];
|
|
123
|
+
/**
|
|
124
|
+
* Supported file extensions
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```ts
|
|
128
|
+
* Project.sourceExtensions() // ['.ts', '.js', ...]
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
declare function sourceExtensions(): readonly `.${string}`[];
|
|
132
|
+
/**
|
|
133
|
+
* Resource file extensions
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```ts
|
|
137
|
+
* Project.resourceExtensions() // ['.css', '.sass', ...]
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
declare function resourceExtensions(): readonly `.${string}`[];
|
|
141
|
+
/**
|
|
142
|
+
* Files and folders to always ignore
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```ts
|
|
146
|
+
* IGNORED // ['node_modules/', 'build/', ...]
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
declare function ignored(): readonly string[];
|
|
150
|
+
/**
|
|
151
|
+
* Return a RegExp that will match any list of extensions
|
|
152
|
+
*
|
|
153
|
+
* @param extensions
|
|
154
|
+
* @example
|
|
155
|
+
* ```ts
|
|
156
|
+
* Project.extensionsToMatcher(['.js', '.ts']) // RegExp = /(\.js|\.ts)$/
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
declare function extensionsToMatcher(extensions: readonly Extension[]): RegExp;
|
|
160
|
+
/**
|
|
161
|
+
* Return a glob matcher that will match any list of extensions
|
|
162
|
+
*
|
|
163
|
+
* @param extensions
|
|
164
|
+
* @example
|
|
165
|
+
* ```ts
|
|
166
|
+
* Project.extensionsToGlob(['.js', '.ts']) // '*.+(js|ts)'
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
declare function extensionsToGlob(extensions: readonly Extension[]): string;
|
|
170
|
+
declare const Project: Readonly<{
|
|
171
|
+
ecmaVersion: typeof ecmaVersion;
|
|
172
|
+
extensionsToGlob: typeof extensionsToGlob;
|
|
173
|
+
extensionsToMatcher: typeof extensionsToMatcher;
|
|
174
|
+
ignored: typeof ignored;
|
|
175
|
+
queryExtensions: typeof queryExtensions;
|
|
176
|
+
resourceExtensions: typeof resourceExtensions;
|
|
177
|
+
sourceExtensions: typeof sourceExtensions;
|
|
178
|
+
}>;
|
|
166
179
|
//#endregion
|
|
167
180
|
//#region src/ProjectScript.d.ts
|
|
168
181
|
/**
|
|
@@ -183,9 +196,10 @@ declare const ProjectScript: {
|
|
|
183
196
|
readonly Rescue: "rescue";
|
|
184
197
|
readonly Spellcheck: "spellcheck";
|
|
185
198
|
readonly Test: "test";
|
|
199
|
+
readonly Typecheck: "typecheck";
|
|
186
200
|
readonly Validate: "validate";
|
|
187
201
|
};
|
|
188
202
|
type ProjectScript = (typeof ProjectScript)[keyof typeof ProjectScript];
|
|
189
203
|
//#endregion
|
|
190
|
-
export { ESLintConfig, LanguageId, LanguageIdMap, Project, ProjectScript, interopDefault, meta };
|
|
204
|
+
export { ESLintConfig, Extension, ExtensionRegistry, LanguageId, LanguageIdMap, Project, ProjectScript, interopDefault, meta };
|
|
191
205
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
import { ESLint } from "eslint";
|
|
2
2
|
|
|
3
3
|
//#region src/ESLintConfig.d.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param configs
|
|
7
|
+
*/
|
|
8
|
+
declare function concat(...configs: ESLint.ConfigData[]): ESLint.ConfigData;
|
|
9
|
+
/**
|
|
10
|
+
* Always return 'off'. `_status` is the previous rule value.
|
|
11
|
+
*
|
|
12
|
+
* @param _status
|
|
13
|
+
*/
|
|
14
|
+
declare function fixme(_status: string | number | [string | number, ...any[]] | undefined): "off";
|
|
15
|
+
/**
|
|
16
|
+
* Renames rules in the given object according to the given map.
|
|
17
|
+
*
|
|
18
|
+
* Given a map `{ 'old-prefix': 'new-prefix' }`, and a rule object
|
|
19
|
+
* `{ 'old-prefix/rule-name': 'error' }`, this function will return
|
|
20
|
+
* `{ 'new-prefix/rule-name': 'error' }`.
|
|
21
|
+
*
|
|
22
|
+
* @param rules The object containing the rules to rename.
|
|
23
|
+
* @param map The object containing the rename map.
|
|
24
|
+
*/
|
|
25
|
+
declare function renameRules(rules: Record<string, any>, map: Record<string, string>): Record<string, any>;
|
|
26
|
+
/**
|
|
27
|
+
* @namespace
|
|
28
|
+
*/
|
|
29
|
+
declare const ESLintConfig: Readonly<{
|
|
30
|
+
concat: typeof concat;
|
|
31
|
+
fixme: typeof fixme;
|
|
32
|
+
renameRules: typeof renameRules;
|
|
33
|
+
}>;
|
|
28
34
|
//#endregion
|
|
29
35
|
//#region src/interopDefault.d.ts
|
|
30
36
|
/**
|
|
@@ -85,84 +91,91 @@ declare const meta: Readonly<{
|
|
|
85
91
|
}>;
|
|
86
92
|
//#endregion
|
|
87
93
|
//#region src/Project.d.ts
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
94
|
+
/**
|
|
95
|
+
* A type of a file extension
|
|
96
|
+
*/
|
|
97
|
+
type Extension = `.${string}`;
|
|
98
|
+
/**
|
|
99
|
+
* Object hash of all well-known file extension category to file extensions mapping
|
|
100
|
+
*/
|
|
101
|
+
type ExtensionRegistry = { [K in LanguageId]: readonly Extension[] };
|
|
102
|
+
/**
|
|
103
|
+
* Supported ECMA version
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* Project.ecmaVersion() // 2022
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
declare function ecmaVersion(): 2022;
|
|
111
|
+
/**
|
|
112
|
+
* Return a list of extensions
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```ts
|
|
116
|
+
* Project.queryExtensions(['javascript']); // ['.js', '.cjs', ...]
|
|
117
|
+
* Project.queryExtensions(['typescript', 'typescriptreact']); // ['.ts', '.mts', ..., '.tsx']
|
|
118
|
+
* ```
|
|
119
|
+
*
|
|
120
|
+
* @param languages
|
|
121
|
+
*/
|
|
122
|
+
declare function queryExtensions(languages: LanguageId[]): readonly Extension[];
|
|
123
|
+
/**
|
|
124
|
+
* Supported file extensions
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```ts
|
|
128
|
+
* Project.sourceExtensions() // ['.ts', '.js', ...]
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
declare function sourceExtensions(): readonly `.${string}`[];
|
|
132
|
+
/**
|
|
133
|
+
* Resource file extensions
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```ts
|
|
137
|
+
* Project.resourceExtensions() // ['.css', '.sass', ...]
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
declare function resourceExtensions(): readonly `.${string}`[];
|
|
141
|
+
/**
|
|
142
|
+
* Files and folders to always ignore
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```ts
|
|
146
|
+
* IGNORED // ['node_modules/', 'build/', ...]
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
declare function ignored(): readonly string[];
|
|
150
|
+
/**
|
|
151
|
+
* Return a RegExp that will match any list of extensions
|
|
152
|
+
*
|
|
153
|
+
* @param extensions
|
|
154
|
+
* @example
|
|
155
|
+
* ```ts
|
|
156
|
+
* Project.extensionsToMatcher(['.js', '.ts']) // RegExp = /(\.js|\.ts)$/
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
declare function extensionsToMatcher(extensions: readonly Extension[]): RegExp;
|
|
160
|
+
/**
|
|
161
|
+
* Return a glob matcher that will match any list of extensions
|
|
162
|
+
*
|
|
163
|
+
* @param extensions
|
|
164
|
+
* @example
|
|
165
|
+
* ```ts
|
|
166
|
+
* Project.extensionsToGlob(['.js', '.ts']) // '*.+(js|ts)'
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
declare function extensionsToGlob(extensions: readonly Extension[]): string;
|
|
170
|
+
declare const Project: Readonly<{
|
|
171
|
+
ecmaVersion: typeof ecmaVersion;
|
|
172
|
+
extensionsToGlob: typeof extensionsToGlob;
|
|
173
|
+
extensionsToMatcher: typeof extensionsToMatcher;
|
|
174
|
+
ignored: typeof ignored;
|
|
175
|
+
queryExtensions: typeof queryExtensions;
|
|
176
|
+
resourceExtensions: typeof resourceExtensions;
|
|
177
|
+
sourceExtensions: typeof sourceExtensions;
|
|
178
|
+
}>;
|
|
166
179
|
//#endregion
|
|
167
180
|
//#region src/ProjectScript.d.ts
|
|
168
181
|
/**
|
|
@@ -183,9 +196,10 @@ declare const ProjectScript: {
|
|
|
183
196
|
readonly Rescue: "rescue";
|
|
184
197
|
readonly Spellcheck: "spellcheck";
|
|
185
198
|
readonly Test: "test";
|
|
199
|
+
readonly Typecheck: "typecheck";
|
|
186
200
|
readonly Validate: "validate";
|
|
187
201
|
};
|
|
188
202
|
type ProjectScript = (typeof ProjectScript)[keyof typeof ProjectScript];
|
|
189
203
|
//#endregion
|
|
190
|
-
export { ESLintConfig, LanguageId, LanguageIdMap, Project, ProjectScript, interopDefault, meta };
|
|
204
|
+
export { ESLintConfig, Extension, ExtensionRegistry, LanguageId, LanguageIdMap, Project, ProjectScript, interopDefault, meta };
|
|
191
205
|
//# sourceMappingURL=index.d.ts.map
|