@w5s/eslint-config 3.40.0 → 4.0.0

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/src/glob.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import { Project } from '@w5s/dev';
2
2
 
3
- export const sourceGlob = Project.extensionsToGlob(Project.sourceExtensions(), { nested: true });
3
+ export const sourceGlob = Project.glob({ fileExtensions: [Project.sourceExtensions()], nested: true });
4
4
 
5
- export const esSourceGlob = Project.extensionsToGlob(Project.queryExtensions(['javascript', 'javascriptreact']), { nested: true });
5
+ export const esSourceGlob = Project.glob({ fileExtensions: [Project.queryExtensions(['javascript', 'javascriptreact'])], nested: true });
6
6
 
7
- export const jsxSourceGlob = Project.extensionsToGlob(Project.queryExtensions(['javascriptreact', 'typescriptreact']), { nested: true });
7
+ export const jsxSourceGlob = Project.glob({ fileExtensions: [Project.queryExtensions(['javascriptreact', 'typescriptreact'])], nested: true });
8
8
 
9
- export const jsonSourceGlob = Project.extensionsToGlob(['.json', '.json5', '.jsonc'], { nested: true });
9
+ export const jsonSourceGlob = Project.glob({ fileExtensions: [['.json', '.json5', '.jsonc']], nested: true });
10
10
 
11
- export const tsSourceGlob = Project.extensionsToGlob(Project.queryExtensions(['typescript', 'typescriptreact']), { nested: true });
11
+ export const tsSourceGlob = Project.glob({ fileExtensions: [Project.queryExtensions(['typescript', 'typescriptreact'])], nested: true });
12
12
 
13
- export const ymlSourceGlob = Project.extensionsToGlob(Project.queryExtensions(['yaml']), { nested: true });
13
+ export const ymlSourceGlob = Project.glob({ fileExtensions: [Project.queryExtensions(['yaml'])], nested: true });
@@ -0,0 +1,19 @@
1
+ import { type PluginOptionsBase, StylisticConfig } from '../type.js';
2
+
3
+ /**
4
+ * Return a new plugin option object with default values
5
+ *
6
+ * @param options
7
+ */
8
+ export function defaultPluginOptions<T extends PluginOptionsBase<any>>(options: T): Omit<T, 'namespace' | 'recommended' | 'stylistic'> & {
9
+ namespace: Exclude<PluginOptionsBase<any>['namespace'], undefined>;
10
+ recommended: Exclude<PluginOptionsBase<any>['recommended'], undefined>;
11
+ stylistic: StylisticConfig;
12
+ } {
13
+ return {
14
+ ...options,
15
+ namespace: options.namespace ?? 'w5s',
16
+ recommended: options.recommended ?? true,
17
+ stylistic: StylisticConfig.from(options.stylistic ?? true),
18
+ };
19
+ }
@@ -8,6 +8,14 @@ export interface PluginOptionsBase<Rules> {
8
8
  */
9
9
  files?: ((currentFiles: Array<string>) => Array<string>) | Linter.Config['files'];
10
10
 
11
+ /**
12
+ * Namespace of configurations.
13
+ * Useful for tier configuration and rebranding
14
+ *
15
+ * @default 'w5s'
16
+ */
17
+ namespace?: string | undefined;
18
+
11
19
  /**
12
20
  * Include recommended settings
13
21
  */
@@ -363,6 +363,11 @@ export interface RuleOptions {
363
363
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/text-escaping.md#repos-sticky-header
364
364
  */
365
365
  'jsdoc/text-escaping'?: Linter.RuleEntry<JsdocTextEscaping>
366
+ /**
367
+ * Disallows (or requires descriptions for) `@ts-<directive>` comments, mirroring `@typescript-eslint/ban-ts-comment`.
368
+ * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-ban-ts-comment.md#repos-sticky-header
369
+ */
370
+ 'jsdoc/ts-ban-ts-comment'?: Linter.RuleEntry<JsdocTsBanTsComment>
366
371
  /**
367
372
  * Prefers either function properties or method signatures
368
373
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-method-signature-style.md#repos-sticky-header
@@ -1137,6 +1142,31 @@ type JsdocTextEscaping = []|[{
1137
1142
 
1138
1143
  escapeMarkdown?: boolean
1139
1144
  }]
1145
+ // ----- jsdoc/ts-ban-ts-comment -----
1146
+ type JsdocTsBanTsComment = []|[{
1147
+
1148
+ minimumDescriptionLength?: number
1149
+
1150
+ "ts-check"?: (boolean | "allow-with-description" | {
1151
+
1152
+ descriptionFormat?: string
1153
+ })
1154
+
1155
+ "ts-expect-error"?: (boolean | "allow-with-description" | {
1156
+
1157
+ descriptionFormat?: string
1158
+ })
1159
+
1160
+ "ts-ignore"?: (boolean | "allow-with-description" | {
1161
+
1162
+ descriptionFormat?: string
1163
+ })
1164
+
1165
+ "ts-nocheck"?: (boolean | "allow-with-description" | {
1166
+
1167
+ descriptionFormat?: string
1168
+ })
1169
+ }]
1140
1170
  // ----- jsdoc/ts-method-signature-style -----
1141
1171
  type JsdocTsMethodSignatureStyle = []|[("method" | "property")]|[("method" | "property"), {
1142
1172