@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/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +119 -92
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/config/e18e.ts +14 -6
- package/src/config/es.ts +7 -5
- package/src/config/imports.ts +6 -6
- package/src/config/jsdoc.ts +10 -9
- package/src/config/jsonc.ts +12 -11
- package/src/config/jsx.ts +5 -3
- package/src/config/markdown.ts +11 -10
- package/src/config/next.ts +1 -1
- package/src/config/perfectionist.ts +9 -8
- package/src/config/react.ts +4 -3
- package/src/config/test.ts +6 -6
- package/src/config/ts.ts +9 -8
- package/src/config/unicorn.ts +7 -7
- package/src/config/unused-imports.ts +2 -1
- package/src/config/yml.ts +6 -5
- package/src/glob.ts +6 -6
- package/src/internal/defaultOptions.ts +19 -0
- package/src/type/PluginOptionsBase.ts +8 -0
- package/src/typegen/jsdoc.d.ts +30 -0
package/src/glob.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Project } from '@w5s/dev';
|
|
2
2
|
|
|
3
|
-
export const sourceGlob = Project.
|
|
3
|
+
export const sourceGlob = Project.glob({ fileExtensions: [Project.sourceExtensions()], nested: true });
|
|
4
4
|
|
|
5
|
-
export const esSourceGlob = Project.
|
|
5
|
+
export const esSourceGlob = Project.glob({ fileExtensions: [Project.queryExtensions(['javascript', 'javascriptreact'])], nested: true });
|
|
6
6
|
|
|
7
|
-
export const jsxSourceGlob = Project.
|
|
7
|
+
export const jsxSourceGlob = Project.glob({ fileExtensions: [Project.queryExtensions(['javascriptreact', 'typescriptreact'])], nested: true });
|
|
8
8
|
|
|
9
|
-
export const jsonSourceGlob = Project.
|
|
9
|
+
export const jsonSourceGlob = Project.glob({ fileExtensions: [['.json', '.json5', '.jsonc']], nested: true });
|
|
10
10
|
|
|
11
|
-
export const tsSourceGlob = Project.
|
|
11
|
+
export const tsSourceGlob = Project.glob({ fileExtensions: [Project.queryExtensions(['typescript', 'typescriptreact'])], nested: true });
|
|
12
12
|
|
|
13
|
-
export const ymlSourceGlob = Project.
|
|
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
|
*/
|
package/src/typegen/jsdoc.d.ts
CHANGED
|
@@ -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
|
|