@kikiutils/eslint-config 12.0.0 → 12.0.1

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.
@@ -172,7 +172,6 @@ function createBaseRules(environment = "node") {
172
172
  prev: "*"
173
173
  }],
174
174
  "style/semi": ["error", "always"],
175
- "unicorn/no-array-callback-reference": "error",
176
175
  "unicorn/no-array-fill-with-reference-type": "error",
177
176
  "unicorn/no-await-in-promise-methods": "error",
178
177
  "unicorn/no-single-promise-in-promise-methods": "error",
@@ -1 +1 @@
1
- {"version":3,"file":"base-rules.js","names":[],"sources":["../../../src/_internals/configs/base-rules.ts"],"sourcesContent":["import type { Rules } from '@antfu/eslint-config';\n\nconst basePerfectionistSortOptions = {\n ignoreCase: false,\n type: 'natural',\n} as const;\n\nexport function createBaseRules(environment: 'bun' | 'node' = 'node'): Rules {\n return {\n 'antfu/consistent-list-newline': [\n 'error',\n {\n ArrayExpression: false,\n ArrayPattern: false,\n },\n ],\n 'antfu/curly': 'off',\n 'antfu/if-newline': 'off',\n 'antfu/no-top-level-await': 'off',\n 'antfu/reasonable-newline': 'off',\n 'arrow-body-style': [\n 'error',\n 'as-needed',\n ],\n 'curly': [\n 'error',\n 'multi-line',\n ],\n 'eslint-comments/require-description': [\n 'error',\n { ignore: ['eslint-enable'] },\n ],\n 'for-direction': 'error',\n 'jsdoc/check-param-names': [\n 'error',\n { disableMissingParamChecks: true },\n ],\n 'jsdoc/check-tag-names': 'error',\n 'jsdoc/multiline-blocks': 'error',\n 'jsdoc/no-blank-blocks': [\n 'error',\n { enableFixer: true },\n ],\n 'jsdoc/require-asterisk-prefix': 'error',\n 'jsdoc/require-hyphen-before-param-description': [\n 'error',\n 'always',\n { tags: { typeParam: 'always' } },\n ],\n 'kikiutils/comment-indent': 'error',\n 'kikiutils/compact-iteration-layout': 'error',\n 'kikiutils/consistent-condition-layout': 'error',\n 'kikiutils/consistent-parameter-layout': 'error',\n 'kikiutils/no-silent-catch': 'error',\n 'kikiutils/prefer-enhanced-date': 'error',\n 'kikiutils/statement-padding': 'error',\n 'max-classes-per-file': [\n 'error',\n 1,\n ],\n 'no-constant-binary-expression': 'error',\n 'no-constant-condition': 'error',\n 'no-constructor-return': 'error',\n 'no-dupe-else-if': 'error',\n // An ignored error needs at least a comment in the block saying why.\n 'no-empty': [\n 'error',\n { allowEmptyCatch: false },\n ],\n 'no-empty-static-block': 'error',\n 'no-promise-executor-return': [\n 'error',\n { allowVoid: true },\n ],\n 'no-restricted-imports': [\n 'error',\n {\n patterns: [\n {\n message: '`_internals` modules are private to their own directory; import the public module instead.',\n regex: String.raw`^[^.].*/_internals(/|$)`,\n },\n ],\n },\n ],\n // Repeats antfu's entries because a later config replaces the whole option list.\n 'no-restricted-syntax': [\n 'error',\n 'TSEnumDeclaration[const=true]',\n 'TSExportAssignment',\n {\n message: 'Use `axios.isAxiosError(error)`; `instanceof` fails when the error comes from another copy of axios.',\n selector: 'BinaryExpression[operator=\"instanceof\"][right.name=\"AxiosError\"]',\n },\n {\n message: '`structuredClone()` drops prototypes, turning class instances such as `ObjectId` into plain objects, and throws on Vue reactive proxies. Use `cloneDeep()` from es-toolkit, or spread only the level you change.',\n selector: 'CallExpression[callee.name=\"structuredClone\"]',\n },\n ],\n 'no-unassigned-vars': 'error',\n 'no-unsafe-optional-chaining': 'error',\n 'no-useless-assignment': 'error',\n 'perfectionist/sort-array-includes': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-heritage-clauses': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-imports': [\n 'error',\n {\n environment,\n groups: [\n 'side-effect',\n 'side-effect-style',\n 'style',\n [\n 'value-builtin',\n 'type-builtin',\n ],\n [\n 'value-external',\n 'type-external',\n ],\n [\n 'value-internal',\n 'type-internal',\n ],\n [\n 'value-parent',\n 'type-parent',\n ],\n [\n 'value-sibling',\n 'type-sibling',\n ],\n [\n 'value-index',\n 'type-index',\n ],\n 'unknown',\n ],\n ignoreCase: false,\n internalPattern: [\n '^#.*',\n '^@/.*',\n '^~/.*',\n ],\n type: 'natural',\n },\n ],\n 'perfectionist/sort-interfaces': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-intersection-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-modules': [\n 'error',\n {\n ...basePerfectionistSortOptions,\n groups: [\n 'declare-type',\n [\n 'export-type',\n 'type',\n ],\n 'declare-interface',\n [\n 'export-interface',\n 'interface',\n ],\n 'declare-enum',\n [\n 'enum',\n 'export-enum',\n ],\n 'declare-class',\n [\n 'class',\n 'export-class',\n ],\n 'declare-function',\n [\n 'export-function',\n 'function',\n ],\n ],\n },\n ],\n 'perfectionist/sort-object-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-switch-case': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-union-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-variable-declarations': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'preserve-caught-error': 'error',\n 'promise/no-multiple-resolved': 'error',\n 'promise/no-return-in-finally': 'error',\n 'promise/no-return-wrap': 'error',\n 'require-await': 'off',\n 'require-yield': 'error',\n 'style/array-bracket-newline': [\n 'error',\n { multiline: true },\n ],\n 'style/array-element-newline': [\n 'error',\n {\n ArrayExpression: {\n consistent: true,\n minItems: 2,\n },\n ArrayPattern: { minItems: 3 },\n },\n ],\n 'style/arrow-parens': [\n 'error',\n 'always',\n ],\n 'style/brace-style': [\n 'error',\n '1tbs',\n { allowSingleLine: false },\n ],\n 'style/function-call-spacing': [\n 'error',\n 'never',\n ],\n 'style/indent': [\n 'error',\n 4,\n ],\n 'style/member-delimiter-style': [\n 'error',\n {\n multiline: {\n delimiter: 'semi',\n requireLast: true,\n },\n },\n ],\n 'style/no-extra-parens': [\n 'error',\n 'all',\n { nestedBinaryExpressions: false },\n ],\n 'style/no-extra-semi': 'error',\n 'style/object-curly-newline': [\n 'error',\n {\n ExportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ImportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ObjectExpression: {\n minProperties: 2,\n multiline: true,\n },\n ObjectPattern: {\n minProperties: 3,\n multiline: true,\n },\n },\n ],\n 'style/operator-linebreak': [\n 'error',\n 'before',\n { overrides: { '=': 'after' } },\n ],\n 'style/padding-line-between-statements': [\n 'error',\n {\n blankLine: 'always',\n next: [\n 'class',\n 'enum',\n 'function',\n ],\n prev: '*',\n },\n ],\n 'style/semi': [\n 'error',\n 'always',\n ],\n 'unicorn/no-array-callback-reference': 'error',\n 'unicorn/no-array-fill-with-reference-type': 'error',\n 'unicorn/no-await-in-promise-methods': 'error',\n 'unicorn/no-single-promise-in-promise-methods': 'error',\n 'unicorn/no-useless-promise-resolve-reject': 'error',\n 'unicorn/no-useless-spread': 'error',\n 'unicorn/prefer-array-find': 'error',\n 'unicorn/prefer-array-some': 'error',\n 'unicorn/prefer-at': 'error',\n 'unicorn/prefer-string-replace-all': 'error',\n };\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"base-rules.js","names":[],"sources":["../../../src/_internals/configs/base-rules.ts"],"sourcesContent":["import type { Rules } from '@antfu/eslint-config';\n\nconst basePerfectionistSortOptions = {\n ignoreCase: false,\n type: 'natural',\n} as const;\n\nexport function createBaseRules(environment: 'bun' | 'node' = 'node'): Rules {\n return {\n 'antfu/consistent-list-newline': [\n 'error',\n {\n ArrayExpression: false,\n ArrayPattern: false,\n },\n ],\n 'antfu/curly': 'off',\n 'antfu/if-newline': 'off',\n 'antfu/no-top-level-await': 'off',\n 'antfu/reasonable-newline': 'off',\n 'arrow-body-style': [\n 'error',\n 'as-needed',\n ],\n 'curly': [\n 'error',\n 'multi-line',\n ],\n 'eslint-comments/require-description': [\n 'error',\n { ignore: ['eslint-enable'] },\n ],\n 'for-direction': 'error',\n 'jsdoc/check-param-names': [\n 'error',\n { disableMissingParamChecks: true },\n ],\n 'jsdoc/check-tag-names': 'error',\n 'jsdoc/multiline-blocks': 'error',\n 'jsdoc/no-blank-blocks': [\n 'error',\n { enableFixer: true },\n ],\n 'jsdoc/require-asterisk-prefix': 'error',\n 'jsdoc/require-hyphen-before-param-description': [\n 'error',\n 'always',\n { tags: { typeParam: 'always' } },\n ],\n 'kikiutils/comment-indent': 'error',\n 'kikiutils/compact-iteration-layout': 'error',\n 'kikiutils/consistent-condition-layout': 'error',\n 'kikiutils/consistent-parameter-layout': 'error',\n 'kikiutils/no-silent-catch': 'error',\n 'kikiutils/prefer-enhanced-date': 'error',\n 'kikiutils/statement-padding': 'error',\n 'max-classes-per-file': [\n 'error',\n 1,\n ],\n 'no-constant-binary-expression': 'error',\n 'no-constant-condition': 'error',\n 'no-constructor-return': 'error',\n 'no-dupe-else-if': 'error',\n // An ignored error needs at least a comment in the block saying why.\n 'no-empty': [\n 'error',\n { allowEmptyCatch: false },\n ],\n 'no-empty-static-block': 'error',\n 'no-promise-executor-return': [\n 'error',\n { allowVoid: true },\n ],\n 'no-restricted-imports': [\n 'error',\n {\n patterns: [\n {\n message: '`_internals` modules are private to their own directory; import the public module instead.',\n regex: String.raw`^[^.].*/_internals(/|$)`,\n },\n ],\n },\n ],\n // Repeats antfu's entries because a later config replaces the whole option list.\n 'no-restricted-syntax': [\n 'error',\n 'TSEnumDeclaration[const=true]',\n 'TSExportAssignment',\n {\n message: 'Use `axios.isAxiosError(error)`; `instanceof` fails when the error comes from another copy of axios.',\n selector: 'BinaryExpression[operator=\"instanceof\"][right.name=\"AxiosError\"]',\n },\n {\n message: '`structuredClone()` drops prototypes, turning class instances such as `ObjectId` into plain objects, and throws on Vue reactive proxies. Use `cloneDeep()` from es-toolkit, or spread only the level you change.',\n selector: 'CallExpression[callee.name=\"structuredClone\"]',\n },\n ],\n 'no-unassigned-vars': 'error',\n 'no-unsafe-optional-chaining': 'error',\n 'no-useless-assignment': 'error',\n 'perfectionist/sort-array-includes': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-heritage-clauses': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-imports': [\n 'error',\n {\n environment,\n groups: [\n 'side-effect',\n 'side-effect-style',\n 'style',\n [\n 'value-builtin',\n 'type-builtin',\n ],\n [\n 'value-external',\n 'type-external',\n ],\n [\n 'value-internal',\n 'type-internal',\n ],\n [\n 'value-parent',\n 'type-parent',\n ],\n [\n 'value-sibling',\n 'type-sibling',\n ],\n [\n 'value-index',\n 'type-index',\n ],\n 'unknown',\n ],\n ignoreCase: false,\n internalPattern: [\n '^#.*',\n '^@/.*',\n '^~/.*',\n ],\n type: 'natural',\n },\n ],\n 'perfectionist/sort-interfaces': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-intersection-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-modules': [\n 'error',\n {\n ...basePerfectionistSortOptions,\n groups: [\n 'declare-type',\n [\n 'export-type',\n 'type',\n ],\n 'declare-interface',\n [\n 'export-interface',\n 'interface',\n ],\n 'declare-enum',\n [\n 'enum',\n 'export-enum',\n ],\n 'declare-class',\n [\n 'class',\n 'export-class',\n ],\n 'declare-function',\n [\n 'export-function',\n 'function',\n ],\n ],\n },\n ],\n 'perfectionist/sort-object-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-switch-case': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-union-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-variable-declarations': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'preserve-caught-error': 'error',\n 'promise/no-multiple-resolved': 'error',\n 'promise/no-return-in-finally': 'error',\n 'promise/no-return-wrap': 'error',\n 'require-await': 'off',\n 'require-yield': 'error',\n 'style/array-bracket-newline': [\n 'error',\n { multiline: true },\n ],\n 'style/array-element-newline': [\n 'error',\n {\n ArrayExpression: {\n consistent: true,\n minItems: 2,\n },\n ArrayPattern: { minItems: 3 },\n },\n ],\n 'style/arrow-parens': [\n 'error',\n 'always',\n ],\n 'style/brace-style': [\n 'error',\n '1tbs',\n { allowSingleLine: false },\n ],\n 'style/function-call-spacing': [\n 'error',\n 'never',\n ],\n 'style/indent': [\n 'error',\n 4,\n ],\n 'style/member-delimiter-style': [\n 'error',\n {\n multiline: {\n delimiter: 'semi',\n requireLast: true,\n },\n },\n ],\n 'style/no-extra-parens': [\n 'error',\n 'all',\n { nestedBinaryExpressions: false },\n ],\n 'style/no-extra-semi': 'error',\n 'style/object-curly-newline': [\n 'error',\n {\n ExportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ImportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ObjectExpression: {\n minProperties: 2,\n multiline: true,\n },\n ObjectPattern: {\n minProperties: 3,\n multiline: true,\n },\n },\n ],\n 'style/operator-linebreak': [\n 'error',\n 'before',\n { overrides: { '=': 'after' } },\n ],\n 'style/padding-line-between-statements': [\n 'error',\n {\n blankLine: 'always',\n next: [\n 'class',\n 'enum',\n 'function',\n ],\n prev: '*',\n },\n ],\n 'style/semi': [\n 'error',\n 'always',\n ],\n 'unicorn/no-array-fill-with-reference-type': 'error',\n 'unicorn/no-await-in-promise-methods': 'error',\n 'unicorn/no-single-promise-in-promise-methods': 'error',\n 'unicorn/no-useless-promise-resolve-reject': 'error',\n 'unicorn/no-useless-spread': 'error',\n 'unicorn/prefer-array-find': 'error',\n 'unicorn/prefer-array-some': 'error',\n 'unicorn/prefer-at': 'error',\n 'unicorn/prefer-string-replace-all': 'error',\n };\n}\n"],"mappings":"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"}
package/dist/base.js CHANGED
@@ -17,7 +17,7 @@ const vscodeOrderSensitiveArrayProperties = [
17
17
  "runtimeArgs",
18
18
  "skipFiles"
19
19
  ].join("|");
20
- const testSleepMessage = "A fixed wait makes tests slow and flaky. Use fake timers for timer-driven code, or wait for the event or condition itself, such as with `vi.waitFor()`.";
20
+ const testSleepMessage = "A fixed wait makes tests slow and flaky. Use fake timers for timer-driven code, or wait for the event or condition itself, such as with `vi.waitFor()`. To assert that something has not happened yet, await one event loop turn with `setImmediate` from `node:timers/promises`.";
21
21
  function createBaseConfigs(environment = "node") {
22
22
  return [
23
23
  {
@@ -71,14 +71,21 @@ function createBaseConfigs(environment = "node") {
71
71
  message: testSleepMessage,
72
72
  name
73
73
  }))] }],
74
- "kikiutils/no-restricted-test-syntax": ["error", {
75
- message: testSleepMessage,
76
- selector: [
77
- "NewExpression[callee.name=\"Promise\"] > :function > CallExpression.body[callee.name=\"setTimeout\"]",
78
- "NewExpression[callee.name=\"Promise\"] > :function > BlockStatement > ExpressionStatement > CallExpression[callee.name=\"setTimeout\"]",
79
- "CallExpression[callee.object.name=\"Bun\"][callee.property.name=/^sleep(Sync)?$/]"
80
- ].join(", ")
81
- }],
74
+ "kikiutils/no-restricted-test-syntax": [
75
+ "error",
76
+ {
77
+ message: testSleepMessage,
78
+ selector: [
79
+ "NewExpression[callee.name=\"Promise\"] > :function > CallExpression.body[callee.name=\"setTimeout\"]",
80
+ "NewExpression[callee.name=\"Promise\"] > :function > BlockStatement > ExpressionStatement > CallExpression[callee.name=\"setTimeout\"]",
81
+ "CallExpression[callee.object.name=\"Bun\"][callee.property.name=/^sleep(Sync)?$/]"
82
+ ].join(", ")
83
+ },
84
+ {
85
+ message: "An empty `vi.fn()` is typed `(...args: any[]) => any`; pass a type parameter or an implementation.",
86
+ selector: "CallExpression[callee.object.name=\"vi\"][callee.property.name=\"fn\"][arguments.length=0]:not([typeArguments])"
87
+ }
88
+ ],
82
89
  "test/consistent-each-for": ["error", {
83
90
  it: "for",
84
91
  test: "for"
@@ -96,7 +103,6 @@ function createBaseConfigs(environment = "node") {
96
103
  }],
97
104
  "test/prefer-to-be": "error",
98
105
  "test/prefer-vi-mocked": "error",
99
- "test/require-mock-type-parameters": "error",
100
106
  "test/require-to-throw-message": "error",
101
107
  "test/valid-describe-callback": "error",
102
108
  "test/valid-expect": "error",
package/dist/base.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","names":[],"sources":["../src/base.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\nimport {\n GLOB_JS,\n GLOB_JSX,\n GLOB_TESTS,\n GLOB_TS,\n GLOB_TSX,\n} from '@antfu/eslint-config';\nimport promise from 'eslint-plugin-promise';\n\nimport { createBaseRules } from './_internals/configs/base-rules';\nimport { jsdocSettings } from './_internals/configs/jsdoc';\nimport { createTypeAwareConfig } from './_internals/configs/type-aware';\nimport { typescriptConfig } from './_internals/configs/typescript';\nimport { kikiutilsPlugin } from './_internals/rules';\n\nexport { createBaseRules };\n\nconst vscodeOrderSensitiveArrayProperties = [\n 'args',\n 'autoAttachSmartPattern',\n 'dependsOn',\n 'options',\n 'outFiles',\n 'problemMatcher',\n 'resolveSourceMapLocations',\n 'runtimeArgs',\n 'skipFiles',\n].join('|');\n\nconst testSleepMessage = 'A fixed wait makes tests slow and flaky. Use fake timers for timer-driven code, or wait for the event or condition itself, such as with `vi.waitFor()`.';\n\nexport function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFlatConfigItem[] {\n return [\n {\n name: 'kikiutils/base',\n rules: {\n 'e18e/ban-dependencies': [\n 'error',\n { allowed: ['axios'] },\n ],\n 'e18e/prefer-static-regex': 'off',\n 'style/linebreak-style': [\n 'error',\n 'unix',\n ],\n },\n },\n {\n name: 'kikiutils/javascript',\n files: [\n GLOB_JS,\n GLOB_JSX,\n GLOB_TS,\n GLOB_TSX,\n ],\n plugins: {\n kikiutils: kikiutilsPlugin,\n promise,\n },\n rules: {\n ...createBaseRules(environment),\n 'node/prefer-global/process': [\n 'error',\n 'always',\n ],\n },\n settings: jsdocSettings,\n },\n {\n ...typescriptConfig,\n name: 'kikiutils/typescript',\n files: [\n GLOB_TS,\n GLOB_TSX,\n ],\n },\n {\n ...createTypeAwareConfig(),\n name: 'kikiutils/type-aware',\n files: [\n GLOB_TS,\n GLOB_TSX,\n ],\n ignores: ['**/*.config.?([cm])ts'],\n },\n {\n name: 'kikiutils/tests',\n files: GLOB_TESTS,\n rules: {\n 'kikiutils/consistent-parameter-layout': [\n 'error',\n { compactTestCalls: true },\n ],\n 'kikiutils/no-restricted-test-imports': [\n 'error',\n {\n paths: [\n {\n importNames: ['expect'],\n message: 'Use `expect` from the test context.',\n name: 'vitest',\n },\n ...[\n 'node:timers/promises',\n 'timers/promises',\n ].map((name) => ({\n importNames: ['setTimeout'],\n message: testSleepMessage,\n name,\n })),\n ],\n },\n ],\n 'kikiutils/no-restricted-test-syntax': [\n 'error',\n {\n message: testSleepMessage,\n selector: [\n 'NewExpression[callee.name=\"Promise\"] > :function > CallExpression.body[callee.name=\"setTimeout\"]',\n 'NewExpression[callee.name=\"Promise\"] > :function > BlockStatement > ExpressionStatement > CallExpression[callee.name=\"setTimeout\"]',\n 'CallExpression[callee.object.name=\"Bun\"][callee.property.name=/^sleep(Sync)?$/]',\n ].join(', '),\n },\n ],\n 'test/consistent-each-for': [\n 'error',\n {\n it: 'for',\n test: 'for',\n },\n ],\n 'test/expect-expect': 'error',\n 'test/no-commented-out-tests': 'error',\n 'test/no-conditional-expect': 'error',\n 'test/no-disabled-tests': 'error',\n 'test/no-standalone-expect': 'error',\n 'test/prefer-each': 'error',\n 'test/prefer-hooks-on-top': 'error',\n 'test/prefer-lowercase-title': [\n 'error',\n {\n ignoreTopLevelDescribe: true,\n lowercaseFirstCharacterOnly: true,\n },\n ],\n 'test/prefer-to-be': 'error',\n 'test/prefer-vi-mocked': 'error',\n 'test/require-mock-type-parameters': 'error',\n 'test/require-to-throw-message': 'error',\n 'test/valid-describe-callback': 'error',\n 'test/valid-expect': 'error',\n 'test/valid-expect-in-promise': 'error',\n 'test/valid-title': 'error',\n // Mocks and partial fixtures often need `any`.\n 'ts/no-explicit-any': 'off',\n },\n },\n {\n name: 'kikiutils/vscode',\n files: ['**/.vscode/*.json'],\n rules: {\n 'jsonc/sort-array-values': [\n 'error',\n {\n order: {\n natural: true,\n type: 'asc',\n },\n // Preserve ordered fields and any argument or option arrays nested inside them.\n pathPattern: String.raw`^(?!.*(?:^|\\.|\\[\")(?:${vscodeOrderSensitiveArrayProperties})(?:$|\\.|\\[|\"\\])).*`,\n },\n ],\n 'jsonc/sort-keys': [\n 'error',\n 'asc',\n {\n caseSensitive: true,\n natural: true,\n },\n ],\n },\n },\n // Ignore all extracted Markdown code blocks, but keep linting Markdown itself.\n {\n name: 'kikiutils/ignores/markdown-code-blocks',\n ignores: ['**/*.md/**'],\n },\n // Serena's project files (`project.yml`, memories) are tool-generated and may be tracked.\n {\n name: 'kikiutils/ignores/serena',\n ignores: ['**/.serena/**'],\n },\n ];\n}\n"],"mappings":";;;;;;;;AAkBA,MAAM,sCAAsC;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ,CAAC,CAAC,KAAK,GAAG;AAEV,MAAM,mBAAmB;AAEzB,SAAgB,kBAAkB,cAA8B,QAA+B;CAC3F,OAAO;EACH;GACI,MAAM;GACN,OAAO;IACH,yBAAyB,CACrB,SACA,EAAE,SAAS,CAAC,OAAO,EAAE,CACzB;IACA,4BAA4B;IAC5B,yBAAyB,CACrB,SACA,MACJ;GACJ;EACJ;EACA;GACI,MAAM;GACN,OAAO;IACH;IACA;IACA;IACA;GACJ;GACA,SAAS;IACL,WAAW;IACX;GACJ;GACA,OAAO;IACH,GAAG,gBAAgB,WAAW;IAC9B,8BAA8B,CAC1B,SACA,QACJ;GACJ;GACA,UAAU;EACd;EACA;GACI,GAAG;GACH,MAAM;GACN,OAAO,CACH,SACA,QACJ;EACJ;EACA;GACI,GAAG,sBAAsB;GACzB,MAAM;GACN,OAAO,CACH,SACA,QACJ;GACA,SAAS,CAAC,uBAAuB;EACrC;EACA;GACI,MAAM;GACN,OAAO;GACP,OAAO;IACH,yCAAyC,CACrC,SACA,EAAE,kBAAkB,KAAK,CAC7B;IACA,wCAAwC,CACpC,SACA,EACI,OAAO,CACH;KACI,aAAa,CAAC,QAAQ;KACtB,SAAS;KACT,MAAM;IACV,GACA,GAAG,CACC,wBACA,iBACJ,CAAC,CAAC,KAAK,UAAU;KACb,aAAa,CAAC,YAAY;KAC1B,SAAS;KACT;IACJ,EAAE,CACN,EACJ,CACJ;IACA,uCAAuC,CACnC,SACA;KACI,SAAS;KACT,UAAU;MACN;MACA;MACA;KACJ,CAAC,CAAC,KAAK,IAAI;IACf,CACJ;IACA,4BAA4B,CACxB,SACA;KACI,IAAI;KACJ,MAAM;IACV,CACJ;IACA,sBAAsB;IACtB,+BAA+B;IAC/B,8BAA8B;IAC9B,0BAA0B;IAC1B,6BAA6B;IAC7B,oBAAoB;IACpB,4BAA4B;IAC5B,+BAA+B,CAC3B,SACA;KACI,wBAAwB;KACxB,6BAA6B;IACjC,CACJ;IACA,qBAAqB;IACrB,yBAAyB;IACzB,qCAAqC;IACrC,iCAAiC;IACjC,gCAAgC;IAChC,qBAAqB;IACrB,gCAAgC;IAChC,oBAAoB;IAEpB,sBAAsB;GAC1B;EACJ;EACA;GACI,MAAM;GACN,OAAO,CAAC,mBAAmB;GAC3B,OAAO;IACH,2BAA2B,CACvB,SACA;KACI,OAAO;MACH,SAAS;MACT,MAAM;KACV;KAEA,aAAa,OAAO,GAAG,wBAAwB,oCAAoC;IACvF,CACJ;IACA,mBAAmB;KACf;KACA;KACA;MACI,eAAe;MACf,SAAS;KACb;IACJ;GACJ;EACJ;EAEA;GACI,MAAM;GACN,SAAS,CAAC,YAAY;EAC1B;EAEA;GACI,MAAM;GACN,SAAS,CAAC,eAAe;EAC7B;CACJ;AACJ"}
1
+ {"version":3,"file":"base.js","names":[],"sources":["../src/base.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\nimport {\n GLOB_JS,\n GLOB_JSX,\n GLOB_TESTS,\n GLOB_TS,\n GLOB_TSX,\n} from '@antfu/eslint-config';\nimport promise from 'eslint-plugin-promise';\n\nimport { createBaseRules } from './_internals/configs/base-rules';\nimport { jsdocSettings } from './_internals/configs/jsdoc';\nimport { createTypeAwareConfig } from './_internals/configs/type-aware';\nimport { typescriptConfig } from './_internals/configs/typescript';\nimport { kikiutilsPlugin } from './_internals/rules';\n\nexport { createBaseRules };\n\nconst vscodeOrderSensitiveArrayProperties = [\n 'args',\n 'autoAttachSmartPattern',\n 'dependsOn',\n 'options',\n 'outFiles',\n 'problemMatcher',\n 'resolveSourceMapLocations',\n 'runtimeArgs',\n 'skipFiles',\n].join('|');\n\nconst testSleepMessage = 'A fixed wait makes tests slow and flaky. Use fake timers for timer-driven code, or wait for the event or condition itself, such as with `vi.waitFor()`. To assert that something has not happened yet, await one event loop turn with `setImmediate` from `node:timers/promises`.';\n\nexport function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFlatConfigItem[] {\n return [\n {\n name: 'kikiutils/base',\n rules: {\n 'e18e/ban-dependencies': [\n 'error',\n { allowed: ['axios'] },\n ],\n 'e18e/prefer-static-regex': 'off',\n 'style/linebreak-style': [\n 'error',\n 'unix',\n ],\n },\n },\n {\n name: 'kikiutils/javascript',\n files: [\n GLOB_JS,\n GLOB_JSX,\n GLOB_TS,\n GLOB_TSX,\n ],\n plugins: {\n kikiutils: kikiutilsPlugin,\n promise,\n },\n rules: {\n ...createBaseRules(environment),\n 'node/prefer-global/process': [\n 'error',\n 'always',\n ],\n },\n settings: jsdocSettings,\n },\n {\n ...typescriptConfig,\n name: 'kikiutils/typescript',\n files: [\n GLOB_TS,\n GLOB_TSX,\n ],\n },\n {\n ...createTypeAwareConfig(),\n name: 'kikiutils/type-aware',\n files: [\n GLOB_TS,\n GLOB_TSX,\n ],\n ignores: ['**/*.config.?([cm])ts'],\n },\n {\n name: 'kikiutils/tests',\n files: GLOB_TESTS,\n rules: {\n 'kikiutils/consistent-parameter-layout': [\n 'error',\n { compactTestCalls: true },\n ],\n 'kikiutils/no-restricted-test-imports': [\n 'error',\n {\n paths: [\n {\n importNames: ['expect'],\n message: 'Use `expect` from the test context.',\n name: 'vitest',\n },\n ...[\n 'node:timers/promises',\n 'timers/promises',\n ].map((name) => ({\n importNames: ['setTimeout'],\n message: testSleepMessage,\n name,\n })),\n ],\n },\n ],\n 'kikiutils/no-restricted-test-syntax': [\n 'error',\n {\n message: testSleepMessage,\n selector: [\n 'NewExpression[callee.name=\"Promise\"] > :function > CallExpression.body[callee.name=\"setTimeout\"]',\n 'NewExpression[callee.name=\"Promise\"] > :function > BlockStatement > ExpressionStatement > CallExpression[callee.name=\"setTimeout\"]',\n 'CallExpression[callee.object.name=\"Bun\"][callee.property.name=/^sleep(Sync)?$/]',\n ].join(', '),\n },\n // An implementation types the mock; only an empty one falls back to `(...args: any[]) => any`.\n {\n message: 'An empty `vi.fn()` is typed `(...args: any[]) => any`; pass a type parameter or an implementation.',\n selector: 'CallExpression[callee.object.name=\"vi\"][callee.property.name=\"fn\"][arguments.length=0]:not([typeArguments])',\n },\n ],\n 'test/consistent-each-for': [\n 'error',\n {\n it: 'for',\n test: 'for',\n },\n ],\n 'test/expect-expect': 'error',\n 'test/no-commented-out-tests': 'error',\n 'test/no-conditional-expect': 'error',\n 'test/no-disabled-tests': 'error',\n 'test/no-standalone-expect': 'error',\n 'test/prefer-each': 'error',\n 'test/prefer-hooks-on-top': 'error',\n 'test/prefer-lowercase-title': [\n 'error',\n {\n ignoreTopLevelDescribe: true,\n lowercaseFirstCharacterOnly: true,\n },\n ],\n 'test/prefer-to-be': 'error',\n 'test/prefer-vi-mocked': 'error',\n 'test/require-to-throw-message': 'error',\n 'test/valid-describe-callback': 'error',\n 'test/valid-expect': 'error',\n 'test/valid-expect-in-promise': 'error',\n 'test/valid-title': 'error',\n // Mocks and partial fixtures often need `any`.\n 'ts/no-explicit-any': 'off',\n },\n },\n {\n name: 'kikiutils/vscode',\n files: ['**/.vscode/*.json'],\n rules: {\n 'jsonc/sort-array-values': [\n 'error',\n {\n order: {\n natural: true,\n type: 'asc',\n },\n // Preserve ordered fields and any argument or option arrays nested inside them.\n pathPattern: String.raw`^(?!.*(?:^|\\.|\\[\")(?:${vscodeOrderSensitiveArrayProperties})(?:$|\\.|\\[|\"\\])).*`,\n },\n ],\n 'jsonc/sort-keys': [\n 'error',\n 'asc',\n {\n caseSensitive: true,\n natural: true,\n },\n ],\n },\n },\n // Ignore all extracted Markdown code blocks, but keep linting Markdown itself.\n {\n name: 'kikiutils/ignores/markdown-code-blocks',\n ignores: ['**/*.md/**'],\n },\n // Serena's project files (`project.yml`, memories) are tool-generated and may be tracked.\n {\n name: 'kikiutils/ignores/serena',\n ignores: ['**/.serena/**'],\n },\n ];\n}\n"],"mappings":";;;;;;;;AAkBA,MAAM,sCAAsC;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ,CAAC,CAAC,KAAK,GAAG;AAEV,MAAM,mBAAmB;AAEzB,SAAgB,kBAAkB,cAA8B,QAA+B;CAC3F,OAAO;EACH;GACI,MAAM;GACN,OAAO;IACH,yBAAyB,CACrB,SACA,EAAE,SAAS,CAAC,OAAO,EAAE,CACzB;IACA,4BAA4B;IAC5B,yBAAyB,CACrB,SACA,MACJ;GACJ;EACJ;EACA;GACI,MAAM;GACN,OAAO;IACH;IACA;IACA;IACA;GACJ;GACA,SAAS;IACL,WAAW;IACX;GACJ;GACA,OAAO;IACH,GAAG,gBAAgB,WAAW;IAC9B,8BAA8B,CAC1B,SACA,QACJ;GACJ;GACA,UAAU;EACd;EACA;GACI,GAAG;GACH,MAAM;GACN,OAAO,CACH,SACA,QACJ;EACJ;EACA;GACI,GAAG,sBAAsB;GACzB,MAAM;GACN,OAAO,CACH,SACA,QACJ;GACA,SAAS,CAAC,uBAAuB;EACrC;EACA;GACI,MAAM;GACN,OAAO;GACP,OAAO;IACH,yCAAyC,CACrC,SACA,EAAE,kBAAkB,KAAK,CAC7B;IACA,wCAAwC,CACpC,SACA,EACI,OAAO,CACH;KACI,aAAa,CAAC,QAAQ;KACtB,SAAS;KACT,MAAM;IACV,GACA,GAAG,CACC,wBACA,iBACJ,CAAC,CAAC,KAAK,UAAU;KACb,aAAa,CAAC,YAAY;KAC1B,SAAS;KACT;IACJ,EAAE,CACN,EACJ,CACJ;IACA,uCAAuC;KACnC;KACA;MACI,SAAS;MACT,UAAU;OACN;OACA;OACA;MACJ,CAAC,CAAC,KAAK,IAAI;KACf;KAEA;MACI,SAAS;MACT,UAAU;KACd;IACJ;IACA,4BAA4B,CACxB,SACA;KACI,IAAI;KACJ,MAAM;IACV,CACJ;IACA,sBAAsB;IACtB,+BAA+B;IAC/B,8BAA8B;IAC9B,0BAA0B;IAC1B,6BAA6B;IAC7B,oBAAoB;IACpB,4BAA4B;IAC5B,+BAA+B,CAC3B,SACA;KACI,wBAAwB;KACxB,6BAA6B;IACjC,CACJ;IACA,qBAAqB;IACrB,yBAAyB;IACzB,iCAAiC;IACjC,gCAAgC;IAChC,qBAAqB;IACrB,gCAAgC;IAChC,oBAAoB;IAEpB,sBAAsB;GAC1B;EACJ;EACA;GACI,MAAM;GACN,OAAO,CAAC,mBAAmB;GAC3B,OAAO;IACH,2BAA2B,CACvB,SACA;KACI,OAAO;MACH,SAAS;MACT,MAAM;KACV;KAEA,aAAa,OAAO,GAAG,wBAAwB,oCAAoC;IACvF,CACJ;IACA,mBAAmB;KACf;KACA;KACA;MACI,eAAe;MACf,SAAS;KACb;IACJ;GACJ;EACJ;EAEA;GACI,MAAM;GACN,SAAS,CAAC,YAAY;EAC1B;EAEA;GACI,MAAM;GACN,SAAS,CAAC,eAAe;EAC7B;CACJ;AACJ"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kikiutils/eslint-config",
3
3
  "type": "module",
4
- "version": "12.0.0",
4
+ "version": "12.0.1",
5
5
  "description": "Opinionated ESLint flat config presets layered on @antfu/eslint-config, with type-aware TypeScript and Vue checks and custom rules, built for the author's own repositories.",
6
6
  "author": "kiki-kanri",
7
7
  "license": "MIT",
@@ -302,7 +302,6 @@ export function createBaseRules(environment: 'bun' | 'node' = 'node'): Rules {
302
302
  'error',
303
303
  'always',
304
304
  ],
305
- 'unicorn/no-array-callback-reference': 'error',
306
305
  'unicorn/no-array-fill-with-reference-type': 'error',
307
306
  'unicorn/no-await-in-promise-methods': 'error',
308
307
  'unicorn/no-single-promise-in-promise-methods': 'error',
package/src/base.ts CHANGED
@@ -28,7 +28,7 @@ const vscodeOrderSensitiveArrayProperties = [
28
28
  'skipFiles',
29
29
  ].join('|');
30
30
 
31
- const testSleepMessage = 'A fixed wait makes tests slow and flaky. Use fake timers for timer-driven code, or wait for the event or condition itself, such as with `vi.waitFor()`.';
31
+ const testSleepMessage = 'A fixed wait makes tests slow and flaky. Use fake timers for timer-driven code, or wait for the event or condition itself, such as with `vi.waitFor()`. To assert that something has not happened yet, await one event loop turn with `setImmediate` from `node:timers/promises`.';
32
32
 
33
33
  export function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFlatConfigItem[] {
34
34
  return [
@@ -122,6 +122,11 @@ export function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFl
122
122
  'CallExpression[callee.object.name="Bun"][callee.property.name=/^sleep(Sync)?$/]',
123
123
  ].join(', '),
124
124
  },
125
+ // An implementation types the mock; only an empty one falls back to `(...args: any[]) => any`.
126
+ {
127
+ message: 'An empty `vi.fn()` is typed `(...args: any[]) => any`; pass a type parameter or an implementation.',
128
+ selector: 'CallExpression[callee.object.name="vi"][callee.property.name="fn"][arguments.length=0]:not([typeArguments])',
129
+ },
125
130
  ],
126
131
  'test/consistent-each-for': [
127
132
  'error',
@@ -146,7 +151,6 @@ export function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFl
146
151
  ],
147
152
  'test/prefer-to-be': 'error',
148
153
  'test/prefer-vi-mocked': 'error',
149
- 'test/require-mock-type-parameters': 'error',
150
154
  'test/require-to-throw-message': 'error',
151
155
  'test/valid-describe-callback': 'error',
152
156
  'test/valid-expect': 'error',