@kazupon/eslint-config 0.34.0 → 0.35.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 CHANGED
@@ -99,6 +99,11 @@ interface CommentsRules {
99
99
  */
100
100
  "@kazupon/no-tag-comments"?: Linter.RuleEntry<KazuponNoTagComments>;
101
101
  /**
102
+ * enforce the use of inline code for specific words on comments
103
+ * @see https://eslint-plugin.kazupon.dev/rules/prefer-inline-code-words-comments
104
+ */
105
+ "@kazupon/prefer-inline-code-words-comments"?: Linter.RuleEntry<KazuponPreferInlineCodeWordsComments>;
106
+ /**
102
107
  * enforce adding a scope to tag comments
103
108
  * @see https://eslint-plugin.kazupon.dev/rules/prefer-scope-on-tag-comment
104
109
  */
@@ -123,6 +128,10 @@ type EslintCommunityEslintCommentsRequireDescription = [] | [{
123
128
  type KazuponNoTagComments = [] | [{
124
129
  tags?: [string, ...(string)[]];
125
130
  }];
131
+ // ----- @kazupon/prefer-inline-code-words-comments -----
132
+ type KazuponPreferInlineCodeWordsComments = [] | [{
133
+ words: string[];
134
+ }];
126
135
  // ----- @kazupon/prefer-scope-on-tag-comment -----
127
136
  type KazuponPreferScopeOnTagComment = [] | [{
128
137
  tags?: [string, ...(string)[]];
@@ -5352,7 +5361,7 @@ interface MarkdownRules {
5352
5361
  */
5353
5362
  "markdown-preferences/no-text-backslash-linebreak"?: Linter.RuleEntry<[]>;
5354
5363
  /**
5355
- * trailing whitespace at the end of lines in Markdown files.
5364
+ * disallow trailing whitespace at the end of lines in Markdown files.
5356
5365
  * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-trailing-spaces.html
5357
5366
  */
5358
5367
  "markdown-preferences/no-trailing-spaces"?: Linter.RuleEntry<MarkdownPreferencesNoTrailingSpaces>;
@@ -5470,6 +5479,13 @@ type MarkdownPreferencesNoTrailingSpaces = [] | [{
5470
5479
  // ----- markdown-preferences/prefer-inline-code-words -----
5471
5480
  type MarkdownPreferencesPreferInlineCodeWords = [] | [{
5472
5481
  words: string[];
5482
+ ignores?: {
5483
+ words?: (string | string[]);
5484
+ node?: {
5485
+ [k: string]: unknown | undefined;
5486
+ };
5487
+ [k: string]: unknown | undefined;
5488
+ }[];
5473
5489
  [k: string]: unknown | undefined;
5474
5490
  }];
5475
5491
  // ----- markdown-preferences/prefer-linked-words -----
@@ -5477,6 +5493,13 @@ type MarkdownPreferencesPreferLinkedWords = [] | [{
5477
5493
  words: ({
5478
5494
  [k: string]: (string | null);
5479
5495
  } | string[]);
5496
+ ignores?: {
5497
+ words?: (string | string[]);
5498
+ node?: {
5499
+ [k: string]: unknown | undefined;
5500
+ };
5501
+ [k: string]: unknown | undefined;
5502
+ }[];
5480
5503
  [k: string]: unknown | undefined;
5481
5504
  }];
5482
5505
  // ----- markdown/fenced-code-language -----
@@ -15731,6 +15754,13 @@ interface CommentsOptions {
15731
15754
  * An options for `@kazupon/eslint-plugin` comment config
15732
15755
  */
15733
15756
  kazupon?: OverridesOptions<CommentsRules>;
15757
+ /**
15758
+ * enforce inline code for specific words on comments
15759
+ *
15760
+ * @see https://eslint-plugin.kazupon.dev/rules/prefer-inline-code-words-comments#options
15761
+ * @default []
15762
+ */
15763
+ inlineCodeWords?: string[];
15734
15764
  }
15735
15765
  /**
15736
15766
  * configure comments preset for the below plugins
@@ -15964,6 +15994,19 @@ interface MarkdownOptions {
15964
15994
  */
15965
15995
  inlineCodeWords?: string[];
15966
15996
  /**
15997
+ * ignore inline code words for back-quoted in markdown (`ignores` option of `markdown-preferences/prefer-inline-code-words`)
15998
+ *
15999
+ * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/prefer-inline-code-words.html#%F0%9F%94%A7-options
16000
+ * @default []
16001
+ */
16002
+ inlineCodeWordsIgnores?: {
16003
+ words?: string | string[];
16004
+ node?: {
16005
+ [k: string]: unknown | undefined;
16006
+ };
16007
+ [k: string]: unknown | undefined;
16008
+ }[];
16009
+ /**
15967
16010
  * detect linked words for linked in markdown (`words` option of `markdown-preferences/prefer-linked-words`)
15968
16011
  *
15969
16012
  * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/prefer-linked-words.html#%F0%9F%94%A7-options
@@ -15972,6 +16015,19 @@ interface MarkdownOptions {
15972
16015
  linkedWords?: {
15973
16016
  [k: string]: string | null;
15974
16017
  } | string[];
16018
+ /**
16019
+ * ignore linked words for linked in markdown (`ignores` option of `markdown-preferences/prefer-linked-words`)
16020
+ *
16021
+ * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/prefer-linked-words.html#%F0%9F%94%A7-options
16022
+ * @default []
16023
+ */
16024
+ linkedWordsIgnores?: {
16025
+ words?: string | string[];
16026
+ node?: {
16027
+ [k: string]: unknown | undefined;
16028
+ };
16029
+ [k: string]: unknown | undefined;
16030
+ }[];
15975
16031
  }
15976
16032
  // export const parserPlain: Linter.Parser = {
15977
16033
  // meta: {
package/dist/index.js CHANGED
@@ -112,6 +112,7 @@ async function comments(options = {}) {
112
112
  const kazupon = await loadPlugin("@kazupon/eslint-plugin");
113
113
  const directives = options.directives ?? {};
114
114
  const kazuponOptions = options.kazupon ?? {};
115
+ const inlineCodeWords = options.inlineCodeWords ?? [];
115
116
  return [{
116
117
  name: "@eslint-community/eslint-comments",
117
118
  ignores: directives.ignores ? [GLOB_MARKDOWN, ...directives.ignores] : [GLOB_MARKDOWN],
@@ -126,6 +127,7 @@ async function comments(options = {}) {
126
127
  ignores: [...config.ignores, ...kazuponOptions.ignores || []],
127
128
  rules: {
128
129
  ...config.rules,
130
+ "@kazupon/prefer-inline-code-words-comments": ["error", { words: inlineCodeWords }],
129
131
  ...kazuponOptions.rules
130
132
  }
131
133
  }))];
@@ -555,7 +557,7 @@ function jsoncSort() {
555
557
  * @returns {Promise<Linter.Config[]>} eslint flat configurations with `@eslint/markdown` and overrides
556
558
  */
557
559
  async function markdown(options = {}) {
558
- const { rules: overrideRules = {}, files = [GLOB_MARKDOWN], blockExtensions = [], preferences = true, inlineCodeWords = [], linkedWords = [] } = options;
560
+ const { rules: overrideRules = {}, files = [GLOB_MARKDOWN], blockExtensions = [], preferences = true, inlineCodeWords = [], inlineCodeWordsIgnores = [], linkedWords = [], linkedWordsIgnores = [] } = options;
559
561
  const language = options.language || "gfm";
560
562
  /**
561
563
  * TODO: remove this option
@@ -587,8 +589,14 @@ async function markdown(options = {}) {
587
589
  rules: {
588
590
  ...preferencesPlugin.configs.recommended.rules,
589
591
  "markdown-preferences/no-trailing-spaces": "error",
590
- "markdown-preferences/prefer-linked-words": ["error", { words: linkedWords }],
591
- "markdown-preferences/prefer-inline-code-words": ["error", { words: inlineCodeWords }]
592
+ "markdown-preferences/prefer-linked-words": ["error", {
593
+ words: linkedWords,
594
+ ignores: linkedWordsIgnores
595
+ }],
596
+ "markdown-preferences/prefer-inline-code-words": ["error", {
597
+ words: inlineCodeWords,
598
+ ignores: inlineCodeWordsIgnores
599
+ }]
592
600
  }
593
601
  });
594
602
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kazupon/eslint-config",
3
3
  "description": "ESLint config for @kazupon",
4
- "version": "0.34.0",
4
+ "version": "0.35.0",
5
5
  "author": {
6
6
  "email": "kawakazu80@gmail.com",
7
7
  "name": "kazuya kawaguchi"
@@ -51,7 +51,7 @@
51
51
  "dependencies": {
52
52
  "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
53
53
  "@eslint/js": "^9.32.0",
54
- "@kazupon/eslint-plugin": "^0.5.0",
54
+ "@kazupon/eslint-plugin": "^0.6.1",
55
55
  "@kazupon/jts-utils": "^0.6.0",
56
56
  "@stylistic/eslint-plugin": "^4.4.1",
57
57
  "eslint-flat-config-utils": "^2.1.0",
@@ -70,7 +70,7 @@
70
70
  "eslint-plugin-import": ">=2.31.0",
71
71
  "eslint-plugin-jsdoc": ">=51.0.0",
72
72
  "eslint-plugin-jsonc": ">=2.16.0",
73
- "eslint-plugin-markdown-preferences": ">=0.4.0",
73
+ "eslint-plugin-markdown-preferences": ">=0.5.0",
74
74
  "eslint-plugin-module-interop": ">=0.3.0",
75
75
  "eslint-plugin-promise": ">=6.4.0",
76
76
  "eslint-plugin-react": ">=7.35.0",
@@ -192,7 +192,7 @@
192
192
  "eslint-plugin-import": "^2.32.0",
193
193
  "eslint-plugin-jsdoc": "^52.0.0",
194
194
  "eslint-plugin-jsonc": "^2.20.1",
195
- "eslint-plugin-markdown-preferences": "^0.4.0",
195
+ "eslint-plugin-markdown-preferences": "^0.5.0",
196
196
  "eslint-plugin-module-interop": "^0.3.1",
197
197
  "eslint-plugin-promise": "^7.2.1",
198
198
  "eslint-plugin-react": "^7.37.5",