@kazupon/eslint-config 0.42.0 → 0.44.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.mts CHANGED
@@ -5845,6 +5845,16 @@ interface MarkdownRules {
5845
5845
  */
5846
5846
  "markdown-preferences/list-marker-alignment"?: Linter.RuleEntry<MarkdownPreferencesListMarkerAlignment>;
5847
5847
  /**
5848
+ * enforce maximum length for various Markdown entities
5849
+ * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/max-len.html
5850
+ */
5851
+ "markdown-preferences/max-len"?: Linter.RuleEntry<MarkdownPreferencesMaxLen>;
5852
+ /**
5853
+ * disallow trailing punctuation in headings.
5854
+ * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-heading-trailing-punctuation.html
5855
+ */
5856
+ "markdown-preferences/no-heading-trailing-punctuation"?: Linter.RuleEntry<MarkdownPreferencesNoHeadingTrailingPunctuation>;
5857
+ /**
5848
5858
  * disallow implicit block closing for fenced code blocks, math blocks, and custom containers
5849
5859
  * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-implicit-block-closing.html
5850
5860
  */
@@ -5865,7 +5875,7 @@ interface MarkdownRules {
5865
5875
  */
5866
5876
  "markdown-preferences/no-multiple-empty-lines"?: Linter.RuleEntry<MarkdownPreferencesNoMultipleEmptyLines>;
5867
5877
  /**
5868
- * Disallow tab characters in Markdown files.
5878
+ * disallow tab characters in Markdown files.
5869
5879
  * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-tabs.html
5870
5880
  */
5871
5881
  "markdown-preferences/no-tabs"?: Linter.RuleEntry<MarkdownPreferencesNoTabs>;
@@ -5880,10 +5890,10 @@ interface MarkdownRules {
5880
5890
  */
5881
5891
  "markdown-preferences/no-trailing-spaces"?: Linter.RuleEntry<MarkdownPreferencesNoTrailingSpaces>;
5882
5892
  /**
5883
- * enforce that ordered list markers use sequential numbers
5893
+ * enforce consistent ordered list marker numbering (sequential or flat)
5884
5894
  * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/ordered-list-marker-sequence.html
5885
5895
  */
5886
- "markdown-preferences/ordered-list-marker-sequence"?: Linter.RuleEntry<[]>;
5896
+ "markdown-preferences/ordered-list-marker-sequence"?: Linter.RuleEntry<MarkdownPreferencesOrderedListMarkerSequence>;
5887
5897
  /**
5888
5898
  * enforce that ordered list markers start with 1 or 0
5889
5899
  * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/ordered-list-marker-start.html
@@ -6202,6 +6212,85 @@ type MarkdownPreferencesLinkTitleStyle = [] | [{
6202
6212
  type MarkdownPreferencesListMarkerAlignment = [] | [{
6203
6213
  align?: ("left" | "right");
6204
6214
  }];
6215
+ type MarkdownPreferencesMaxLen = [] | [{
6216
+ heading?: (number | "ignore");
6217
+ paragraph?: (number | "ignore");
6218
+ table?: (number | "ignore");
6219
+ html?: (number | "ignore");
6220
+ math?: (number | "ignore");
6221
+ code?: ((number | "ignore") | {
6222
+ [k: string]: (number | "ignore");
6223
+ });
6224
+ frontmatter?: ((number | "ignore") | {
6225
+ [k: string]: (number | "ignore");
6226
+ });
6227
+ list?: ((number | "ignore") | {
6228
+ heading?: (number | "ignore");
6229
+ paragraph?: (number | "ignore");
6230
+ table?: (number | "ignore");
6231
+ html?: (number | "ignore");
6232
+ math?: (number | "ignore");
6233
+ code?: ((number | "ignore") | {
6234
+ [k: string]: (number | "ignore");
6235
+ });
6236
+ frontmatter?: ((number | "ignore") | {
6237
+ [k: string]: (number | "ignore");
6238
+ });
6239
+ });
6240
+ blockquote?: ((number | "ignore") | {
6241
+ heading?: (number | "ignore");
6242
+ paragraph?: (number | "ignore");
6243
+ table?: (number | "ignore");
6244
+ html?: (number | "ignore");
6245
+ math?: (number | "ignore");
6246
+ code?: ((number | "ignore") | {
6247
+ [k: string]: (number | "ignore");
6248
+ });
6249
+ frontmatter?: ((number | "ignore") | {
6250
+ [k: string]: (number | "ignore");
6251
+ });
6252
+ });
6253
+ footnoteDefinition?: ((number | "ignore") | {
6254
+ heading?: (number | "ignore");
6255
+ paragraph?: (number | "ignore");
6256
+ table?: (number | "ignore");
6257
+ html?: (number | "ignore");
6258
+ math?: (number | "ignore");
6259
+ code?: ((number | "ignore") | {
6260
+ [k: string]: (number | "ignore");
6261
+ });
6262
+ frontmatter?: ((number | "ignore") | {
6263
+ [k: string]: (number | "ignore");
6264
+ });
6265
+ });
6266
+ ignoreUrls?: boolean;
6267
+ }];
6268
+ type MarkdownPreferencesNoHeadingTrailingPunctuation = [] | [{
6269
+ punctuation?: (string | {
6270
+ "1"?: string;
6271
+ "2"?: string;
6272
+ "3"?: string;
6273
+ "4"?: string;
6274
+ "5"?: string;
6275
+ "6"?: string;
6276
+ default?: string;
6277
+ "1-2"?: string;
6278
+ "1-3"?: string;
6279
+ "1-4"?: string;
6280
+ "1-5"?: string;
6281
+ "1-6"?: string;
6282
+ "2-3"?: string;
6283
+ "2-4"?: string;
6284
+ "2-5"?: string;
6285
+ "2-6"?: string;
6286
+ "3-4"?: string;
6287
+ "3-5"?: string;
6288
+ "3-6"?: string;
6289
+ "4-5"?: string;
6290
+ "4-6"?: string;
6291
+ "5-6"?: string;
6292
+ });
6293
+ }];
6205
6294
  type MarkdownPreferencesNoMultipleEmptyLines = [] | [{
6206
6295
  max?: number;
6207
6296
  maxEOF?: number;
@@ -6216,6 +6305,9 @@ type MarkdownPreferencesNoTrailingSpaces = [] | [{
6216
6305
  skipBlankLines?: boolean;
6217
6306
  ignoreComments?: boolean;
6218
6307
  }];
6308
+ type MarkdownPreferencesOrderedListMarkerSequence = [] | [{
6309
+ increment?: ("always" | "never");
6310
+ }];
6219
6311
  type MarkdownPreferencesOrderedListMarkerStart = [] | [{
6220
6312
  start?: (1 | 0);
6221
6313
  }];
@@ -10926,6 +11018,11 @@ interface TypescriptRules {
10926
11018
  */
10927
11019
  "@typescript-eslint/no-useless-constructor"?: Linter.RuleEntry<[]>;
10928
11020
  /**
11021
+ * Disallow default values that will never be used
11022
+ * @see https://typescript-eslint.io/rules/no-useless-default-assignment
11023
+ */
11024
+ "@typescript-eslint/no-useless-default-assignment"?: Linter.RuleEntry<[]>;
11025
+ /**
10929
11026
  * Disallow empty exports that don't change anything in a module file
10930
11027
  * @see https://typescript-eslint.io/rules/no-useless-empty-export
10931
11028
  */
@@ -13049,6 +13146,11 @@ interface VitestRules {
13049
13146
  */
13050
13147
  "vitest/no-test-return-statement"?: Linter.RuleEntry<[]>;
13051
13148
  /**
13149
+ * Disallow unnecessary async function wrapper for expected promises
13150
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-unneeded-async-expect-function.md
13151
+ */
13152
+ "vitest/no-unneeded-async-expect-function"?: Linter.RuleEntry<[]>;
13153
+ /**
13052
13154
  * Enforce padding around `afterAll` blocks
13053
13155
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-all-blocks.md
13054
13156
  */
@@ -13157,7 +13259,7 @@ interface VitestRules {
13157
13259
  * prefer dynamic import in mock
13158
13260
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-import-in-mock.md
13159
13261
  */
13160
- "vitest/prefer-import-in-mock"?: Linter.RuleEntry<[]>;
13262
+ "vitest/prefer-import-in-mock"?: Linter.RuleEntry<VitestPreferImportInMock>;
13161
13263
  /**
13162
13264
  * enforce importing Vitest globals
13163
13265
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-importing-vitest-globals.md
@@ -13174,6 +13276,11 @@ interface VitestRules {
13174
13276
  */
13175
13277
  "vitest/prefer-mock-promise-shorthand"?: Linter.RuleEntry<[]>;
13176
13278
  /**
13279
+ * Prefer mock return shorthands
13280
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-mock-return-shorthand.md
13281
+ */
13282
+ "vitest/prefer-mock-return-shorthand"?: Linter.RuleEntry<[]>;
13283
+ /**
13177
13284
  * enforce including a hint with external snapshots
13178
13285
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-snapshot-hint.md
13179
13286
  */
@@ -13219,6 +13326,11 @@ interface VitestRules {
13219
13326
  */
13220
13327
  "vitest/prefer-to-contain"?: Linter.RuleEntry<[]>;
13221
13328
  /**
13329
+ * Suggest using `toHaveBeenCalledTimes()`
13330
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-been-called-times.md
13331
+ */
13332
+ "vitest/prefer-to-have-been-called-times"?: Linter.RuleEntry<[]>;
13333
+ /**
13222
13334
  * enforce using toHaveLength()
13223
13335
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-length.md
13224
13336
  */
@@ -13244,11 +13356,6 @@ interface VitestRules {
13244
13356
  */
13245
13357
  "vitest/require-hook"?: Linter.RuleEntry<VitestRequireHook>;
13246
13358
  /**
13247
- * require usage of import in vi.mock()
13248
- * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-import-vi-mock.md
13249
- */
13250
- "vitest/require-import-vi-mock"?: Linter.RuleEntry<[]>;
13251
- /**
13252
13359
  * require local Test Context for concurrent snapshot tests
13253
13360
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-local-test-context-for-concurrent-snapshots.md
13254
13361
  */
@@ -13348,6 +13455,9 @@ type VitestPreferExpectAssertions = [] | [{
13348
13455
  onlyFunctionsWithExpectInLoop?: boolean;
13349
13456
  onlyFunctionsWithExpectInCallback?: boolean;
13350
13457
  }];
13458
+ type VitestPreferImportInMock = [] | [{
13459
+ fixable?: boolean;
13460
+ }];
13351
13461
  type VitestPreferLowercaseTitle = [] | [{
13352
13462
  ignore?: ("describe" | "test" | "it")[];
13353
13463
  allowedPrefixes?: string[];
@@ -16448,7 +16558,7 @@ interface CommentsOptions {
16448
16558
  /**
16449
16559
  * An options for `@kazupon/eslint-plugin` comment config
16450
16560
  */
16451
- kazupon?: OverridesOptions<CommentsRules>;
16561
+ kazupon?: OverridesOptions<CommentsRules> | false;
16452
16562
  /**
16453
16563
  * enforce inline code for specific words on comments
16454
16564
  *
@@ -16796,6 +16906,14 @@ interface TypeScriptOptions {
16796
16906
  * typescript-eslint parser options
16797
16907
  */
16798
16908
  parserOptions?: TypeScriptParserOptions;
16909
+ /**
16910
+ * typescript-eslint base preset only
16911
+ *
16912
+ * if you want to use with oxlint, set `true`
16913
+ *
16914
+ * @default false
16915
+ */
16916
+ baseOnly?: boolean;
16799
16917
  }
16800
16918
  /**
16801
16919
  * TypeScript parser options
package/dist/index.mjs CHANGED
@@ -136,7 +136,7 @@ async function comments(options = {}) {
136
136
  const directives = options.directives ?? {};
137
137
  const kazuponOptions = options.kazupon ?? {};
138
138
  const inlineCodeWords = options.inlineCodeWords ?? [];
139
- return [{
139
+ const configs = [{
140
140
  name: "@eslint-community/eslint-comments",
141
141
  ignores: directives.ignores ? [GLOB_MARKDOWN, ...directives.ignores] : [GLOB_MARKDOWN],
142
142
  plugins: { "@eslint-community/eslint-comments": comments$1 },
@@ -145,7 +145,8 @@ async function comments(options = {}) {
145
145
  ...directives.rules,
146
146
  "@eslint-community/eslint-comments/require-description": ["error", { ignore: ["eslint-enable"] }]
147
147
  }
148
- }, ...kazupon.configs.comment.map((config) => ({
148
+ }];
149
+ if (typeof kazuponOptions === "object") configs.push(...kazupon.configs.comment.map((config) => ({
149
150
  ...config,
150
151
  ignores: [...config.ignores, ...kazuponOptions.ignores || []],
151
152
  rules: {
@@ -153,7 +154,8 @@ async function comments(options = {}) {
153
154
  "@kazupon/prefer-inline-code-words-comments": ["error", { words: inlineCodeWords }],
154
155
  ...kazuponOptions.rules
155
156
  }
156
- }))];
157
+ })));
158
+ return configs;
157
159
  }
158
160
 
159
161
  //#endregion
@@ -1014,7 +1016,7 @@ async function toml(options = {}) {
1014
1016
  * @returns {Promise<Linter.FlatConfig[]>} eslint flat configurations with `typescript-eslint` and overrides
1015
1017
  */
1016
1018
  async function typescript(options = {}) {
1017
- const { rules: overrideRules = {}, extraFileExtensions = [], parserOptions = { project: true } } = options;
1019
+ const { rules: overrideRules = {}, extraFileExtensions = [], parserOptions = { project: true }, baseOnly = false } = options;
1018
1020
  const ts = await loadPlugin("typescript-eslint");
1019
1021
  const baseFiles = [
1020
1022
  GLOB_TS,
@@ -1022,6 +1024,19 @@ async function typescript(options = {}) {
1022
1024
  ...extraFileExtensions.map((ext) => `**/*.${ext}`)
1023
1025
  ];
1024
1026
  const files = [...options.files ?? [], ...baseFiles];
1027
+ if (baseOnly) return [ts.configs.base, {
1028
+ name: "@kazupon/typescipt/typescript-eslint",
1029
+ files,
1030
+ languageOptions: {
1031
+ parser: ts.parser,
1032
+ parserOptions: {
1033
+ extraFileExtensions: extraFileExtensions.map((ext) => `.${ext}`),
1034
+ sourceType: "module",
1035
+ tsconfigRootDir: process.cwd(),
1036
+ ...parserOptions
1037
+ }
1038
+ }
1039
+ }];
1025
1040
  return [
1026
1041
  ...ts.configs.recommendedTypeChecked.map((config) => {
1027
1042
  const mapped = { ...config };
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.42.0",
4
+ "version": "0.44.0",
5
5
  "author": {
6
6
  "email": "kawakazu80@gmail.com",
7
7
  "name": "kazuya kawaguchi"
@@ -50,8 +50,8 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
53
- "@eslint/js": "^9.39.1",
54
- "@kazupon/eslint-plugin": "^0.6.2",
53
+ "@eslint/js": "^9.39.2",
54
+ "@kazupon/eslint-plugin": "^0.7.1",
55
55
  "@kazupon/jts-utils": "^0.7.1",
56
56
  "@stylistic/eslint-plugin": "^4.4.1",
57
57
  "eslint-flat-config-utils": "^2.1.4",
@@ -195,23 +195,23 @@
195
195
  "@intlify/eslint-plugin-vue-i18n": "^4.1.0",
196
196
  "@kazupon/prettier-config": "^0.2.0",
197
197
  "@types/eslint": "^9.6.1",
198
- "@types/node": "^22.19.2",
199
- "@vitest/eslint-plugin": "^1.5.2",
198
+ "@types/node": "^22.19.3",
199
+ "@vitest/eslint-plugin": "^1.6.4",
200
200
  "bumpp": "^10.3.2",
201
- "eslint": "^9.39.1",
201
+ "eslint": "^9.39.2",
202
202
  "eslint-config-prettier": "^10.1.8",
203
203
  "eslint-import-resolver-typescript": "^4.4.4",
204
204
  "eslint-plugin-barrel-files": "^3.0.1",
205
205
  "eslint-plugin-import": "^2.32.0",
206
206
  "eslint-plugin-jsdoc": "^61.5.0",
207
207
  "eslint-plugin-jsonc": "^2.21.0",
208
- "eslint-plugin-markdown-preferences": "^0.37.0",
208
+ "eslint-plugin-markdown-preferences": "^0.40.2",
209
209
  "eslint-plugin-module-interop": "^0.3.1",
210
- "eslint-plugin-oxlint": "^1.32.0",
210
+ "eslint-plugin-oxlint": "^1.36.0",
211
211
  "eslint-plugin-promise": "^7.2.1",
212
212
  "eslint-plugin-react": "^7.37.5",
213
213
  "eslint-plugin-react-hooks": "^7.0.1",
214
- "eslint-plugin-react-refresh": "^0.4.24",
214
+ "eslint-plugin-react-refresh": "^0.4.26",
215
215
  "eslint-plugin-regexp": "^2.10.0",
216
216
  "eslint-plugin-svelte": "^3.13.1",
217
217
  "eslint-plugin-toml": "^0.12.0",
@@ -221,18 +221,18 @@
221
221
  "eslint-plugin-vue-composable": "^1.0.0",
222
222
  "eslint-plugin-vue-scoped-css": "^2.12.0",
223
223
  "eslint-plugin-vuejs-accessibility": "^2.4.1",
224
- "eslint-plugin-yml": "^1.19.0",
224
+ "eslint-plugin-yml": "^1.19.1",
225
225
  "eslint-typegen": "^2.3.0",
226
226
  "gh-changelogen": "^0.2.8",
227
227
  "jiti": "^2.6.1",
228
- "knip": "^5.73.0",
228
+ "knip": "^5.78.0",
229
229
  "lint-staged": "^16.2.7",
230
230
  "prettier": "^3.7.4",
231
- "svelte": "^5.45.8",
231
+ "svelte": "^5.46.1",
232
232
  "tailwind-csstree": "^0.1.4",
233
- "tsdown": "^0.16.8",
233
+ "tsdown": "^0.18.4",
234
234
  "typescript": "^5.9.3",
235
- "typescript-eslint": "^8.49.0",
235
+ "typescript-eslint": "^8.51.0",
236
236
  "vitest": "^3.2.4"
237
237
  },
238
238
  "prettier": "@kazupon/prettier-config",