@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.d.cts CHANGED
@@ -1,30 +1,36 @@
1
1
  import { ESLint } from "eslint";
2
2
 
3
3
  //#region src/ESLintConfig.d.ts
4
- declare namespace ESLintConfig {
5
- /**
6
- *
7
- * @param configs
8
- */
9
- function concat(...configs: ESLint.ConfigData[]): ESLint.ConfigData;
10
- /**
11
- * Always return 'off'. `_status` is the previous rule value.
12
- *
13
- * @param _status
14
- */
15
- function fixme(_status: string | number | [string | number, ...any[]] | undefined): "off";
16
- /**
17
- * Renames rules in the given object according to the given map.
18
- *
19
- * Given a map `{ 'old-prefix': 'new-prefix' }`, and a rule object
20
- * `{ 'old-prefix/rule-name': 'error' }`, this function will return
21
- * `{ 'new-prefix/rule-name': 'error' }`.
22
- *
23
- * @param rules The object containing the rules to rename.
24
- * @param map The object containing the rename map.
25
- */
26
- function renameRules(rules: Record<string, any>, map: Record<string, string>): Record<string, any>;
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
- declare namespace Project {
89
- /**
90
- * A type of a file extension
91
- */
92
- type Extension = `.${string}`;
93
- /**
94
- * Object hash of all well-known file extension category to file extensions mapping
95
- */
96
- type ExtensionRegistry = { [K in LanguageId]: readonly Extension[] };
97
- /**
98
- * Supported ECMA version
99
- *
100
- * @example
101
- * ```ts
102
- * Project.ecmaVersion() // 2022
103
- * ```
104
- */
105
- function ecmaVersion(): 2022;
106
- /**
107
- * Return a list of extensions
108
- *
109
- * @example
110
- * ```ts
111
- * Project.queryExtensions(['javascript']); // ['.js', '.cjs', ...]
112
- * Project.queryExtensions(['typescript', 'typescriptreact']); // ['.ts', '.mts', ..., '.tsx']
113
- * ```
114
- *
115
- * @param languages
116
- */
117
- function queryExtensions(languages: LanguageId[]): readonly Extension[];
118
- /**
119
- * Supported file extensions
120
- *
121
- * @example
122
- * ```ts
123
- * Project.sourceExtensions() // ['.ts', '.js', ...]
124
- * ```
125
- */
126
- function sourceExtensions(): readonly `.${string}`[];
127
- /**
128
- * Resource file extensions
129
- *
130
- * @example
131
- * ```ts
132
- * Project.resourceExtensions() // ['.css', '.sass', ...]
133
- * ```
134
- */
135
- function resourceExtensions(): readonly `.${string}`[];
136
- /**
137
- * Files and folders to always ignore
138
- *
139
- * @example
140
- * ```ts
141
- * IGNORED // ['node_modules/', 'build/', ...]
142
- * ```
143
- */
144
- function ignored(): readonly string[];
145
- /**
146
- * Return a RegExp that will match any list of extensions
147
- *
148
- * @param extensions
149
- * @example
150
- * ```ts
151
- * Project.extensionsToMatcher(['.js', '.ts']) // RegExp = /(\.js|\.ts)$/
152
- * ```
153
- */
154
- function extensionsToMatcher(extensions: readonly Extension[]): RegExp;
155
- /**
156
- * Return a glob matcher that will match any list of extensions
157
- *
158
- * @param extensions
159
- * @example
160
- * ```ts
161
- * Project.extensionsToGlob(['.js', '.ts']) // '*.+(js|ts)'
162
- * ```
163
- */
164
- function extensionsToGlob(extensions: readonly Extension[]): string;
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
- declare namespace ESLintConfig {
5
- /**
6
- *
7
- * @param configs
8
- */
9
- function concat(...configs: ESLint.ConfigData[]): ESLint.ConfigData;
10
- /**
11
- * Always return 'off'. `_status` is the previous rule value.
12
- *
13
- * @param _status
14
- */
15
- function fixme(_status: string | number | [string | number, ...any[]] | undefined): "off";
16
- /**
17
- * Renames rules in the given object according to the given map.
18
- *
19
- * Given a map `{ 'old-prefix': 'new-prefix' }`, and a rule object
20
- * `{ 'old-prefix/rule-name': 'error' }`, this function will return
21
- * `{ 'new-prefix/rule-name': 'error' }`.
22
- *
23
- * @param rules The object containing the rules to rename.
24
- * @param map The object containing the rename map.
25
- */
26
- function renameRules(rules: Record<string, any>, map: Record<string, string>): Record<string, any>;
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
- declare namespace Project {
89
- /**
90
- * A type of a file extension
91
- */
92
- type Extension = `.${string}`;
93
- /**
94
- * Object hash of all well-known file extension category to file extensions mapping
95
- */
96
- type ExtensionRegistry = { [K in LanguageId]: readonly Extension[] };
97
- /**
98
- * Supported ECMA version
99
- *
100
- * @example
101
- * ```ts
102
- * Project.ecmaVersion() // 2022
103
- * ```
104
- */
105
- function ecmaVersion(): 2022;
106
- /**
107
- * Return a list of extensions
108
- *
109
- * @example
110
- * ```ts
111
- * Project.queryExtensions(['javascript']); // ['.js', '.cjs', ...]
112
- * Project.queryExtensions(['typescript', 'typescriptreact']); // ['.ts', '.mts', ..., '.tsx']
113
- * ```
114
- *
115
- * @param languages
116
- */
117
- function queryExtensions(languages: LanguageId[]): readonly Extension[];
118
- /**
119
- * Supported file extensions
120
- *
121
- * @example
122
- * ```ts
123
- * Project.sourceExtensions() // ['.ts', '.js', ...]
124
- * ```
125
- */
126
- function sourceExtensions(): readonly `.${string}`[];
127
- /**
128
- * Resource file extensions
129
- *
130
- * @example
131
- * ```ts
132
- * Project.resourceExtensions() // ['.css', '.sass', ...]
133
- * ```
134
- */
135
- function resourceExtensions(): readonly `.${string}`[];
136
- /**
137
- * Files and folders to always ignore
138
- *
139
- * @example
140
- * ```ts
141
- * IGNORED // ['node_modules/', 'build/', ...]
142
- * ```
143
- */
144
- function ignored(): readonly string[];
145
- /**
146
- * Return a RegExp that will match any list of extensions
147
- *
148
- * @param extensions
149
- * @example
150
- * ```ts
151
- * Project.extensionsToMatcher(['.js', '.ts']) // RegExp = /(\.js|\.ts)$/
152
- * ```
153
- */
154
- function extensionsToMatcher(extensions: readonly Extension[]): RegExp;
155
- /**
156
- * Return a glob matcher that will match any list of extensions
157
- *
158
- * @param extensions
159
- * @example
160
- * ```ts
161
- * Project.extensionsToGlob(['.js', '.ts']) // '*.+(js|ts)'
162
- * ```
163
- */
164
- function extensionsToGlob(extensions: readonly Extension[]): string;
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