@w5s/eslint-config 3.3.3 → 3.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/eslint-config",
3
- "version": "3.3.3",
3
+ "version": "3.5.0",
4
4
  "description": "ESLint configuration presets",
5
5
  "keywords": [
6
6
  "eslint",
@@ -38,56 +38,30 @@
38
38
  "!**/__tests__/**"
39
39
  ],
40
40
  "scripts": {
41
- "build": "npx run-p \"build:*\"",
42
- "build:tsc": "node --experimental-strip-types scripts/typegen.ts && tsup",
43
- "clean": "npx run-p \"clean:*\"",
44
- "clean:tsc": "rm -rf dist",
45
- "docs": "node ../../markdown.mjs",
46
- "format": "npx run-p \"format:*\"",
47
- "format:src": "eslint . --fix",
48
- "lint": "npx run-p \"lint:*\"",
49
- "lint:src": "eslint .",
50
- "postpack": "npx clean-package restore",
51
- "prepack": "npx clean-package",
52
- "prepare": "npx run-p \"prepare:*\"",
53
- "prepare:empty": ":",
54
- "prepublishOnly": "npm run clean;npm run build",
55
- "spellcheck": "cspell --no-progress '**'",
56
- "test": "npx run-p \"test:*\"",
57
- "test:script": "scripts/test",
58
- "test_:rule-coverage": "eslint-find-rules --unused"
41
+ "postpack": "clean-package restore"
59
42
  },
60
43
  "dependencies": {
44
+ "@eslint/js": "^9.0.0",
45
+ "@eslint/markdown": "^7.0.0",
61
46
  "@stylistic/eslint-plugin": "^5.0.0",
62
47
  "@typescript-eslint/eslint-plugin": "^8.0.0",
63
48
  "@typescript-eslint/parser": "^8.0.0",
64
49
  "@vitest/eslint-plugin": "^1.0.0",
65
- "@w5s/dev": "^3.1.4",
66
- "@w5s/prettier-config": "^3.0.5",
50
+ "@w5s/dev": "^3.2.0",
51
+ "@w5s/prettier-config": "^3.1.0",
52
+ "eslint-merge-processors": "^2.0.0",
67
53
  "eslint-plugin-import": "~2.32.0",
68
- "eslint-plugin-jsdoc": "~62.6.1",
69
- "eslint-plugin-jsonc": "~2.21.1",
54
+ "eslint-plugin-jsdoc": "~62.7.0",
55
+ "eslint-plugin-jsonc": "~3.1.0",
70
56
  "eslint-plugin-n": "~17.24.0",
71
57
  "eslint-plugin-unicorn": "~63.0.0",
72
- "eslint-plugin-yml": "~2.0.2",
58
+ "eslint-plugin-yml": "~3.3.0",
73
59
  "find-up": "^8.0.0",
74
60
  "globals": "^17.0.0",
75
- "jsonc-eslint-parser": "^2.0.0",
61
+ "jsonc-eslint-parser": "^3.0.0",
76
62
  "parse-gitignore": "^2.0.0",
77
63
  "yaml-eslint-parser": "^2.0.0"
78
64
  },
79
- "devDependencies": {
80
- "@types/eslint": "9.6.1",
81
- "@types/parse-gitignore": "1.0.2",
82
- "@types/react": "19.2.14",
83
- "@typescript-eslint/parser": "8.56.0",
84
- "eslint": "9.39.2",
85
- "eslint-find-rules": "5.0.0",
86
- "eslint-typegen": "2.3.1",
87
- "react": "19.2.4",
88
- "vite": "7.3.1",
89
- "vitest": "4.0.18"
90
- },
91
65
  "peerDependencies": {
92
66
  "eslint": "9.x",
93
67
  "typescript": "4.x || 5.x"
@@ -100,7 +74,6 @@
100
74
  "optional": true
101
75
  }
102
76
  },
103
- "clean-package": "../../clean-package.config.mjs",
104
77
  "engines": {
105
78
  "node": ">=20.0.0"
106
79
  },
@@ -108,5 +81,5 @@
108
81
  "access": "public"
109
82
  },
110
83
  "sideEffect": false,
111
- "gitHead": "5ccfbd65c727dda6c5e119e5164d4af6916d83bb"
84
+ "gitHead": "8d96574cd89109fa8268a2c77601337ad871ef1e"
112
85
  }
package/src/config/es.ts CHANGED
@@ -4,8 +4,9 @@ import { Project } from '@w5s/dev';
4
4
  import { type PluginOptionsBase, type Config } from '../type.js';
5
5
  import type { RuleOptions } from '../typegen/jsonc.js';
6
6
  import { esRules } from '../rules/esRules.js';
7
+ import { esSourceGlob } from '../glob.js';
7
8
 
8
- const defaultFiles = [`**/${Project.extensionsToGlob(Project.queryExtensions(['javascript', 'javascriptreact']))}`];
9
+ const defaultFiles = [esSourceGlob];
9
10
 
10
11
  export async function es(options: es.Options) {
11
12
  const { rules = {} } = options;
@@ -1,10 +1,13 @@
1
1
  import { interopDefault } from '@w5s/dev';
2
2
  import { StylisticConfig, type PluginOptionsBase, type Config } from '../type.js';
3
3
  import type { RuleOptions } from '../typegen/jsdoc.js';
4
+ import { sourceGlob } from '../glob.js';
5
+
6
+ const defaultFiles = [sourceGlob];
4
7
 
5
8
  export async function jsdoc(options: jsdoc.Options = {}): Promise<readonly Config[]> {
6
9
  const [jsdocPlugin] = await Promise.all([interopDefault(import('eslint-plugin-jsdoc'))] as const);
7
- const { rules = {}, stylistic = true } = options;
10
+ const { files = defaultFiles, rules = {}, stylistic = true } = options;
8
11
  const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
9
12
 
10
13
  return [
@@ -16,6 +19,7 @@ export async function jsdoc(options: jsdoc.Options = {}): Promise<readonly Confi
16
19
  },
17
20
  {
18
21
  name: 'w5s/jsdoc/rules',
22
+ files,
19
23
  rules: {
20
24
  ...jsdocPlugin.configs['flat/recommended-typescript-flavor'].rules,
21
25
  'jsdoc/no-undefined-types': 'off', // https://github.com/gajus/eslint-plugin-jsdoc/issues/839
@@ -1,9 +1,10 @@
1
1
  /* cSpell:disable */
2
- import { interopDefault, Project } from '@w5s/dev';
2
+ import { interopDefault } from '@w5s/dev';
3
3
  import { StylisticConfig, type PluginOptionsBase, type Config } from '../type.js';
4
4
  import type { RuleOptions } from '../typegen/jsonc.js';
5
+ import { jsonSourceGlob } from '../glob.js';
5
6
 
6
- const defaultFiles = [`**/${Project.extensionsToGlob(['.json', '.json5', '.jsonc'])}`];
7
+ const defaultFiles = [jsonSourceGlob];
7
8
 
8
9
  export async function jsonc(options: jsonc.Options = {}): Promise<readonly Config[]> {
9
10
  const [jsoncPlugin, jsoncParser] = await Promise.all([
@@ -27,7 +28,7 @@ export async function jsonc(options: jsonc.Options = {}): Promise<readonly Confi
27
28
  },
28
29
  name: 'w5s/jsonc/rules',
29
30
  rules: {
30
- ...(jsoncPlugin.configs['flat/recommended-with-json'][0]?.rules),
31
+ ...jsoncPlugin.configs['flat/recommended-with-json'][0]?.rules,
31
32
  ...(stylisticEnabled
32
33
  ? {
33
34
  'jsonc/array-bracket-spacing': ['error', 'never'],
@@ -225,7 +226,6 @@ function sortPackageJson() {
225
226
  pathPattern: '^exports.*$',
226
227
  },
227
228
  ],
228
-
229
229
  },
230
230
  };
231
231
  }
@@ -0,0 +1,44 @@
1
+ import { interopDefault, Project } from '@w5s/dev';
2
+ import { mergeProcessors, processorPassThrough } from 'eslint-merge-processors';
3
+ import { StylisticConfig, type Config, type PluginOptionsBase } from '../type.js';
4
+ import type { RuleOptions } from '../typegen/markdown.js';
5
+
6
+ const defaultFiles = [`**/${Project.extensionsToGlob(Project.queryExtensions(['markdown']))}`];
7
+
8
+ export async function markdown(options: markdown.Options = {}) {
9
+ const [markdownPlugin] = await Promise.all([interopDefault(import('@eslint/markdown'))] as const);
10
+ const { language = 'markdown/gfm', files = defaultFiles, rules = {}, stylistic = true } = options;
11
+ const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
12
+
13
+ return [
14
+ {
15
+ name: 'w5s/markdown/setup',
16
+ plugins: {
17
+ markdown: markdownPlugin,
18
+ },
19
+ },
20
+ {
21
+ files,
22
+ language: language,
23
+ name: 'w5s/markdown/rules',
24
+ // eslint-disable-next-line ts/no-non-null-assertion
25
+ processor: mergeProcessors([markdownPlugin.processors!.markdown, processorPassThrough]),
26
+ rules: {
27
+ ...markdownPlugin.configs.recommended.at(0)?.rules,
28
+ ...(stylisticEnabled ? {} : {}),
29
+ ...rules,
30
+ },
31
+ },
32
+ ] as [Config, Config] satisfies Array<Config>;
33
+ }
34
+
35
+ export namespace markdown {
36
+ export type Rules = RuleOptions;
37
+
38
+ export interface Options extends PluginOptionsBase<Rules> {
39
+ /**
40
+ * Default to 'markdown/gfm' (Github Flavored Markdown)
41
+ */
42
+ language?: 'markdown/gfm' | 'markdown/commonmark';
43
+ }
44
+ }
package/src/config/ts.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  /* eslint-disable ts/no-non-null-assertion */
2
- import { ESLintConfig, interopDefault, Project } from '@w5s/dev';
2
+ import { ESLintConfig, interopDefault } from '@w5s/dev';
3
3
  import { StylisticConfig, type PluginOptionsBase, type Config } from '../type.js';
4
4
  import type { RuleOptions } from '../typegen/ts.js';
5
5
  import { tsRules } from '../rules/tsRules.js';
6
+ import { tsSourceGlob } from '../glob.js';
6
7
 
7
- const defaultFiles = [`**/${Project.extensionsToGlob(Project.queryExtensions(['typescript', 'typescriptreact']))}`];
8
+ const defaultFiles = [tsSourceGlob];
8
9
 
9
10
  export async function ts(options: ts.Options = {}) {
10
11
  const [tsPlugin, tsParser] = await Promise.all([
@@ -1,12 +1,13 @@
1
1
  import { interopDefault } from '@w5s/dev';
2
2
  import { StylisticConfig, type Config, type PluginOptionsBase } from '../type.js';
3
3
  import type { RuleOptions } from '../typegen/unicorn.js';
4
+ import { sourceGlob } from '../glob.js';
5
+
6
+ const defaultFiles = [sourceGlob];
4
7
 
5
8
  export async function unicorn(options: unicorn.Options = {}) {
6
- const [unicornPlugin] = await Promise.all([
7
- interopDefault(import('eslint-plugin-unicorn')),
8
- ] as const);
9
- const { rules = {}, stylistic = true } = options;
9
+ const [unicornPlugin] = await Promise.all([interopDefault(import('eslint-plugin-unicorn'))] as const);
10
+ const { files = defaultFiles, rules = {}, stylistic = true } = options;
10
11
  const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
11
12
 
12
13
  return [
@@ -18,8 +19,9 @@ export async function unicorn(options: unicorn.Options = {}) {
18
19
  },
19
20
  {
20
21
  name: 'w5s/unicorn/rules',
22
+ files,
21
23
  rules: {
22
- ...(unicornPlugin.configs.recommended?.rules),
24
+ ...unicornPlugin.configs.recommended?.rules,
23
25
  // Disabled for safety
24
26
  'unicorn/consistent-destructuring': 'off',
25
27
  'unicorn/consistent-function-scoping': 'off', // Too many false positive
@@ -44,9 +46,7 @@ export async function unicorn(options: unicorn.Options = {}) {
44
46
  'unicorn/prefer-set-has': 'off',
45
47
  'unicorn/prevent-abbreviations': 'off', // This rule is so dangerous : it potentially break code while fixing in many cases !!
46
48
  'unicorn/throw-new-error': 'off', // Creating errors with call signature is OK
47
- ...(stylisticEnabled
48
- ? {}
49
- : {}),
49
+ ...(stylisticEnabled ? {} : {}),
50
50
  ...rules,
51
51
  },
52
52
  },
package/src/config/yml.ts CHANGED
@@ -1,15 +1,12 @@
1
- /* eslint-disable ts/no-non-null-assertion */
2
- import { interopDefault, Project } from '@w5s/dev';
1
+ import { interopDefault } from '@w5s/dev';
3
2
  import { StylisticConfig, type Config, type PluginOptionsBase } from '../type.js';
4
3
  import type { RuleOptions } from '../typegen/yml.js';
4
+ import { ymlSourceGlob } from '../glob.js';
5
5
 
6
- const defaultFiles = [`**/${Project.extensionsToGlob(Project.queryExtensions(['yaml']))}`];
6
+ const defaultFiles = [ymlSourceGlob];
7
7
 
8
8
  export async function yml(options: yml.Options = {}) {
9
- const [ymlPlugin, ymlParser] = await Promise.all([
10
- interopDefault(import('eslint-plugin-yml')),
11
- interopDefault(import('yaml-eslint-parser')),
12
- ] as const);
9
+ const [ymlPlugin] = await Promise.all([interopDefault(import('eslint-plugin-yml'))] as const);
13
10
  const { files = defaultFiles, rules = {}, stylistic = true } = options;
14
11
  const { enabled: stylisticEnabled, indent, quotes } = StylisticConfig.from(stylistic);
15
12
 
@@ -22,26 +19,16 @@ export async function yml(options: yml.Options = {}) {
22
19
  },
23
20
  {
24
21
  files,
25
- languageOptions: {
26
- parser: ymlParser,
27
- },
22
+ language: 'yml/yaml',
28
23
  name: 'w5s/yml/rules',
29
24
  rules: {
30
- ...(ymlPlugin.configs['flat/recommended'][0]!.rules),
31
- ...(ymlPlugin.configs['flat/recommended'][1]!.rules),
32
- ...(ymlPlugin.configs['flat/recommended'][2]!.rules),
25
+ ...ymlPlugin.configs['recommended'].reduce(
26
+ (acc, config) => ({ ...acc, ...config.rules }),
27
+ // eslint-disable-next-line ts/consistent-type-assertions
28
+ {} as RuleOptions,
29
+ ),
33
30
  ...(stylisticEnabled
34
31
  ? {
35
- // ...(ymlPlugin.configs['flat/standard'][3]!.rules),
36
- // 'yml/array-bracket-spacing': ['error', 'never'],
37
- // 'yml/comma-dangle': ['error', 'never'],
38
- // 'yml/comma-style': ['error', 'last'],
39
-
40
- // 'yml/object-curly-newline': ['error', { consistent: true, multiline: true }],
41
- // 'yml/object-curly-spacing': ['error', 'always'],
42
- // 'yml/object-property-newline': ['error', { allowMultiplePropertiesPerLine: true }],
43
- // 'yml/quote-props': 'error',
44
-
45
32
  'style/spaced-comment': 'off', // Fix
46
33
 
47
34
  'yml/block-mapping-question-indicator-newline': 'error',
@@ -53,7 +40,10 @@ export async function yml(options: yml.Options = {}) {
53
40
  'yml/indent': ['error', indent === 'tab' ? 2 : indent],
54
41
  'yml/key-spacing': ['error', { afterColon: true, beforeColon: false }],
55
42
  'yml/no-tab-indent': 'error',
56
- 'yml/quotes': ['error', { avoidEscape: true, prefer: quotes === 'backtick' ? 'single' as const : quotes }],
43
+ 'yml/quotes': [
44
+ 'error',
45
+ { avoidEscape: true, prefer: quotes === 'backtick' ? ('single' as const) : quotes },
46
+ ],
57
47
  'yml/spaced-comment': 'error',
58
48
  }
59
49
  : {}),
package/src/config.ts CHANGED
@@ -3,6 +3,7 @@ export * from './config/ignores.js';
3
3
  export * from './config/jsdoc.js';
4
4
  export * from './config/jsonc.js';
5
5
  export * from './config/imports.js';
6
+ export * from './config/markdown.js';
6
7
  export * from './config/node.js';
7
8
  export * from './config/stylistic.js';
8
9
  export * from './config/test.js';
@@ -1,9 +1,10 @@
1
- import { jsdoc, jsonc, ignores, imports, node, ts, yml, unicorn, stylistic, es } from './config.js';
1
+ import { jsdoc, jsonc, ignores, imports, markdown, node, ts, yml, unicorn, stylistic, es } from './config.js';
2
2
  import type { Config } from './type.js';
3
3
 
4
4
  export interface DefineConfigOptions extends ignores.Options {
5
5
  es?: boolean | es.Options;
6
6
  import?: boolean | imports.Options;
7
+ markdown?: boolean | markdown.Options;
7
8
  jsdoc?: boolean | jsdoc.Options;
8
9
  jsonc?: boolean | jsonc.Options;
9
10
  node?: boolean | node.Options;
@@ -27,6 +28,7 @@ export async function defineConfig(options: DefineConfigOptions = {}) {
27
28
  const importOptions = toOption(options.import);
28
29
  const jsdocOptions = toOption(options.jsdoc);
29
30
  const jsoncOptions = toOption(options.jsonc);
31
+ const markdownOptions = toOption(options.markdown);
30
32
  const nodeOptions = toOption(options.node);
31
33
  const tsOptions = toOption(options.ts);
32
34
  const unicornOptions = toOption(options.unicorn);
@@ -51,6 +53,9 @@ export async function defineConfig(options: DefineConfigOptions = {}) {
51
53
  if (importOptions.enabled) {
52
54
  append(imports(importOptions));
53
55
  }
56
+ if (markdownOptions.enabled) {
57
+ append(markdown(markdownOptions));
58
+ }
54
59
  if (nodeOptions.enabled) {
55
60
  append(node(nodeOptions));
56
61
  }
package/src/glob.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { Project } from '@w5s/dev';
2
+
3
+ export const sourceGlob = `**/${Project.extensionsToGlob(Project.sourceExtensions())}`;
4
+
5
+ export const esSourceGlob = `**/${Project.extensionsToGlob(Project.queryExtensions(['javascript', 'javascriptreact']))}`;
6
+
7
+ export const jsonSourceGlob = `**/${Project.extensionsToGlob(['.json', '.json5', '.jsonc'])}`;
8
+
9
+ export const tsSourceGlob = `**/${Project.extensionsToGlob(Project.queryExtensions(['typescript', 'typescriptreact']))}`;
10
+
11
+ export const ymlSourceGlob = `**/${Project.extensionsToGlob(Project.queryExtensions(['yaml']))}`;
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './defineConfig.js';
2
2
  export * from './config.js';
3
+ export * from './meta.js';
3
4
  export * from './type.js';
4
5
  export { defineConfig as default } from './defineConfig.js';
package/src/meta.ts ADDED
@@ -0,0 +1,8 @@
1
+ export const meta = Object.freeze({
2
+ // @ts-ignore - these variables are injected at build time
3
+ name: (typeof __PACKAGE_NAME__ === 'undefined' ? '' : __PACKAGE_NAME__) as string,
4
+ // @ts-ignore - these variables are injected at build time
5
+ version: (typeof __PACKAGE_VERSION__ === 'undefined' ? '' : __PACKAGE_VERSION__) as string,
6
+ // @ts-ignore - these variables are injected at build time
7
+ buildNumber: 1 as number, // (typeof __PACKAGE_BUILD_NUMBER__ === 'undefined' ? 0 : __PACKAGE_BUILD_NUMBER__) as number,
8
+ });
@@ -399,6 +399,7 @@ type JsoncObjectCurlyNewline = []|[((("always" | "never") | {
399
399
  type JsoncObjectCurlySpacing = []|[("always" | "never")]|[("always" | "never"), {
400
400
  arraysInObjects?: boolean
401
401
  objectsInObjects?: boolean
402
+ emptyObjects?: ("ignore" | "always" | "never")
402
403
  }]
403
404
  // ----- jsonc/object-property-newline -----
404
405
  type JsoncObjectPropertyNewline = []|[{
@@ -0,0 +1,172 @@
1
+ /* eslint-disable */
2
+ /* prettier-ignore */
3
+ import type { Linter } from 'eslint'
4
+
5
+ declare module 'eslint' {
6
+ namespace Linter {
7
+ interface RulesRecord extends RuleOptions {}
8
+ }
9
+ }
10
+
11
+ export interface RuleOptions {
12
+ /**
13
+ * Require languages for fenced code blocks
14
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/fenced-code-language.md
15
+ */
16
+ 'markdown/fenced-code-language'?: Linter.RuleEntry<MarkdownFencedCodeLanguage>
17
+ /**
18
+ * Enforce heading levels increment by one
19
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/heading-increment.md
20
+ */
21
+ 'markdown/heading-increment'?: Linter.RuleEntry<MarkdownHeadingIncrement>
22
+ /**
23
+ * Disallow bare URLs
24
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-bare-urls.md
25
+ */
26
+ 'markdown/no-bare-urls'?: Linter.RuleEntry<[]>
27
+ /**
28
+ * Disallow duplicate definitions
29
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-duplicate-definitions.md
30
+ */
31
+ 'markdown/no-duplicate-definitions'?: Linter.RuleEntry<MarkdownNoDuplicateDefinitions>
32
+ /**
33
+ * Disallow duplicate headings in the same document
34
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-duplicate-headings.md
35
+ */
36
+ 'markdown/no-duplicate-headings'?: Linter.RuleEntry<MarkdownNoDuplicateHeadings>
37
+ /**
38
+ * Disallow empty definitions
39
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-empty-definitions.md
40
+ */
41
+ 'markdown/no-empty-definitions'?: Linter.RuleEntry<MarkdownNoEmptyDefinitions>
42
+ /**
43
+ * Disallow empty images
44
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-empty-images.md
45
+ */
46
+ 'markdown/no-empty-images'?: Linter.RuleEntry<[]>
47
+ /**
48
+ * Disallow empty links
49
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-empty-links.md
50
+ */
51
+ 'markdown/no-empty-links'?: Linter.RuleEntry<[]>
52
+ /**
53
+ * Disallow HTML tags
54
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-html.md
55
+ */
56
+ 'markdown/no-html'?: Linter.RuleEntry<MarkdownNoHtml>
57
+ /**
58
+ * Disallow invalid label references
59
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-invalid-label-refs.md
60
+ */
61
+ 'markdown/no-invalid-label-refs'?: Linter.RuleEntry<[]>
62
+ /**
63
+ * Disallow headings without a space after the hash characters
64
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-missing-atx-heading-space.md
65
+ */
66
+ 'markdown/no-missing-atx-heading-space'?: Linter.RuleEntry<MarkdownNoMissingAtxHeadingSpace>
67
+ /**
68
+ * Disallow missing label references
69
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-missing-label-refs.md
70
+ */
71
+ 'markdown/no-missing-label-refs'?: Linter.RuleEntry<MarkdownNoMissingLabelRefs>
72
+ /**
73
+ * Disallow link fragments that do not reference valid headings
74
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-missing-link-fragments.md
75
+ */
76
+ 'markdown/no-missing-link-fragments'?: Linter.RuleEntry<MarkdownNoMissingLinkFragments>
77
+ /**
78
+ * Disallow multiple H1 headings in the same document
79
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-multiple-h1.md
80
+ */
81
+ 'markdown/no-multiple-h1'?: Linter.RuleEntry<MarkdownNoMultipleH1>
82
+ /**
83
+ * Disallow URLs that match defined reference identifiers
84
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-reference-like-urls.md
85
+ */
86
+ 'markdown/no-reference-like-urls'?: Linter.RuleEntry<[]>
87
+ /**
88
+ * Disallow reversed link and image syntax
89
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-reversed-media-syntax.md
90
+ */
91
+ 'markdown/no-reversed-media-syntax'?: Linter.RuleEntry<[]>
92
+ /**
93
+ * Disallow spaces around emphasis markers
94
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-space-in-emphasis.md
95
+ */
96
+ 'markdown/no-space-in-emphasis'?: Linter.RuleEntry<MarkdownNoSpaceInEmphasis>
97
+ /**
98
+ * Disallow unused definitions
99
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-unused-definitions.md
100
+ */
101
+ 'markdown/no-unused-definitions'?: Linter.RuleEntry<MarkdownNoUnusedDefinitions>
102
+ /**
103
+ * Require alternative text for images
104
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/require-alt-text.md
105
+ */
106
+ 'markdown/require-alt-text'?: Linter.RuleEntry<[]>
107
+ /**
108
+ * Disallow data rows in a GitHub Flavored Markdown table from having more cells than the header row
109
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/table-column-count.md
110
+ */
111
+ 'markdown/table-column-count'?: Linter.RuleEntry<MarkdownTableColumnCount>
112
+ }
113
+
114
+ /* ======= Declarations ======= */
115
+ // ----- markdown/fenced-code-language -----
116
+ type MarkdownFencedCodeLanguage = []|[{
117
+ required?: string[]
118
+ }]
119
+ // ----- markdown/heading-increment -----
120
+ type MarkdownHeadingIncrement = []|[{
121
+ frontmatterTitle?: string
122
+ }]
123
+ // ----- markdown/no-duplicate-definitions -----
124
+ type MarkdownNoDuplicateDefinitions = []|[{
125
+ allowDefinitions?: string[]
126
+ allowFootnoteDefinitions?: string[]
127
+ }]
128
+ // ----- markdown/no-duplicate-headings -----
129
+ type MarkdownNoDuplicateHeadings = []|[{
130
+ checkSiblingsOnly?: boolean
131
+ }]
132
+ // ----- markdown/no-empty-definitions -----
133
+ type MarkdownNoEmptyDefinitions = []|[{
134
+ allowDefinitions?: string[]
135
+ allowFootnoteDefinitions?: string[]
136
+ checkFootnoteDefinitions?: boolean
137
+ }]
138
+ // ----- markdown/no-html -----
139
+ type MarkdownNoHtml = []|[{
140
+ allowed?: string[]
141
+ allowedIgnoreCase?: boolean
142
+ }]
143
+ // ----- markdown/no-missing-atx-heading-space -----
144
+ type MarkdownNoMissingAtxHeadingSpace = []|[{
145
+ checkClosedHeadings?: boolean
146
+ }]
147
+ // ----- markdown/no-missing-label-refs -----
148
+ type MarkdownNoMissingLabelRefs = []|[{
149
+ allowLabels?: string[]
150
+ }]
151
+ // ----- markdown/no-missing-link-fragments -----
152
+ type MarkdownNoMissingLinkFragments = []|[{
153
+ ignoreCase?: boolean
154
+ allowPattern?: string
155
+ }]
156
+ // ----- markdown/no-multiple-h1 -----
157
+ type MarkdownNoMultipleH1 = []|[{
158
+ frontmatterTitle?: string
159
+ }]
160
+ // ----- markdown/no-space-in-emphasis -----
161
+ type MarkdownNoSpaceInEmphasis = []|[{
162
+ checkStrikethrough?: boolean
163
+ }]
164
+ // ----- markdown/no-unused-definitions -----
165
+ type MarkdownNoUnusedDefinitions = []|[{
166
+ allowDefinitions?: string[]
167
+ allowFootnoteDefinitions?: string[]
168
+ }]
169
+ // ----- markdown/table-column-count -----
170
+ type MarkdownTableColumnCount = []|[{
171
+ checkMissingCells?: boolean
172
+ }]
@@ -696,33 +696,33 @@ type StyleExpListStyle = []|[{
696
696
  singleLine?: _StyleExpListStyle_SingleLineConfig
697
697
  multiLine?: _StyleExpListStyle_MultiLineConfig
698
698
  overrides?: {
699
- "()"?: _StyleExpListStyle_BaseConfig
700
- "[]"?: _StyleExpListStyle_BaseConfig
701
- "{}"?: _StyleExpListStyle_BaseConfig
702
- "<>"?: _StyleExpListStyle_BaseConfig
703
- ArrayExpression?: _StyleExpListStyle_BaseConfig
704
- ArrayPattern?: _StyleExpListStyle_BaseConfig
705
- ArrowFunctionExpression?: _StyleExpListStyle_BaseConfig
706
- CallExpression?: _StyleExpListStyle_BaseConfig
707
- ExportNamedDeclaration?: _StyleExpListStyle_BaseConfig
708
- FunctionDeclaration?: _StyleExpListStyle_BaseConfig
709
- FunctionExpression?: _StyleExpListStyle_BaseConfig
710
- IfStatement?: _StyleExpListStyle_BaseConfig
711
- ImportAttributes?: _StyleExpListStyle_BaseConfig
712
- ImportDeclaration?: _StyleExpListStyle_BaseConfig
713
- JSONArrayExpression?: _StyleExpListStyle_BaseConfig
714
- JSONObjectExpression?: _StyleExpListStyle_BaseConfig
715
- NewExpression?: _StyleExpListStyle_BaseConfig
716
- ObjectExpression?: _StyleExpListStyle_BaseConfig
717
- ObjectPattern?: _StyleExpListStyle_BaseConfig
718
- TSDeclareFunction?: _StyleExpListStyle_BaseConfig
719
- TSEnumBody?: _StyleExpListStyle_BaseConfig
720
- TSFunctionType?: _StyleExpListStyle_BaseConfig
721
- TSInterfaceBody?: _StyleExpListStyle_BaseConfig
722
- TSTupleType?: _StyleExpListStyle_BaseConfig
723
- TSTypeLiteral?: _StyleExpListStyle_BaseConfig
724
- TSTypeParameterDeclaration?: _StyleExpListStyle_BaseConfig
725
- TSTypeParameterInstantiation?: _StyleExpListStyle_BaseConfig
699
+ "()"?: (_StyleExpListStyle_BaseConfig | "off")
700
+ "[]"?: (_StyleExpListStyle_BaseConfig | "off")
701
+ "{}"?: (_StyleExpListStyle_BaseConfig | "off")
702
+ "<>"?: (_StyleExpListStyle_BaseConfig | "off")
703
+ ArrayExpression?: (_StyleExpListStyle_BaseConfig | "off")
704
+ ArrayPattern?: (_StyleExpListStyle_BaseConfig | "off")
705
+ ArrowFunctionExpression?: (_StyleExpListStyle_BaseConfig | "off")
706
+ CallExpression?: (_StyleExpListStyle_BaseConfig | "off")
707
+ ExportNamedDeclaration?: (_StyleExpListStyle_BaseConfig | "off")
708
+ FunctionDeclaration?: (_StyleExpListStyle_BaseConfig | "off")
709
+ FunctionExpression?: (_StyleExpListStyle_BaseConfig | "off")
710
+ IfStatement?: (_StyleExpListStyle_BaseConfig | "off")
711
+ ImportAttributes?: (_StyleExpListStyle_BaseConfig | "off")
712
+ ImportDeclaration?: (_StyleExpListStyle_BaseConfig | "off")
713
+ JSONArrayExpression?: (_StyleExpListStyle_BaseConfig | "off")
714
+ JSONObjectExpression?: (_StyleExpListStyle_BaseConfig | "off")
715
+ NewExpression?: (_StyleExpListStyle_BaseConfig | "off")
716
+ ObjectExpression?: (_StyleExpListStyle_BaseConfig | "off")
717
+ ObjectPattern?: (_StyleExpListStyle_BaseConfig | "off")
718
+ TSDeclareFunction?: (_StyleExpListStyle_BaseConfig | "off")
719
+ TSEnumBody?: (_StyleExpListStyle_BaseConfig | "off")
720
+ TSFunctionType?: (_StyleExpListStyle_BaseConfig | "off")
721
+ TSInterfaceBody?: (_StyleExpListStyle_BaseConfig | "off")
722
+ TSTupleType?: (_StyleExpListStyle_BaseConfig | "off")
723
+ TSTypeLiteral?: (_StyleExpListStyle_BaseConfig | "off")
724
+ TSTypeParameterDeclaration?: (_StyleExpListStyle_BaseConfig | "off")
725
+ TSTypeParameterInstantiation?: (_StyleExpListStyle_BaseConfig | "off")
726
726
  }
727
727
  }]
728
728
  interface _StyleExpListStyle_SingleLineConfig {
@@ -1640,13 +1640,18 @@ type StylePaddedBlocks = []|[(("always" | "never" | "start" | "end") | {
1640
1640
  }]
1641
1641
  // ----- style/padding-line-between-statements -----
1642
1642
  type _StylePaddingLineBetweenStatementsPaddingType = ("any" | "never" | "always")
1643
- type _StylePaddingLineBetweenStatementsStatementOption = (_StylePaddingLineBetweenStatementsStatementType | [_StylePaddingLineBetweenStatementsStatementType, ...(_StylePaddingLineBetweenStatementsStatementType)[]])
1643
+ type _StylePaddingLineBetweenStatementsStatementOption = (_StylePaddingLineBetweenStatementsStatementMatcher | [_StylePaddingLineBetweenStatementsStatementMatcher, ...(_StylePaddingLineBetweenStatementsStatementMatcher)[]])
1644
+ type _StylePaddingLineBetweenStatementsStatementMatcher = (_StylePaddingLineBetweenStatementsStatementType | _StylePaddingLineBetweenStatements_SelectorOption)
1644
1645
  type _StylePaddingLineBetweenStatementsStatementType = ("*" | "exports" | "require" | "directive" | "iife" | "block" | "empty" | "function" | "ts-method" | "break" | "case" | "class" | "continue" | "debugger" | "default" | "do" | "for" | "if" | "import" | "switch" | "throw" | "try" | "while" | "with" | "cjs-export" | "cjs-import" | "enum" | "interface" | "function-overload" | "block-like" | "singleline-block-like" | "multiline-block-like" | "expression" | "singleline-expression" | "multiline-expression" | "return" | "singleline-return" | "multiline-return" | "export" | "singleline-export" | "multiline-export" | "var" | "singleline-var" | "multiline-var" | "let" | "singleline-let" | "multiline-let" | "const" | "singleline-const" | "multiline-const" | "using" | "singleline-using" | "multiline-using" | "type" | "singleline-type" | "multiline-type")
1645
1646
  type StylePaddingLineBetweenStatements = {
1646
1647
  blankLine: _StylePaddingLineBetweenStatementsPaddingType
1647
1648
  prev: _StylePaddingLineBetweenStatementsStatementOption
1648
1649
  next: _StylePaddingLineBetweenStatementsStatementOption
1649
1650
  }[]
1651
+ interface _StylePaddingLineBetweenStatements_SelectorOption {
1652
+ selector: string
1653
+ lineMode?: ("any" | "singleline" | "multiline")
1654
+ }
1650
1655
  // ----- style/quote-props -----
1651
1656
  type StyleQuoteProps = ([]|[("always" | "as-needed" | "consistent" | "consistent-as-needed")] | []|[("always" | "as-needed" | "consistent" | "consistent-as-needed")]|[("always" | "as-needed" | "consistent" | "consistent-as-needed"), {
1652
1657
  keywords?: boolean