@2digits/eslint-config 5.3.4 → 5.4.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
@@ -11,6 +11,7 @@ declare const PluginNameMap: {
11
11
  readonly 'react-compiler': 'react-compiler';
12
12
  readonly '@stylistic/eslint-plugin': 'stylistic';
13
13
  readonly '@typescript-eslint': 'ts';
14
+ readonly vitest: 'vitest';
14
15
  readonly node: 'node';
15
16
  readonly '@eslint-community/eslint-comments': 'comments';
16
17
  readonly storybook: 'storybook';
@@ -8011,6 +8012,417 @@ interface RuleOptions {
8011
8012
  * @see https://eslint.org/docs/latest/rules/vars-on-top
8012
8013
  */
8013
8014
  'vars-on-top'?: Linter.RuleEntry<[]>;
8015
+ /**
8016
+ * enforce using `.each` or `.for` consistently
8017
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-each-for.md
8018
+ */
8019
+ 'vitest/consistent-each-for'?: Linter.RuleEntry<VitestConsistentEachFor>;
8020
+ /**
8021
+ * require test file pattern
8022
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
8023
+ */
8024
+ 'vitest/consistent-test-filename'?: Linter.RuleEntry<VitestConsistentTestFilename>;
8025
+ /**
8026
+ * enforce using test or it but not both
8027
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-it.md
8028
+ */
8029
+ 'vitest/consistent-test-it'?: Linter.RuleEntry<VitestConsistentTestIt>;
8030
+ /**
8031
+ * enforce using vitest or vi but not both
8032
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-vitest-vi.md
8033
+ */
8034
+ 'vitest/consistent-vitest-vi'?: Linter.RuleEntry<VitestConsistentVitestVi>;
8035
+ /**
8036
+ * enforce having expectation in test body
8037
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/expect-expect.md
8038
+ */
8039
+ 'vitest/expect-expect'?: Linter.RuleEntry<VitestExpectExpect>;
8040
+ /**
8041
+ * enforce hoisted APIs to be on top of the file
8042
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/hoisted-apis-on-top.md
8043
+ */
8044
+ 'vitest/hoisted-apis-on-top'?: Linter.RuleEntry<[]>;
8045
+ /**
8046
+ * enforce a maximum number of expect per test
8047
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-expects.md
8048
+ */
8049
+ 'vitest/max-expects'?: Linter.RuleEntry<VitestMaxExpects>;
8050
+ /**
8051
+ * require describe block to be less than set max value or default value
8052
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-nested-describe.md
8053
+ */
8054
+ 'vitest/max-nested-describe'?: Linter.RuleEntry<VitestMaxNestedDescribe>;
8055
+ /**
8056
+ * disallow alias methods
8057
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-alias-methods.md
8058
+ */
8059
+ 'vitest/no-alias-methods'?: Linter.RuleEntry<[]>;
8060
+ /**
8061
+ * disallow commented out tests
8062
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-commented-out-tests.md
8063
+ */
8064
+ 'vitest/no-commented-out-tests'?: Linter.RuleEntry<[]>;
8065
+ /**
8066
+ * disallow conditional expects
8067
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-expect.md
8068
+ */
8069
+ 'vitest/no-conditional-expect'?: Linter.RuleEntry<VitestNoConditionalExpect>;
8070
+ /**
8071
+ * disallow conditional tests
8072
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-in-test.md
8073
+ */
8074
+ 'vitest/no-conditional-in-test'?: Linter.RuleEntry<[]>;
8075
+ /**
8076
+ * disallow conditional tests
8077
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-tests.md
8078
+ */
8079
+ 'vitest/no-conditional-tests'?: Linter.RuleEntry<[]>;
8080
+ /**
8081
+ * disallow disabled tests
8082
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-disabled-tests.md
8083
+ */
8084
+ 'vitest/no-disabled-tests'?: Linter.RuleEntry<[]>;
8085
+ /**
8086
+ * disallow using a callback in asynchronous tests and hooks
8087
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-done-callback.md
8088
+ * @deprecated
8089
+ */
8090
+ 'vitest/no-done-callback'?: Linter.RuleEntry<[]>;
8091
+ /**
8092
+ * disallow duplicate hooks and teardown hooks
8093
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-duplicate-hooks.md
8094
+ */
8095
+ 'vitest/no-duplicate-hooks'?: Linter.RuleEntry<[]>;
8096
+ /**
8097
+ * disallow focused tests
8098
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-focused-tests.md
8099
+ */
8100
+ 'vitest/no-focused-tests'?: Linter.RuleEntry<VitestNoFocusedTests>;
8101
+ /**
8102
+ * disallow setup and teardown hooks
8103
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-hooks.md
8104
+ */
8105
+ 'vitest/no-hooks'?: Linter.RuleEntry<VitestNoHooks>;
8106
+ /**
8107
+ * disallow identical titles
8108
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-identical-title.md
8109
+ */
8110
+ 'vitest/no-identical-title'?: Linter.RuleEntry<[]>;
8111
+ /**
8112
+ * disallow importing `node:test`
8113
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-import-node-test.md
8114
+ */
8115
+ 'vitest/no-import-node-test'?: Linter.RuleEntry<[]>;
8116
+ /**
8117
+ * disallow importing Vitest globals
8118
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-importing-vitest-globals.md
8119
+ */
8120
+ 'vitest/no-importing-vitest-globals'?: Linter.RuleEntry<[]>;
8121
+ /**
8122
+ * disallow string interpolation in snapshots
8123
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-interpolation-in-snapshots.md
8124
+ */
8125
+ 'vitest/no-interpolation-in-snapshots'?: Linter.RuleEntry<[]>;
8126
+ /**
8127
+ * disallow large snapshots
8128
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-large-snapshots.md
8129
+ */
8130
+ 'vitest/no-large-snapshots'?: Linter.RuleEntry<VitestNoLargeSnapshots>;
8131
+ /**
8132
+ * disallow importing from __mocks__ directory
8133
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-mocks-import.md
8134
+ */
8135
+ 'vitest/no-mocks-import'?: Linter.RuleEntry<[]>;
8136
+ /**
8137
+ * disallow the use of certain matchers
8138
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-restricted-matchers.md
8139
+ */
8140
+ 'vitest/no-restricted-matchers'?: Linter.RuleEntry<VitestNoRestrictedMatchers>;
8141
+ /**
8142
+ * disallow specific `vi.` methods
8143
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-restricted-vi-methods.md
8144
+ */
8145
+ 'vitest/no-restricted-vi-methods'?: Linter.RuleEntry<VitestNoRestrictedViMethods>;
8146
+ /**
8147
+ * disallow using `expect` outside of `it` or `test` blocks
8148
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-standalone-expect.md
8149
+ */
8150
+ 'vitest/no-standalone-expect'?: Linter.RuleEntry<VitestNoStandaloneExpect>;
8151
+ /**
8152
+ * disallow using the `f` and `x` prefixes in favour of `.only` and `.skip`
8153
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-prefixes.md
8154
+ */
8155
+ 'vitest/no-test-prefixes'?: Linter.RuleEntry<[]>;
8156
+ /**
8157
+ * disallow return statements in tests
8158
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-return-statement.md
8159
+ */
8160
+ 'vitest/no-test-return-statement'?: Linter.RuleEntry<[]>;
8161
+ /**
8162
+ * Disallow unnecessary async function wrapper for expected promises
8163
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-unneeded-async-expect-function.md
8164
+ */
8165
+ 'vitest/no-unneeded-async-expect-function'?: Linter.RuleEntry<[]>;
8166
+ /**
8167
+ * Enforce padding around `afterAll` blocks
8168
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-all-blocks.md
8169
+ */
8170
+ 'vitest/padding-around-after-all-blocks'?: Linter.RuleEntry<[]>;
8171
+ /**
8172
+ * Enforce padding around `afterEach` blocks
8173
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-each-blocks.md
8174
+ */
8175
+ 'vitest/padding-around-after-each-blocks'?: Linter.RuleEntry<[]>;
8176
+ /**
8177
+ * Enforce padding around vitest functions
8178
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-all.md
8179
+ */
8180
+ 'vitest/padding-around-all'?: Linter.RuleEntry<[]>;
8181
+ /**
8182
+ * Enforce padding around `beforeAll` blocks
8183
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-before-all-blocks.md
8184
+ */
8185
+ 'vitest/padding-around-before-all-blocks'?: Linter.RuleEntry<[]>;
8186
+ /**
8187
+ * Enforce padding around `beforeEach` blocks
8188
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-before-each-blocks.md
8189
+ */
8190
+ 'vitest/padding-around-before-each-blocks'?: Linter.RuleEntry<[]>;
8191
+ /**
8192
+ * Enforce padding around `describe` blocks
8193
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-describe-blocks.md
8194
+ */
8195
+ 'vitest/padding-around-describe-blocks'?: Linter.RuleEntry<[]>;
8196
+ /**
8197
+ * Enforce padding around `expect` groups
8198
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-expect-groups.md
8199
+ */
8200
+ 'vitest/padding-around-expect-groups'?: Linter.RuleEntry<[]>;
8201
+ /**
8202
+ * Enforce padding around `test` blocks
8203
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-test-blocks.md
8204
+ */
8205
+ 'vitest/padding-around-test-blocks'?: Linter.RuleEntry<[]>;
8206
+ /**
8207
+ * Prefer `toHaveBeenCalledExactlyOnceWith` over `toHaveBeenCalledOnce` and `toHaveBeenCalledWith`
8208
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-exactly-once-with.md
8209
+ */
8210
+ 'vitest/prefer-called-exactly-once-with'?: Linter.RuleEntry<[]>;
8211
+ /**
8212
+ * enforce using `toBeCalledOnce()` or `toHaveBeenCalledOnce()`
8213
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-once.md
8214
+ */
8215
+ 'vitest/prefer-called-once'?: Linter.RuleEntry<[]>;
8216
+ /**
8217
+ * enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)`
8218
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-times.md
8219
+ */
8220
+ 'vitest/prefer-called-times'?: Linter.RuleEntry<[]>;
8221
+ /**
8222
+ * enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()`
8223
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-with.md
8224
+ */
8225
+ 'vitest/prefer-called-with'?: Linter.RuleEntry<[]>;
8226
+ /**
8227
+ * enforce using the built-in comparison matchers
8228
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-comparison-matcher.md
8229
+ */
8230
+ 'vitest/prefer-comparison-matcher'?: Linter.RuleEntry<[]>;
8231
+ /**
8232
+ * enforce using a function as a describe title over an equivalent string
8233
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-describe-function-title.md
8234
+ */
8235
+ 'vitest/prefer-describe-function-title'?: Linter.RuleEntry<[]>;
8236
+ /**
8237
+ * enforce using `each` rather than manual loops
8238
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-each.md
8239
+ */
8240
+ 'vitest/prefer-each'?: Linter.RuleEntry<[]>;
8241
+ /**
8242
+ * enforce using the built-in equality matchers
8243
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-equality-matcher.md
8244
+ */
8245
+ 'vitest/prefer-equality-matcher'?: Linter.RuleEntry<[]>;
8246
+ /**
8247
+ * enforce using expect assertions instead of callbacks
8248
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-assertions.md
8249
+ */
8250
+ 'vitest/prefer-expect-assertions'?: Linter.RuleEntry<VitestPreferExpectAssertions>;
8251
+ /**
8252
+ * enforce using `expect().resolves` over `expect(await ...)` syntax
8253
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-resolves.md
8254
+ */
8255
+ 'vitest/prefer-expect-resolves'?: Linter.RuleEntry<[]>;
8256
+ /**
8257
+ * enforce using `expectTypeOf` instead of `expect(typeof ...)`
8258
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-type-of.md
8259
+ */
8260
+ 'vitest/prefer-expect-type-of'?: Linter.RuleEntry<[]>;
8261
+ /**
8262
+ * enforce having hooks in consistent order
8263
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-in-order.md
8264
+ */
8265
+ 'vitest/prefer-hooks-in-order'?: Linter.RuleEntry<[]>;
8266
+ /**
8267
+ * enforce having hooks before any test cases
8268
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-on-top.md
8269
+ */
8270
+ 'vitest/prefer-hooks-on-top'?: Linter.RuleEntry<[]>;
8271
+ /**
8272
+ * prefer dynamic import in mock
8273
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-import-in-mock.md
8274
+ */
8275
+ 'vitest/prefer-import-in-mock'?: Linter.RuleEntry<VitestPreferImportInMock>;
8276
+ /**
8277
+ * enforce importing Vitest globals
8278
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-importing-vitest-globals.md
8279
+ */
8280
+ 'vitest/prefer-importing-vitest-globals'?: Linter.RuleEntry<[]>;
8281
+ /**
8282
+ * enforce lowercase titles
8283
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-lowercase-title.md
8284
+ */
8285
+ 'vitest/prefer-lowercase-title'?: Linter.RuleEntry<VitestPreferLowercaseTitle>;
8286
+ /**
8287
+ * enforce mock resolved/rejected shorthands for promises
8288
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-mock-promise-shorthand.md
8289
+ */
8290
+ 'vitest/prefer-mock-promise-shorthand'?: Linter.RuleEntry<[]>;
8291
+ /**
8292
+ * Prefer mock return shorthands
8293
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-mock-return-shorthand.md
8294
+ */
8295
+ 'vitest/prefer-mock-return-shorthand'?: Linter.RuleEntry<[]>;
8296
+ /**
8297
+ * enforce including a hint with external snapshots
8298
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-snapshot-hint.md
8299
+ */
8300
+ 'vitest/prefer-snapshot-hint'?: Linter.RuleEntry<VitestPreferSnapshotHint>;
8301
+ /**
8302
+ * enforce using `vi.spyOn`
8303
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-spy-on.md
8304
+ */
8305
+ 'vitest/prefer-spy-on'?: Linter.RuleEntry<[]>;
8306
+ /**
8307
+ * enforce using `toBe(true)` and `toBe(false)` over matchers that coerce types to boolean
8308
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-strict-boolean-matchers.md
8309
+ */
8310
+ 'vitest/prefer-strict-boolean-matchers'?: Linter.RuleEntry<[]>;
8311
+ /**
8312
+ * enforce strict equal over equal
8313
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-strict-equal.md
8314
+ */
8315
+ 'vitest/prefer-strict-equal'?: Linter.RuleEntry<[]>;
8316
+ /**
8317
+ * enforce using toBe()
8318
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be.md
8319
+ */
8320
+ 'vitest/prefer-to-be'?: Linter.RuleEntry<[]>;
8321
+ /**
8322
+ * enforce using toBeFalsy()
8323
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-falsy.md
8324
+ */
8325
+ 'vitest/prefer-to-be-falsy'?: Linter.RuleEntry<[]>;
8326
+ /**
8327
+ * enforce using toBeObject()
8328
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-object.md
8329
+ */
8330
+ 'vitest/prefer-to-be-object'?: Linter.RuleEntry<[]>;
8331
+ /**
8332
+ * enforce using `toBeTruthy`
8333
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-truthy.md
8334
+ */
8335
+ 'vitest/prefer-to-be-truthy'?: Linter.RuleEntry<[]>;
8336
+ /**
8337
+ * enforce using toContain()
8338
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-contain.md
8339
+ */
8340
+ 'vitest/prefer-to-contain'?: Linter.RuleEntry<[]>;
8341
+ /**
8342
+ * Suggest using `toHaveBeenCalledTimes()`
8343
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-been-called-times.md
8344
+ */
8345
+ 'vitest/prefer-to-have-been-called-times'?: Linter.RuleEntry<[]>;
8346
+ /**
8347
+ * enforce using toHaveLength()
8348
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-length.md
8349
+ */
8350
+ 'vitest/prefer-to-have-length'?: Linter.RuleEntry<[]>;
8351
+ /**
8352
+ * enforce using `test.todo`
8353
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-todo.md
8354
+ */
8355
+ 'vitest/prefer-todo'?: Linter.RuleEntry<[]>;
8356
+ /**
8357
+ * require `vi.mocked()` over `fn as Mock`
8358
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-vi-mocked.md
8359
+ */
8360
+ 'vitest/prefer-vi-mocked'?: Linter.RuleEntry<[]>;
8361
+ /**
8362
+ * ensure that every `expect.poll` call is awaited
8363
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-awaited-expect-poll.md
8364
+ */
8365
+ 'vitest/require-awaited-expect-poll'?: Linter.RuleEntry<[]>;
8366
+ /**
8367
+ * require setup and teardown to be within a hook
8368
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-hook.md
8369
+ */
8370
+ 'vitest/require-hook'?: Linter.RuleEntry<VitestRequireHook>;
8371
+ /**
8372
+ * require local Test Context for concurrent snapshot tests
8373
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-local-test-context-for-concurrent-snapshots.md
8374
+ */
8375
+ 'vitest/require-local-test-context-for-concurrent-snapshots'?: Linter.RuleEntry<[]>;
8376
+ /**
8377
+ * enforce using type parameters with vitest mock functions
8378
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-mock-type-parameters.md
8379
+ */
8380
+ 'vitest/require-mock-type-parameters'?: Linter.RuleEntry<VitestRequireMockTypeParameters>;
8381
+ /**
8382
+ * require tests to declare a timeout
8383
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-test-timeout.md
8384
+ */
8385
+ 'vitest/require-test-timeout'?: Linter.RuleEntry<[]>;
8386
+ /**
8387
+ * require toThrow() to be called with an error message
8388
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-to-throw-message.md
8389
+ */
8390
+ 'vitest/require-to-throw-message'?: Linter.RuleEntry<[]>;
8391
+ /**
8392
+ * enforce that all tests are in a top-level describe
8393
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-top-level-describe.md
8394
+ */
8395
+ 'vitest/require-top-level-describe'?: Linter.RuleEntry<VitestRequireTopLevelDescribe>;
8396
+ /**
8397
+ * enforce unbound methods are called with their expected scope
8398
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/unbound-method.md
8399
+ */
8400
+ 'vitest/unbound-method'?: Linter.RuleEntry<VitestUnboundMethod>;
8401
+ /**
8402
+ * enforce valid describe callback
8403
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-describe-callback.md
8404
+ */
8405
+ 'vitest/valid-describe-callback'?: Linter.RuleEntry<[]>;
8406
+ /**
8407
+ * enforce valid `expect()` usage
8408
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-expect.md
8409
+ */
8410
+ 'vitest/valid-expect'?: Linter.RuleEntry<VitestValidExpect>;
8411
+ /**
8412
+ * require promises that have expectations in their chain to be valid
8413
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-expect-in-promise.md
8414
+ */
8415
+ 'vitest/valid-expect-in-promise'?: Linter.RuleEntry<[]>;
8416
+ /**
8417
+ * enforce valid titles
8418
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-title.md
8419
+ */
8420
+ 'vitest/valid-title'?: Linter.RuleEntry<VitestValidTitle>;
8421
+ /**
8422
+ * disallow `.todo` usage
8423
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/warn-todo.md
8424
+ */
8425
+ 'vitest/warn-todo'?: Linter.RuleEntry<[]>;
8014
8426
  /**
8015
8427
  * Require parentheses around immediate `function` invocations
8016
8428
  * @see https://eslint.org/docs/latest/rules/wrap-iife
@@ -13916,6 +14328,99 @@ type UseIsnan = [] | [{
13916
14328
  }]; // ----- valid-typeof -----
13917
14329
  type ValidTypeof = [] | [{
13918
14330
  requireStringLiterals?: boolean;
14331
+ }]; // ----- vitest/consistent-each-for -----
14332
+ type VitestConsistentEachFor = [] | [{
14333
+ test?: ("each" | "for");
14334
+ it?: ("each" | "for");
14335
+ describe?: ("each" | "for");
14336
+ suite?: ("each" | "for");
14337
+ }]; // ----- vitest/consistent-test-filename -----
14338
+ type VitestConsistentTestFilename = [] | [{
14339
+ pattern?: string;
14340
+ allTestPattern?: string;
14341
+ }]; // ----- vitest/consistent-test-it -----
14342
+ type VitestConsistentTestIt = [] | [{
14343
+ fn?: ("test" | "it");
14344
+ withinDescribe?: ("test" | "it");
14345
+ }]; // ----- vitest/consistent-vitest-vi -----
14346
+ type VitestConsistentVitestVi = [] | [{
14347
+ fn?: ("vi" | "vitest");
14348
+ }]; // ----- vitest/expect-expect -----
14349
+ type VitestExpectExpect = [] | [{
14350
+ assertFunctionNames?: string[];
14351
+ additionalTestBlockFunctions?: string[];
14352
+ }]; // ----- vitest/max-expects -----
14353
+ type VitestMaxExpects = [] | [{
14354
+ max?: number;
14355
+ }]; // ----- vitest/max-nested-describe -----
14356
+ type VitestMaxNestedDescribe = [] | [{
14357
+ max?: number;
14358
+ }]; // ----- vitest/no-conditional-expect -----
14359
+ type VitestNoConditionalExpect = [] | [{
14360
+ expectAssertions?: boolean;
14361
+ }]; // ----- vitest/no-focused-tests -----
14362
+ type VitestNoFocusedTests = [] | [{
14363
+ fixable?: boolean;
14364
+ }]; // ----- vitest/no-hooks -----
14365
+ type VitestNoHooks = [] | [{
14366
+ allow?: ("beforeAll" | "beforeEach" | "afterAll" | "afterEach")[];
14367
+ }]; // ----- vitest/no-large-snapshots -----
14368
+ type VitestNoLargeSnapshots = [] | [{
14369
+ maxSize?: number;
14370
+ inlineMaxSize?: number;
14371
+ allowedSnapshots?: {
14372
+ [k: string]: unknown[] | undefined;
14373
+ };
14374
+ }]; // ----- vitest/no-restricted-matchers -----
14375
+ type VitestNoRestrictedMatchers = [] | [{
14376
+ [k: string]: (string | null) | undefined;
14377
+ }]; // ----- vitest/no-restricted-vi-methods -----
14378
+ type VitestNoRestrictedViMethods = [] | [{
14379
+ [k: string]: (string | null) | undefined;
14380
+ }]; // ----- vitest/no-standalone-expect -----
14381
+ type VitestNoStandaloneExpect = [] | [{
14382
+ additionalTestBlockFunctions?: string[];
14383
+ }]; // ----- vitest/prefer-expect-assertions -----
14384
+ type VitestPreferExpectAssertions = [] | [{
14385
+ onlyFunctionsWithAsyncKeyword?: boolean;
14386
+ onlyFunctionsWithExpectInLoop?: boolean;
14387
+ onlyFunctionsWithExpectInCallback?: boolean;
14388
+ }]; // ----- vitest/prefer-import-in-mock -----
14389
+ type VitestPreferImportInMock = [] | [{
14390
+ fixable?: boolean;
14391
+ }]; // ----- vitest/prefer-lowercase-title -----
14392
+ type VitestPreferLowercaseTitle = [] | [{
14393
+ ignore?: ("describe" | "test" | "it")[];
14394
+ allowedPrefixes?: string[];
14395
+ ignoreTopLevelDescribe?: boolean;
14396
+ lowercaseFirstCharacterOnly?: boolean;
14397
+ }]; // ----- vitest/prefer-snapshot-hint -----
14398
+ type VitestPreferSnapshotHint = [] | [("always" | "multi")]; // ----- vitest/require-hook -----
14399
+ type VitestRequireHook = [] | [{
14400
+ allowedFunctionCalls?: string[];
14401
+ }]; // ----- vitest/require-mock-type-parameters -----
14402
+ type VitestRequireMockTypeParameters = [] | [{
14403
+ checkImportFunctions?: boolean;
14404
+ }]; // ----- vitest/require-top-level-describe -----
14405
+ type VitestRequireTopLevelDescribe = [] | [{
14406
+ maxNumberOfTopLevelDescribes?: number;
14407
+ }]; // ----- vitest/unbound-method -----
14408
+ type VitestUnboundMethod = [] | [{
14409
+ ignoreStatic?: boolean;
14410
+ }]; // ----- vitest/valid-expect -----
14411
+ type VitestValidExpect = [] | [{
14412
+ alwaysAwait?: boolean;
14413
+ asyncMatchers?: string[];
14414
+ minArgs?: number;
14415
+ maxArgs?: number;
14416
+ }]; // ----- vitest/valid-title -----
14417
+ type VitestValidTitle = [] | [{
14418
+ ignoreTypeOfDescribeName?: boolean;
14419
+ allowArguments?: boolean;
14420
+ disallowedWords?: string[];
14421
+ [k: string]: (string | [string] | [string, string] | {
14422
+ [k: string]: (string | [string] | [string, string]) | undefined;
14423
+ });
13919
14424
  }]; // ----- wrap-iife -----
13920
14425
  type WrapIife = [] | [("outside" | "inside" | "any")] | [("outside" | "inside" | "any"), {
13921
14426
  functionPrototypeMethods?: boolean;
@@ -14139,7 +14644,7 @@ type ZodSchemaErrorPropertyStyle = [] | [{
14139
14644
  selector?: string;
14140
14645
  example?: string;
14141
14646
  }]; // Names of all the configs
14142
- type ConfigNames = '2digits:antfu' | '2digits:boolean' | '2digits:comments' | '2digits:css' | '2digits:depend' | '2digits:drizzle' | '2digits:github-actions/setup' | '2digits:github-actions/recommended' | '2digits:graphql' | '2digits:ignores' | '2digits:gitignore' | '2digits:javascript' | '2digits:jsdoc' | '2digits:jsonc/base' | '2digits:jsonc/base' | '2digits:jsonc/json' | '2digits:jsonc/jsonc' | '2digits:jsonc/json5' | '2digits:jsonc/package.json' | '2digits:jsonc/tsconfig.json' | '2digits:jsonc/prettier' | '2digits:jsonc/prettier' | '2digits:jsonc/prettier' | '2digits:markdown/setup' | '2digits:markdown/processor' | '2digits:markdown/parser' | '2digits:markdown/rules' | '2digits:markdown/disables' | '2digits:next/setup' | '2digits:next/rules' | '2digits:next/proxy' | '2digits:node' | '2digits:pnpm/package-json' | '2digits:pnpm/pnpm-workspace-yaml' | '2digits:prettier' | '2digits:react/setup' | '2digits:react/rules' | '2digits:regexp' | '2digits:sonar' | '2digits:storybook/setup' | '2digits:storybook/rules' | '2digits:storybook/disables' | '2digits:storybook/config' | '2digits:tailwind' | '2digits:tanstack-query' | '2digits:tanstack-router' | '2digits:toml' | '2digits:turbo' | '2digits:typescript/setup' | '2digits:typescript/rules' | '2digits:typescript/disables/dts' | '2digits:typescript/disables/test' | '2digits:typescript/disables/cjs' | '2digits:unicorn' | '2digits:yaml/setup' | '2digits:yaml/base' | '2digits:yaml/recommended' | '2digits:yaml/standard' | '2digits:yaml/prettier' | '2digits:zod';
14647
+ type ConfigNames = '2digits:antfu' | '2digits:boolean' | '2digits:comments' | '2digits:css' | '2digits:depend' | '2digits:drizzle' | '2digits:github-actions/setup' | '2digits:github-actions/recommended' | '2digits:graphql' | '2digits:ignores' | '2digits:gitignore' | '2digits:javascript' | '2digits:jsdoc' | '2digits:jsonc/base' | '2digits:jsonc/base' | '2digits:jsonc/json' | '2digits:jsonc/jsonc' | '2digits:jsonc/json5' | '2digits:jsonc/package.json' | '2digits:jsonc/tsconfig.json' | '2digits:jsonc/prettier' | '2digits:jsonc/prettier' | '2digits:jsonc/prettier' | '2digits:markdown/setup' | '2digits:markdown/processor' | '2digits:markdown/parser' | '2digits:markdown/rules' | '2digits:markdown/disables' | '2digits:next/setup' | '2digits:next/rules' | '2digits:next/proxy' | '2digits:node' | '2digits:pnpm/package-json' | '2digits:pnpm/pnpm-workspace-yaml' | '2digits:prettier' | '2digits:react/setup' | '2digits:react/rules' | '2digits:regexp' | '2digits:sonar' | '2digits:storybook/setup' | '2digits:storybook/rules' | '2digits:storybook/disables' | '2digits:storybook/config' | '2digits:tailwind' | '2digits:tanstack-query' | '2digits:tanstack-router' | '2digits:toml' | '2digits:turbo' | '2digits:typescript/setup' | '2digits:typescript/rules' | '2digits:typescript/disables/dts' | '2digits:typescript/disables/test' | '2digits:typescript/disables/cjs' | '2digits:unicorn' | '2digits:vitest/setup' | '2digits:vitest/rules' | '2digits:yaml/setup' | '2digits:yaml/base' | '2digits:yaml/recommended' | '2digits:yaml/standard' | '2digits:yaml/prettier' | '2digits:zod';
14143
14648
  //#endregion
14144
14649
  //#region src/types.d.ts
14145
14650
  type Rules = RuleOptions;
@@ -14195,6 +14700,18 @@ interface OptionsWithStorybook extends OptionsWithFiles {
14195
14700
  */
14196
14701
  storybookDirectory?: string;
14197
14702
  }
14703
+ interface OptionsWithVitest extends OptionsWithFiles {
14704
+ /**
14705
+ * Enable type-aware Vitest lint rules for `expectTypeOf` and related APIs.
14706
+ *
14707
+ * @default true
14708
+ */
14709
+ typecheck?: boolean;
14710
+ /**
14711
+ * Additional modules that export custom Vitest fixtures.
14712
+ */
14713
+ vitestImports?: Array<RegExp | string>;
14714
+ }
14198
14715
  interface OptionsWithReact extends OptionsWithFiles {
14199
14716
  /**
14200
14717
  * Enable the react-compiler plugin.
@@ -14241,6 +14758,7 @@ interface ESLint2DigitsOptions {
14241
14758
  next?: SharedOptions<OptionsWithFiles> | boolean;
14242
14759
  tailwind?: SharedOptions<OptionsOverrides> | boolean;
14243
14760
  storybook?: SharedOptions<OptionsWithStorybook> | boolean;
14761
+ vitest?: SharedOptions<OptionsWithVitest> | boolean;
14244
14762
  tanstackQuery?: SharedOptions<OptionsOverrides> | boolean;
14245
14763
  tanstackRouter?: SharedOptions<OptionsOverrides> | boolean;
14246
14764
  drizzle?: SharedOptions<OptionsWithDrizzle> | boolean;
@@ -14249,4 +14767,4 @@ interface ESLint2DigitsOptions {
14249
14767
  }
14250
14768
  declare function twoDigits(options?: ESLint2DigitsOptions, ...userConfig: Array<TypedFlatConfigItem>): Promise<Array<TypedFlatConfigItem>>;
14251
14769
  //#endregion
14252
- export { type ConfigNames, OptionsCss, OptionsOverrides, OptionsTypeScriptWithTypes, OptionsWithDrizzle, OptionsWithFiles, OptionsWithIgnores, OptionsWithReact, OptionsWithStorybook, Rules, TypedFlatConfigItem, twoDigits as default, twoDigits };
14770
+ export { type ConfigNames, OptionsCss, OptionsOverrides, OptionsTypeScriptWithTypes, OptionsWithDrizzle, OptionsWithFiles, OptionsWithIgnores, OptionsWithReact, OptionsWithStorybook, OptionsWithVitest, Rules, TypedFlatConfigItem, twoDigits as default, twoDigits };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{FlatConfigComposer as e,renamePluginsInConfigs as t,renamePluginsInRules as n}from"eslint-flat-config-utils";import{getPackageInfo as r,isPackageExists as i}from"local-pkg";import{findWorkspaceDir as a}from"pkg-types";import o from"eslint-plugin-antfu";import s,{configs as c}from"eslint-plugin-de-morgan";import l from"@eslint-community/eslint-plugin-eslint-comments";import u from"@eslint-community/eslint-plugin-eslint-comments/configs";import d from"@eslint/css";import{tailwind3 as f,tailwind4 as p}from"tailwind-csstree";import m from"eslint-plugin-depend";import{fixupPluginRules as h}from"@eslint/compat";import g,{configs as _}from"eslint-plugin-github-action";import*as v from"yaml-eslint-parser";import y from"eslint-config-flat-gitignore";import ee from"@eslint/js";import te from"@stylistic/eslint-plugin";import b from"globals";import x from"eslint-plugin-jsdoc";import S,{configs as C}from"eslint-plugin-jsonc";import*as w from"jsonc-eslint-parser";import T from"@eslint/markdown";import{mergeProcessors as ne,processorPassThrough as re}from"eslint-merge-processors";import ie from"eslint-plugin-n";import ae,{configs as oe}from"eslint-plugin-regexp";import se from"eslint-plugin-sonarjs";import*as E from"empathic/find";import ce,{configs as le}from"eslint-plugin-toml";import D from"eslint-plugin-unicorn";import O from"eslint-plugin-yml";const k=`**/*.?([cm])[jt]s?(x)`,A=`**/*.?([cm])ts`,j=`**/*.?([cm])tsx`,M=`.github/workflows/*.y?(a)ml`,N=`**/*.md`,P=`${N}/${k}`,F=`**/node_modules,**/dist,**/package-lock.json,**/yarn.lock,**/pnpm-lock.yaml,**/bun.lockb,**/bun.lock,**/output,**/coverage,**/temp,**/.temp,**/tmp,**/.tmp,**/.history,**/.vitepress/cache,**/.nuxt,**/.next,**/.vercel,**/.changeset,**/.idea,**/.cache,**/.output,**/.vite-inspect,**/.yarn,**/CHANGELOG*.md,**/*.min.*,**/LICENSE*,**/__snapshots__,**/auto-import?(s).d.ts,**/components.d.ts`.split(`,`);function I(){return[{files:[k],name:`2digits:antfu`,plugins:{antfu:o},rules:{"antfu/top-level-function":`error`}}]}function L(){return[{files:[k],name:`2digits:boolean`,plugins:{boolean:s},rules:{...c.recommended.rules}}]}const R={"@next/next":`next`,"@eslint-react":`react-extra`,"react-hooks":`react-hooks`,"react-compiler":`react-compiler`,"@stylistic/eslint-plugin":`stylistic`,"@typescript-eslint":`ts`,node:`node`,"@eslint-community/eslint-comments":`comments`,storybook:`storybook`,turbo:`turbo`,jsdoc:`jsdoc`,unicorn:`unicorn`,tailwindcss:`tailwindcss`,"@tanstack/query":`tanstack-query`,"@tanstack/router":`tanstack-router`,"@2digits":`@2digits`,"@graphql-eslint":`gql`,sonarjs:`sonar`,drizzle:`drizzle`,"de-morgan":`boolean`,antfu:`antfu`,css:`css`,depend:`depend`,"github-action":`github-action`,jsonc:`jsonc`,markdown:`markdown`,pnpm:`pnpm`,regexp:`regexp`,yml:`yml`,zod:`zod`,toml:`toml`},z=[`storybook`,`@storybook/nextjs`,`@storybook/nextjs-vite`,`@storybook/react-vite`,`@storybook/react-webpack5`,`@storybook/react-native-web-vite`],B=n(u.recommended.rules,R);function V(){return[{files:[k],name:`2digits:comments`,plugins:{comments:l},rules:{...B,"comments/no-unused-disable":`error`,"comments/disable-enable-pair":[`error`,{allowWholeFile:!0}]}}]}async function H(e){if(e?.customSyntax)return e.customSyntax;if(e?.tailwindMajor===3)return f;if(e?.tailwindMajor===4)return p;try{let e=(await r(`tailwindcss`))?.version??``,t=Number.parseInt(e.split(`.`)[0]??`0`,10);if(Number.isFinite(t)&&t>=4)return p}catch{}return f}async function U(e={}){let t=await H(e);return[{name:`2digits:css`,files:[`**/*.css`],language:`css/css`,plugins:{css:d},languageOptions:{tolerant:!0,customSyntax:t},rules:{...d.configs.recommended.rules,...e.overrides}}]}function W(){return[{files:[k],name:`2digits:depend`,plugins:{depend:m},rules:{"depend/ban-dependencies":`warn`}}]}async function G(e){let t=await e;return t.default??t}async function ue(e={}){let{overrides:t={},drizzleObjectName:n=[`drizzle`,`db`]}=e,r=await G(import(`eslint-plugin-drizzle`));return[{files:[k],name:`2digits:drizzle`,plugins:{drizzle:h(r)},rules:{"drizzle/enforce-update-with-where":[`error`,{drizzleObjectName:n}],"drizzle/enforce-delete-with-where":[`error`,{drizzleObjectName:n}],...t}}]}const de=Object.fromEntries(_.recommended.flatMap(({rules:e})=>Object.entries({...e})));function fe(){return[{name:`2digits:github-actions/setup`,plugins:{"github-action":g}},{name:`2digits:github-actions/recommended`,files:[M],ignores:[`!**/${M}`],languageOptions:{parser:v},rules:{...de}}]}async function pe(e={}){let{overrides:t={},files:r=[`**/*.graphql`,`**/*.gql`]}=e,[i,a]=await Promise.all([G(import(`@graphql-eslint/eslint-plugin`)),import(`graphql-config`).then(({loadConfig:e})=>e({throwOnEmpty:!1,throwOnMissing:!1}).then(e=>e?.getDefault().schema))]),o=i.configs[`flat/operations-recommended`].rules,s={};if(a)s=o;else for(let e of Object.keys(o)){let t=e.replace(`@graphql-eslint/`,``);t in i.rules&&(i.rules[t].meta.docs?.requiresSchema||i.rules[t].meta.docs?.requiresSiblings)||(s[e]=o[e])}let c=n(s,R);return[{name:`2digits:graphql`,plugins:{gql:i},languageOptions:{parser:i.parser},files:r,rules:{...c,"gql/naming-convention":[`error`,{allowLeadingUnderscore:!0}],...t}}]}function me(e={}){let{gitIgnore:t,ignores:n=[]}=e;return[{ignores:[F,n].flat(),name:`2digits:ignores`},y({strict:!1,...t,name:`2digits:gitignore`})]}function he(e={}){let{overrides:t={}}=e;return[{files:[k],name:`2digits:javascript`,plugins:{stylistic:te},languageOptions:{ecmaVersion:2022,globals:{...b.browser,...b.es2021,...b.node,document:`readonly`,navigator:`readonly`,window:`readonly`},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:`module`},sourceType:`module`},linterOptions:{reportUnusedDisableDirectives:!0},rules:{...ee.configs.recommended.rules,"accessor-pairs":[`error`,{enforceForClassMembers:!0,setWithoutGet:!0}],"array-callback-return":`error`,"block-scoped-var":`error`,"constructor-super":`error`,"default-case-last":`error`,"dot-notation":[`error`,{allowKeywords:!0}],eqeqeq:[`error`,`smart`],"new-cap":[`error`,{capIsNew:!1,newIsCap:!0,properties:!0}],"no-alert":`error`,"no-array-constructor":`error`,"no-async-promise-executor":`error`,"no-caller":`error`,"no-case-declarations":`error`,"no-class-assign":`error`,"no-compare-neg-zero":`error`,"no-cond-assign":[`error`,`always`],"no-const-assign":`error`,"no-control-regex":`error`,"no-debugger":`error`,"no-delete-var":`error`,"no-dupe-args":`error`,"no-dupe-class-members":`error`,"no-dupe-keys":`error`,"no-duplicate-case":`error`,"no-empty":[`error`,{allowEmptyCatch:!0}],"no-empty-character-class":`error`,"no-empty-pattern":`error`,"no-eval":`error`,"no-ex-assign":`error`,"no-extend-native":`error`,"no-extra-bind":`error`,"no-extra-boolean-cast":`error`,"no-fallthrough":`error`,"no-func-assign":`error`,"no-global-assign":`error`,"no-implied-eval":`error`,"no-import-assign":`error`,"no-invalid-regexp":`error`,"no-irregular-whitespace":`error`,"no-iterator":`error`,"no-labels":[`error`,{allowLoop:!1,allowSwitch:!1}],"no-lone-blocks":`error`,"no-loss-of-precision":`error`,"no-misleading-character-class":`error`,"no-multi-str":`error`,"no-new":`error`,"no-new-func":`error`,"no-new-native-nonconstructor":`error`,"no-new-wrappers":`error`,"no-obj-calls":`error`,"no-octal":`error`,"no-octal-escape":`error`,"no-proto":`error`,"no-prototype-builtins":`error`,"no-redeclare":[`error`,{builtinGlobals:!1}],"no-regex-spaces":`error`,"no-restricted-globals":[`error`,{message:"Use `globalThis` instead.",name:`global`},{message:"Use `globalThis` instead.",name:`self`}],"no-restricted-properties":[`error`,{message:"Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",property:`__proto__`},{message:"Use `Object.defineProperty` instead.",property:`__defineGetter__`},{message:"Use `Object.defineProperty` instead.",property:`__defineSetter__`},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:`__lookupGetter__`},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:`__lookupSetter__`}],"no-restricted-syntax":[`error`,`DebuggerStatement`,`LabeledStatement`,`WithStatement`,`TSEnumDeclaration`,`TSExportAssignment`],"no-self-assign":[`error`,{props:!0}],"no-self-compare":`error`,"no-sequences":`error`,"no-shadow-restricted-names":`error`,"no-sparse-arrays":`error`,"no-template-curly-in-string":`error`,"no-this-before-super":`error`,"no-throw-literal":`error`,"no-undef":`error`,"no-undef-init":`error`,"no-unexpected-multiline":`error`,"no-unmodified-loop-condition":`error`,"no-unneeded-ternary":[`error`,{defaultAssignment:!1}],"no-unreachable":`error`,"no-unreachable-loop":`error`,"no-unsafe-finally":`error`,"no-unsafe-negation":`error`,"no-unused-expressions":[`error`,{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-unused-vars":[`error`,{args:`none`,caughtErrors:`none`,ignoreRestSiblings:!0,vars:`all`}],"no-useless-assignment":`off`,"no-useless-backreference":`error`,"no-useless-call":`error`,"no-useless-catch":`error`,"no-useless-computed-key":`error`,"no-useless-constructor":`error`,"no-useless-rename":`error`,"no-var":`error`,"no-with":`error`,"object-shorthand":[`error`,`always`,{avoidQuotes:!0,ignoreConstructors:!1}],"one-var":[`error`,{initialized:`never`}],"prefer-arrow-callback":[`error`,{allowNamedFunctions:!0,allowUnboundThis:!0}],"prefer-const":[`error`,{destructuring:`all`,ignoreReadBeforeAssign:!0}],"prefer-exponentiation-operator":`error`,"prefer-promise-reject-errors":`error`,"prefer-regex-literals":[`error`,{disallowRedundantWrapping:!0}],"prefer-rest-params":`error`,"prefer-spread":`error`,"prefer-template":`error`,"symbol-description":`error`,"unicode-bom":[`error`,`never`],"use-isnan":[`error`,{enforceForIndexOf:!0,enforceForSwitchCase:!0}],"valid-typeof":[`error`,{requireStringLiterals:!0}],"vars-on-top":`error`,yoda:[`error`,`never`],"stylistic/padding-line-between-statements":[`error`,{blankLine:`always`,prev:[`const`,`let`],next:`*`},{blankLine:`any`,prev:[`const`,`let`],next:[`const`,`let`]},{blankLine:`always`,prev:`*`,next:`return`}],...t}}]}function ge(){return[{files:[k],name:`2digits:jsdoc`,plugins:{jsdoc:x},rules:{"jsdoc/check-access":`error`,"jsdoc/check-param-names":`error`,"jsdoc/check-property-names":`error`,"jsdoc/check-tag-names":[`error`,{typed:!0}],"jsdoc/check-types":`error`,"jsdoc/empty-tags":`error`,"jsdoc/implements-on-classes":`error`,"jsdoc/no-defaults":`error`,"jsdoc/no-multi-asterisks":`error`,"jsdoc/require-param":`error`,"jsdoc/require-param-name":`error`,"jsdoc/require-property":`error`,"jsdoc/require-property-description":`error`,"jsdoc/require-property-name":`error`,"jsdoc/require-returns-check":`error`,"jsdoc/require-returns-description":`error`,"jsdoc/require-yields":`error`,"jsdoc/require-yields-check":`error`}}]}function _e(){return[...C[`flat/base`].map(e=>({...e,name:`2digits:jsonc/base`})),{name:`2digits:jsonc/json`,files:[`**/*.json`],...K,rules:{...q(C[`flat/recommended-with-json`])}},{name:`2digits:jsonc/jsonc`,files:[`**/*.jsonc`],...K,rules:{...q(C[`flat/recommended-with-jsonc`])}},{name:`2digits:jsonc/json5`,files:[`**/*.json5`],...K,rules:{...q(C[`flat/recommended-with-json5`])}},{name:`2digits:jsonc/package.json`,...K,files:[`**/package.json`],rules:{"jsonc/sort-array-values":[`error`,{order:{type:`asc`},pathPattern:`^files$`}],"jsonc/sort-keys":[`error`,{order:{type:`asc`},pathPattern:`^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$`},{order:[`types`,`import`,`module`,`require`,`default`],pathPattern:`^exports.*$`}]}},{name:`2digits:jsonc/tsconfig.json`,...K,files:[`**/tsconfig.json`,`**/tsconfig.*.json`,`**/tsconfig-*.json`,`**/jsconfig.json`,`**/jsconfig.*.json`,`**/jsconfig-*.json`],rules:{"jsonc/sort-keys":[`error`,{order:[`$schema`,`extends`,`compilerOptions`,`references`,`files`,`include`,`exclude`],pathPattern:`^$`},{order:`incremental.composite.tsBuildInfoFile.disableSourceOfProjectReferenceRedirect.disableSolutionSearching.disableReferencedProjectLoad.target.lib.jsx.experimentalDecorators.emitDecoratorMetadata.jsxFactory.jsxFragmentFactory.jsxImportSource.reactNamespace.noLib.useDefineForClassFields.moduleDetection.module.rootDir.moduleResolution.baseUrl.paths.rootDirs.typeRoots.types.allowUmdGlobalAccess.moduleSuffixes.allowImportingTsExtensions.resolvePackageJsonExports.resolvePackageJsonImports.customConditions.resolveJsonModule.allowArbitraryExtensions.noResolve.allowJs.checkJs.maxNodeModuleJsDepth.declaration.declarationMap.emitDeclarationOnly.sourceMap.inlineSourceMap.outFile.outDir.removeComments.noEmit.importHelpers.importsNotUsedAsValues.downlevelIteration.sourceRoot.mapRoot.inlineSources.emitBOM.newLine.stripInternal.noEmitHelpers.noEmitOnError.preserveConstEnums.declarationDir.preserveValueImports.isolatedModules.verbatimModuleSyntax.allowSyntheticDefaultImports.esModuleInterop.preserveSymlinks.forceConsistentCasingInFileNames.strict.strictBindCallApply.strictFunctionTypes.strictNullChecks.strictPropertyInitialization.allowUnreachableCode.allowUnusedLabels.alwaysStrict.exactOptionalPropertyTypes.noFallthroughCasesInSwitch.noImplicitAny.noImplicitOverride.noImplicitReturns.noImplicitThis.noPropertyAccessFromIndexSignature.noUncheckedIndexedAccess.noUnusedLocals.noUnusedParameters.useUnknownInCatchVariables.skipDefaultLibCheck.skipLibCheck`.split(`.`),pathPattern:`^compilerOptions$`}]}},...C[`flat/prettier`].map(e=>({...e,name:`2digits:jsonc/prettier`}))]}const K={languageOptions:{parser:w},plugins:{jsonc:S}};function q(e){return Object.fromEntries(e.flatMap(({rules:e})=>Object.entries(e??{})))}const J=[N];function ve(){return[{name:`2digits:markdown/setup`,plugins:{markdown:T}},{name:`2digits:markdown/processor`,files:J,language:`markdown/gfm`,ignores:[`**/*.md/*.md`],processor:ne([T.processors.markdown,re])},{name:`2digits:markdown/parser`,files:J,language:`markdown/gfm`,languageOptions:{parser:be}},{name:`2digits:markdown/rules`,files:J,language:`markdown/gfm`,rules:{"markdown/fenced-code-language":`error`,"markdown/heading-increment":`error`,"markdown/no-empty-links":`error`,"markdown/no-invalid-label-refs":`error`,"markdown/no-missing-label-refs":`error`}}]}async function ye(){let e=await G(import(`typescript-eslint`)),t=await G(import(`@eslint-react/eslint-plugin`)),r=n({...e.configs.disableTypeChecked.rules,...t.configs[`disable-type-checked`].rules},R);return[{name:`2digits:markdown/disables`,files:[P],languageOptions:{parser:e.parser,parserOptions:{project:!1,projectService:!1,ecmaFeatures:{impliedStrict:!0}}},rules:{...r,"no-alert":`off`,"no-console":`off`,"no-labels":`off`,"no-lone-blocks":`off`,"no-restricted-syntax":`off`,"no-undef":`off`,"no-unused-expressions":`off`,"no-unused-labels":`off`,"no-unused-vars":`off`,"node/prefer-global/process":`off`,"ts/consistent-type-imports":`off`,"ts/explicit-function-return-type":`off`,"ts/no-namespace":`off`,"ts/no-redeclare":`off`,"ts/no-require-imports":`off`,"ts/no-unused-expressions":`off`,"ts/no-unused-vars":`off`,"ts/no-use-before-define":`off`,"unicode-bom":`off`}}]}const be={meta:{name:`parser-plain`},parseForESLint:e=>({ast:{body:[],comments:[],loc:{end:e.length,start:0},range:[0,e.length],tokens:[],type:`Program`},scopeManager:null,services:{isPlain:!0},visitorKeys:{Program:[]}})};async function xe(e={}){let{files:t=[A,j],overrides:r={},parserOptions:i}=e,[a,o]=await Promise.all([G(import(`@next/eslint-plugin-next`)),G(import(`@typescript-eslint/parser`))]),s=n({...a.configs.recommended.rules,...a.configs[`core-web-vitals`].rules},R);return[{name:`2digits:next/setup`,plugins:{next:h(a)}},{name:`2digits:next/rules`,files:t,languageOptions:{parser:o,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...i},sourceType:`module`},rules:{...s,"next/no-html-link-for-pages":`off`,...r}},{files:[`**/middleware.ts`,`**/proxy.ts`],name:`2digits:next/proxy`,rules:{"unicorn/prefer-string-raw":`off`}}]}var Se={node:`24.14.1`};function Ce(){return[{files:[k],name:`2digits:node`,settings:{node:{version:Se.node}},plugins:{node:ie},rules:{"node/handle-callback-err":[`error`,`^(err|error)$`],"node/no-deprecated-api":`error`,"node/no-exports-assign":`error`,"node/no-new-require":`error`,"node/no-path-concat":`error`,"node/no-unsupported-features/node-builtins":[`error`,{allowExperimental:!0}],"node/prefer-global/buffer":`error`,"node/prefer-global/process":`error`,"node/prefer-global/text-encoder":`error`,"node/prefer-global/url":`error`,"node/prefer-global/console":`error`,"node/prefer-global/url-search-params":`error`,"node/prefer-global/text-decoder":`error`,"node/process-exit-as-throw":`error`}}]}async function we(){let e=await G(import(`eslint-plugin-pnpm`));return[{name:`2digits:pnpm/package-json`,files:[`package.json`,`**/package.json`],languageOptions:{parser:w},plugins:{pnpm:e},rules:{"pnpm/json-enforce-catalog":`error`,"pnpm/json-prefer-workspace-settings":`error`,"pnpm/json-valid-catalog":`error`}},{name:`2digits:pnpm/pnpm-workspace-yaml`,files:[`pnpm-workspace.yaml`],languageOptions:{parser:await G(import(`yaml-eslint-parser`))},plugins:{pnpm:e},rules:{"pnpm/yaml-no-duplicate-catalog-item":`error`,"pnpm/yaml-no-unused-catalog-item":`error`,"pnpm/yaml-valid-packages":`error`,"pnpm/yaml-enforce-settings":[`error`,{autofix:!0,settings:{catalogMode:`strict`,savePrefix:``,preferWorkspacePackages:!0,cleanupUnusedCatalogs:!0}}]}}]}async function Te(){let[e,t]=await Promise.all([G(import(`eslint-config-prettier`)),G(import(`@stylistic/eslint-plugin`))]);return[{name:`2digits:prettier`,plugins:{stylistic:t},rules:{...e.rules,"tailwindcss/classnames-order":`off`,"stylistic/jsx-newline":[`error`,{prevent:!1}]}}]}async function Ee(e={}){let{files:t=[A,j],overrides:r={},parserOptions:i,tsconfigRootDir:a,reactCompiler:o=!0}=e,[s,c,l,u]=await Promise.all([G(import(`@eslint-react/eslint-plugin`)),G(import(`@typescript-eslint/parser`)),o?G(import(`eslint-plugin-react-compiler`)):Promise.resolve(void 0),G(import(`@stylistic/eslint-plugin`))]),d=s.configs.all.plugins,f=n({...s.configs[`disable-conflict-eslint-plugin-react`].rules,...s.configs[`disable-conflict-eslint-plugin-react-hooks`].rules,...s.configs[`strict-type-checked`].rules},R);return[{name:`2digits:react/setup`,plugins:{stylistic:u,"react-extra":d[`@eslint-react`],...o?{"react-compiler":l}:{}},settings:{react:{version:`detect`}}},{name:`2digits:react/rules`,files:t,languageOptions:{parser:c,parserOptions:{ecmaFeatures:{jsx:!0},tsconfigRootDir:a,projectService:!0,...i},sourceType:`module`},rules:{...f,...o?{"react-compiler/react-compiler":`error`}:{},"react-extra/exhaustive-deps":`error`,"react-extra/purity":`error`,"react-extra/no-unused-class-component-members":`error`,"react-extra/no-unnecessary-use-callback":`error`,"react-extra/no-unnecessary-use-prefix":`error`,"react-extra/no-unnecessary-use-memo":`error`,"react-extra/set-state-in-effect":`error`,"react-extra/use-state":`error`,"react-extra/no-unstable-context-value":`error`,"react-extra/no-unstable-default-props":`error`,"react-extra/no-unused-props":`error`,"react-extra/no-context-provider":`error`,"react-extra/no-forward-ref":`error`,"react-extra/no-use-context":`error`,"react-extra/immutability":`error`,"react-extra/refs":`error`,"react-extra/no-duplicate-key":`error`,"react-extra/dom-no-missing-button-type":`error`,"react-extra/dom-no-missing-iframe-sandbox":`error`,"react-extra/dom-no-unsafe-target-blank":`error`,"react-extra/naming-convention-context-name":`error`,"react-extra/naming-convention-id-name":`error`,"react-extra/naming-convention-ref-name":`error`,"react-extra/prefer-namespace-import":`error`,"react-extra/jsx-no-useless-fragment":`off`,"stylistic/jsx-curly-newline":`off`,"stylistic/jsx-newline":[`error`,{prevent:!1}],"stylistic/jsx-self-closing-comp":`error`,...r}}]}function De(){return[{files:[k],name:`2digits:regexp`,plugins:{regexp:ae},rules:{...oe[`flat/recommended`].rules}}]}function Oe(){return[{files:[k],name:`2digits:sonar`,plugins:{sonar:se},rules:{"sonar/cognitive-complexity":`error`,"sonar/comma-or-logical-or-case":`error`,"sonar/concise-regex":`error`,"sonar/confidential-information-logging":`error`,"sonar/constructor-for-side-effects":`error`,"sonar/content-length":`error`,"sonar/content-security-policy":`error`,"sonar/cookie-no-httponly":`error`,"sonar/cors":`error`,"sonar/csrf":`error`,"sonar/max-switch-cases":`error`,"sonar/no-all-duplicated-branches":`error`,"sonar/no-collapsible-if":`error`,"sonar/no-collection-size-mischeck":`error`,"sonar/no-duplicate-string":[`error`,{threshold:5}],"sonar/no-duplicated-branches":`error`,"sonar/no-element-overwrite":`error`,"sonar/no-empty-collection":`error`,"sonar/no-extra-arguments":`error`,"sonar/no-for-in-iterable":`error`,"sonar/no-gratuitous-expressions":`error`,"sonar/no-identical-conditions":`error`,"sonar/no-identical-expressions":`error`,"sonar/no-identical-functions":`error`,"sonar/no-ignored-return":`error`,"sonar/no-inverted-boolean-check":`error`,"sonar/no-nested-switch":`error`,"sonar/no-nested-template-literals":`error`,"sonar/no-redundant-boolean":`error`,"sonar/no-same-line-conditional":`error`,"sonar/no-small-switch":`error`,"sonar/no-unused-collection":`error`,"sonar/no-use-of-empty-return-value":`error`,"sonar/no-useless-catch":`error`,"sonar/non-existent-operator":`error`,"sonar/prefer-immediate-return":`error`,"sonar/prefer-object-literal":`error`,"sonar/prefer-single-boolean-return":`error`,"sonar/prefer-while":`error`,"sonar/elseif-without-else":`off`,"sonar/no-redundant-jump":`off`}}]}async function ke(e={}){let{files:t=[`**/*.stories.tsx`],overrides:n={},parserOptions:r,storybookDirectory:i=`.storybook`}=e,[a,o]=await Promise.all([G(import(`eslint-plugin-storybook`)),G(import(`@typescript-eslint/parser`))]),s={parser:o,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...r},sourceType:`module`};return[{name:`2digits:storybook/setup`,plugins:{storybook:a}},{name:`2digits:storybook/rules`,files:t,languageOptions:s,rules:{"storybook/await-interactions":`error`,"storybook/context-in-play-function":`error`,"storybook/csf-component":`error`,"storybook/default-exports":`error`,"storybook/hierarchy-separator":`error`,"storybook/meta-inline-properties":`error`,"storybook/no-redundant-story-name":`error`,"storybook/no-stories-of":`error`,"storybook/no-title-property-in-meta":`error`,"storybook/no-uninstalled-addons":`error`,"storybook/prefer-pascal-case":`error`,"storybook/story-exports":`error`,"storybook/use-storybook-expect":`error`,"storybook/use-storybook-testing-library":`error`,"storybook/meta-satisfies-type":`error`,"storybook/no-renderer-packages":`error`,...n}},{name:`2digits:storybook/disables`,files:t,rules:{"sonar/no-duplicate-string":`off`}},{name:`2digits:storybook/config`,files:[`${i}/main.@(js|cjs|mjs|ts)`],languageOptions:s,rules:{"storybook/no-uninstalled-addons":`error`}}]}async function Ae(e={}){let{overrides:t={}}=e,[n,{tailwindFunctions:r},i]=await Promise.all([G(import(`eslint-plugin-tailwindcss`)),G(import(`@2digits/constants`)),a().catch(()=>void 0)]),o=E.file(`tailwind.config.ts`,{last:i})??E.file(`tailwind.config.js`,{last:i});return[{files:[k],name:`2digits:tailwind`,plugins:{tailwindcss:n},settings:{tailwindcss:{callees:r,config:o}},rules:{...n.configs.recommended.rules,...t}}]}async function je(e={}){let{overrides:t={}}=e,r=await G(import(`@tanstack/eslint-plugin-query`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},R);return[{files:[k],name:`2digits:tanstack-query`,plugins:{"tanstack-query":r},rules:{...i,"tanstack-query/prefer-query-options":`error`,...t}}]}async function Y(e={}){let{overrides:t={}}=e,r=await G(import(`@tanstack/eslint-plugin-router`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},R);return[{files:[k],name:`2digits:tanstack-router`,plugins:{"tanstack-router":r},rules:{...i,"ts/only-throw-error":[`error`,{allow:[{from:`package`,package:`@tanstack/router-core`,name:`Redirect`}]}],...t}}]}const Me=Object.fromEntries(le.standard.flatMap(({rules:e})=>Object.entries({...e})));function Ne(){return[{name:`2digits:toml`,files:[`**/*.toml`],language:`toml/toml`,plugins:{toml:ce},rules:{...Me,"toml/array-bracket-spacing":[`error`,`never`],"toml/array-element-newline":[`error`,`consistent`],"toml/indent":[`error`,2,{keyValuePairs:0,subTables:0}]}}]}async function Pe(e={}){let{overrides:t={}}=e,n=await G(import(`eslint-plugin-turbo`));return[{files:[k],name:`2digits:turbo`,plugins:{turbo:n},rules:{"turbo/no-undeclared-env-vars":`error`,...t}}]}async function Fe(e={}){let{overrides:n={},parserOptions:r={}}=e,[{plugin:i,configs:a,parser:o},s]=await Promise.all([G(import(`typescript-eslint`)),G(import(`@2digits/eslint-plugin`))]),c=t(a.strictTypeChecked,R),l=Object.fromEntries(c.flatMap(({rules:e})=>Object.entries(e??{})));return[{name:`2digits:typescript/setup`,plugins:{ts:i,"@2digits":s}},{name:`2digits:typescript/rules`,files:[k],languageOptions:{parser:o,parserOptions:{tsconfigRootDir:process.cwd(),projectService:!0,warnOnUnsupportedTypeScriptVersion:!1,...r},sourceType:`module`},rules:{...l,"ts/array-type":[`error`,{default:`generic`,readonly:`generic`}],"ts/restrict-template-expressions":[`error`,{allowNumber:!0}],"ts/ban-ts-comment":[`error`,{"ts-ignore":`allow-with-description`}],"ts/consistent-type-exports":[`error`],"ts/consistent-type-imports":[`error`,{prefer:`type-imports`,disallowTypeAnnotations:!1,fixStyle:`inline-type-imports`}],"ts/no-empty-object-type":[`error`,{allowInterfaces:`with-single-extends`,allowObjectTypes:`never`}],"ts/no-explicit-any":[`error`],"ts/no-import-type-side-effects":[`error`],"ts/no-misused-promises":`off`,"ts/no-confusing-void-expression":`off`,"ts/no-unused-vars":[`error`,{ignoreRestSiblings:!0,argsIgnorePattern:`^_`,varsIgnorePattern:`^_`}],"ts/unbound-method":`off`,...s.configs.recommended.rules,...n}},{name:`2digits:typescript/disables/dts`,files:[`**/*.d.ts`],rules:{"unicorn/no-abusive-eslint-disable":`off`,"no-duplicate-imports":`off`,"no-restricted-syntax":`off`,"ts/no-unused-vars":`off`}},{name:`2digits:typescript/disables/test`,files:[`**/*.{test,spec}.ts?(x)`],rules:{"no-unused-expressions":`off`}},{name:`2digits:typescript/disables/cjs`,files:[`**/*.js`,`**/*.cjs`,`**/*.cts`],rules:{"ts/no-require-imports":`off`,"ts/no-var-requires":`off`}}]}function Ie(){return[{files:[k],name:`2digits:unicorn`,plugins:{unicorn:D},rules:{...D.configs.recommended.rules,"unicorn/no-array-callback-reference":`off`,"unicorn/filename-case":`off`,"unicorn/prefer-module":`off`,"unicorn/prevent-abbreviations":`off`,"unicorn/prefer-ternary":[`error`,`only-single-line`],"unicorn/no-useless-undefined":[`error`,{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-top-level-await":`off`,"unicorn/no-nested-ternary":`off`}}]}function Le(){return[{name:`2digits:yaml/setup`,plugins:{yml:O}},{name:`2digits:yaml/base`,...X,rules:{"no-irregular-whitespace":`off`,"no-unused-vars":`off`,"spaced-comment":`off`}},{name:`2digits:yaml/recommended`,...X,rules:{"yml/no-empty-document":`error`,"yml/no-empty-key":`error`,"yml/no-empty-mapping-value":`error`,"yml/no-empty-sequence-entry":`error`,"yml/no-irregular-whitespace":`error`,"yml/no-tab-indent":`error`,"yml/vue-custom-block/no-parsing-error":`error`}},{name:`2digits:yaml/standard`,...X,rules:{"yml/block-mapping":`error`,"yml/block-sequence":`error`,"yml/plain-scalar":`error`,"yml/spaced-comment":`error`}},{name:`2digits:yaml/prettier`,...X,rules:{"yml/block-mapping-colon-indicator-newline":`off`,"yml/block-mapping-question-indicator-newline":`off`,"yml/block-sequence-hyphen-indicator-newline":`off`,"yml/flow-mapping-curly-newline":`off`,"yml/flow-mapping-curly-spacing":`off`,"yml/flow-sequence-bracket-newline":`off`,"yml/flow-sequence-bracket-spacing":`off`,"yml/indent":`off`,"yml/key-spacing":`off`,"yml/no-multiple-empty-lines":`off`,"yml/no-trailing-zeros":`off`,"yml/quotes":`off`}}]}const X={files:[`**/*.y?(a)ml`],languageOptions:{parser:v}};async function Re(e={}){let{overrides:t={}}=e,n=await G(import(`eslint-plugin-zod`));return[{files:[k],name:`2digits:zod`,plugins:{zod:n},rules:{"zod/array-style":[`error`,{style:`function`}],"zod/no-any-schema":`error`,"zod/no-empty-custom-schema":`error`,"zod/no-number-schema-with-int":`error`,"zod/no-optional-and-default-together":[`warn`,{preferredMethod:`default`}],"zod/no-string-schema-with-uuid":`error`,"zod/no-throw-in-refine":`error`,"zod/prefer-enum-over-literal-union":`error`,"zod/prefer-meta":`error`,"zod/prefer-meta-last":`error`,"zod/prefer-string-schema-with-trim":`error`,"zod/consistent-import":[`error`,{syntax:`namespace`}],"zod/require-brand-type-parameter":`error`,"zod/require-schema-suffix":[`warn`,{suffix:`Schema`}],"zod/schema-error-property-style":[`error`,{selector:`Literal,TemplateLiteral`,example:`"This is an error message"`}],...t}}]}function Z(e,t){return typeof e==`boolean`?e:e?.enable??t??!1}function Q(e){if(typeof e==`boolean`||e===void 0)return{};let{enable:t,...n}=e;return n}async function $(t={},...n){let r;t.pnpm===void 0&&(r=a());let o=new e(me(t.ignores),he(t.js),L(),Ce(),V(),ge(),Ie(),Oe(),De(),I(),_e(),Ne(),Le(),ve(),fe());Z(t.css)&&(o=o.append(U(Q(t.css)))),Z(t.depend,!0)&&(o=o.append(W())),Z(t.turbo,i(`turbo`))&&(o=o.append(Pe(Q(t.turbo))));let{overrides:s,...c}=Q(t.ts);return Z(t.ts,i(`typescript`))&&(o=o.append(Fe(Q(t.ts)))),Z(t.react,i(`react`))&&(o=o.append(Ee({...Q(t.react),...c}))),Z(t.next,i(`next`))&&(o=o.append(xe({...Q(t.next),...c}))),Z(t.storybook,z.some(e=>i(e)))&&(o=o.append(ke({...Q(t.storybook),...c}))),Z(t.tailwind,i(`tailwindcss`))&&(o=o.append(Ae(Q(t.tailwind)))),Z(t.tanstackQuery,i(`react-query`)||i(`@tanstack/react-query`)||i(`@tanstack/react-query-devtools`))&&(o=o.append(je(Q(t.tanstackQuery)))),Z(t.tanstackRouter,i(`@tanstack/react-router`))&&(o=o.append(Y(Q(t.tanstackRouter)))),Z(t.drizzle,i(`drizzle-kit`)||i(`drizzle-orm`))&&(o=o.append(ue(Q(t.drizzle)))),Z(t.zod,i(`zod`))&&(o=o.append(Re(Q(t.zod)))),Z(t.graphql,i(`graphql`))&&(o=o.append(pe(Q(t.graphql)))),Z(t.pnpm,!!await r)&&(o=o.append(we())),o=o.append(...n),i(`prettier`)&&(o=o.append(Te())),o=o.append(ye()),o.renamePlugins(R).toConfigs()}export{$ as default,$ as twoDigits};
1
+ import{FlatConfigComposer as e,renamePluginsInConfigs as t,renamePluginsInRules as n}from"eslint-flat-config-utils";import{getPackageInfo as r,isPackageExists as i}from"local-pkg";import{findWorkspaceDir as a}from"pkg-types";import o from"eslint-plugin-antfu";import s,{configs as c}from"eslint-plugin-de-morgan";import l from"@eslint-community/eslint-plugin-eslint-comments";import u from"@eslint-community/eslint-plugin-eslint-comments/configs";import d from"@eslint/css";import{tailwind3 as f,tailwind4 as p}from"tailwind-csstree";import m from"eslint-plugin-depend";import{fixupPluginRules as h}from"@eslint/compat";import g,{configs as _}from"eslint-plugin-github-action";import*as v from"yaml-eslint-parser";import y from"eslint-config-flat-gitignore";import ee from"@eslint/js";import te from"@stylistic/eslint-plugin";import b from"globals";import x from"eslint-plugin-jsdoc";import S,{configs as C}from"eslint-plugin-jsonc";import*as w from"jsonc-eslint-parser";import T from"@eslint/markdown";import{mergeProcessors as ne,processorPassThrough as re}from"eslint-merge-processors";import ie from"eslint-plugin-n";import ae,{configs as oe}from"eslint-plugin-regexp";import se from"eslint-plugin-sonarjs";import*as E from"empathic/find";import ce,{configs as le}from"eslint-plugin-toml";import D from"eslint-plugin-unicorn";import O from"eslint-plugin-yml";const k=`**/*.?([cm])[jt]s?(x)`,A=`**/*.?([cm])ts`,j=`**/*.?([cm])tsx`,M=`.github/workflows/*.y?(a)ml`,N=`**/*.md`,P=`${N}/${k}`,F=`**/node_modules,**/dist,**/package-lock.json,**/yarn.lock,**/pnpm-lock.yaml,**/bun.lockb,**/bun.lock,**/output,**/coverage,**/temp,**/.temp,**/tmp,**/.tmp,**/.history,**/.vitepress/cache,**/.nuxt,**/.next,**/.vercel,**/.changeset,**/.idea,**/.cache,**/.output,**/.vite-inspect,**/.yarn,**/CHANGELOG*.md,**/*.min.*,**/LICENSE*,**/__snapshots__,**/auto-import?(s).d.ts,**/components.d.ts`.split(`,`);function I(){return[{files:[k],name:`2digits:antfu`,plugins:{antfu:o},rules:{"antfu/top-level-function":`error`}}]}function L(){return[{files:[k],name:`2digits:boolean`,plugins:{boolean:s},rules:{...c.recommended.rules}}]}const R={"@next/next":`next`,"@eslint-react":`react-extra`,"react-hooks":`react-hooks`,"react-compiler":`react-compiler`,"@stylistic/eslint-plugin":`stylistic`,"@typescript-eslint":`ts`,vitest:`vitest`,node:`node`,"@eslint-community/eslint-comments":`comments`,storybook:`storybook`,turbo:`turbo`,jsdoc:`jsdoc`,unicorn:`unicorn`,tailwindcss:`tailwindcss`,"@tanstack/query":`tanstack-query`,"@tanstack/router":`tanstack-router`,"@2digits":`@2digits`,"@graphql-eslint":`gql`,sonarjs:`sonar`,drizzle:`drizzle`,"de-morgan":`boolean`,antfu:`antfu`,css:`css`,depend:`depend`,"github-action":`github-action`,jsonc:`jsonc`,markdown:`markdown`,pnpm:`pnpm`,regexp:`regexp`,yml:`yml`,zod:`zod`,toml:`toml`},z=[`storybook`,`@storybook/nextjs`,`@storybook/nextjs-vite`,`@storybook/react-vite`,`@storybook/react-webpack5`,`@storybook/react-native-web-vite`],B=n(u.recommended.rules,R);function V(){return[{files:[k],name:`2digits:comments`,plugins:{comments:l},rules:{...B,"comments/no-unused-disable":`error`,"comments/disable-enable-pair":[`error`,{allowWholeFile:!0}]}}]}async function H(e){if(e?.customSyntax)return e.customSyntax;if(e?.tailwindMajor===3)return f;if(e?.tailwindMajor===4)return p;try{let e=(await r(`tailwindcss`))?.version??``,t=Number.parseInt(e.split(`.`)[0]??`0`,10);if(Number.isFinite(t)&&t>=4)return p}catch{}return f}async function U(e={}){let t=await H(e);return[{name:`2digits:css`,files:[`**/*.css`],language:`css/css`,plugins:{css:d},languageOptions:{tolerant:!0,customSyntax:t},rules:{...d.configs.recommended.rules,...e.overrides}}]}function W(){return[{files:[k],name:`2digits:depend`,plugins:{depend:m},rules:{"depend/ban-dependencies":`warn`}}]}async function G(e){let t=await e;return t.default??t}async function ue(e={}){let{overrides:t={},drizzleObjectName:n=[`drizzle`,`db`]}=e,r=await G(import(`eslint-plugin-drizzle`));return[{files:[k],name:`2digits:drizzle`,plugins:{drizzle:h(r)},rules:{"drizzle/enforce-update-with-where":[`error`,{drizzleObjectName:n}],"drizzle/enforce-delete-with-where":[`error`,{drizzleObjectName:n}],...t}}]}const de=Object.fromEntries(_.recommended.flatMap(({rules:e})=>Object.entries({...e})));function fe(){return[{name:`2digits:github-actions/setup`,plugins:{"github-action":g}},{name:`2digits:github-actions/recommended`,files:[M],ignores:[`!**/${M}`],languageOptions:{parser:v},rules:{...de}}]}async function pe(e={}){let{overrides:t={},files:r=[`**/*.graphql`,`**/*.gql`]}=e,[i,a]=await Promise.all([G(import(`@graphql-eslint/eslint-plugin`)),import(`graphql-config`).then(({loadConfig:e})=>e({throwOnEmpty:!1,throwOnMissing:!1}).then(e=>e?.getDefault().schema))]),o=i.configs[`flat/operations-recommended`].rules,s={};if(a)s=o;else for(let e of Object.keys(o)){let t=e.replace(`@graphql-eslint/`,``);t in i.rules&&(i.rules[t].meta.docs?.requiresSchema||i.rules[t].meta.docs?.requiresSiblings)||(s[e]=o[e])}let c=n(s,R);return[{name:`2digits:graphql`,plugins:{gql:i},languageOptions:{parser:i.parser},files:r,rules:{...c,"gql/naming-convention":[`error`,{allowLeadingUnderscore:!0}],...t}}]}function me(e={}){let{gitIgnore:t,ignores:n=[]}=e;return[{ignores:[F,n].flat(),name:`2digits:ignores`},y({strict:!1,...t,name:`2digits:gitignore`})]}function he(e={}){let{overrides:t={}}=e;return[{files:[k],name:`2digits:javascript`,plugins:{stylistic:te},languageOptions:{ecmaVersion:2022,globals:{...b.browser,...b.es2021,...b.node,document:`readonly`,navigator:`readonly`,window:`readonly`},parserOptions:{ecmaFeatures:{jsx:!0},ecmaVersion:2022,sourceType:`module`},sourceType:`module`},linterOptions:{reportUnusedDisableDirectives:!0},rules:{...ee.configs.recommended.rules,"accessor-pairs":[`error`,{enforceForClassMembers:!0,setWithoutGet:!0}],"array-callback-return":`error`,"block-scoped-var":`error`,"constructor-super":`error`,"default-case-last":`error`,"dot-notation":[`error`,{allowKeywords:!0}],eqeqeq:[`error`,`smart`],"new-cap":[`error`,{capIsNew:!1,newIsCap:!0,properties:!0}],"no-alert":`error`,"no-array-constructor":`error`,"no-async-promise-executor":`error`,"no-caller":`error`,"no-case-declarations":`error`,"no-class-assign":`error`,"no-compare-neg-zero":`error`,"no-cond-assign":[`error`,`always`],"no-const-assign":`error`,"no-control-regex":`error`,"no-debugger":`error`,"no-delete-var":`error`,"no-dupe-args":`error`,"no-dupe-class-members":`error`,"no-dupe-keys":`error`,"no-duplicate-case":`error`,"no-empty":[`error`,{allowEmptyCatch:!0}],"no-empty-character-class":`error`,"no-empty-pattern":`error`,"no-eval":`error`,"no-ex-assign":`error`,"no-extend-native":`error`,"no-extra-bind":`error`,"no-extra-boolean-cast":`error`,"no-fallthrough":`error`,"no-func-assign":`error`,"no-global-assign":`error`,"no-implied-eval":`error`,"no-import-assign":`error`,"no-invalid-regexp":`error`,"no-irregular-whitespace":`error`,"no-iterator":`error`,"no-labels":[`error`,{allowLoop:!1,allowSwitch:!1}],"no-lone-blocks":`error`,"no-loss-of-precision":`error`,"no-misleading-character-class":`error`,"no-multi-str":`error`,"no-new":`error`,"no-new-func":`error`,"no-new-native-nonconstructor":`error`,"no-new-wrappers":`error`,"no-obj-calls":`error`,"no-octal":`error`,"no-octal-escape":`error`,"no-proto":`error`,"no-prototype-builtins":`error`,"no-redeclare":[`error`,{builtinGlobals:!1}],"no-regex-spaces":`error`,"no-restricted-globals":[`error`,{message:"Use `globalThis` instead.",name:`global`},{message:"Use `globalThis` instead.",name:`self`}],"no-restricted-properties":[`error`,{message:"Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",property:`__proto__`},{message:"Use `Object.defineProperty` instead.",property:`__defineGetter__`},{message:"Use `Object.defineProperty` instead.",property:`__defineSetter__`},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:`__lookupGetter__`},{message:"Use `Object.getOwnPropertyDescriptor` instead.",property:`__lookupSetter__`}],"no-restricted-syntax":[`error`,`DebuggerStatement`,`LabeledStatement`,`WithStatement`,`TSEnumDeclaration`,`TSExportAssignment`],"no-self-assign":[`error`,{props:!0}],"no-self-compare":`error`,"no-sequences":`error`,"no-shadow-restricted-names":`error`,"no-sparse-arrays":`error`,"no-template-curly-in-string":`error`,"no-this-before-super":`error`,"no-throw-literal":`error`,"no-undef":`error`,"no-undef-init":`error`,"no-unexpected-multiline":`error`,"no-unmodified-loop-condition":`error`,"no-unneeded-ternary":[`error`,{defaultAssignment:!1}],"no-unreachable":`error`,"no-unreachable-loop":`error`,"no-unsafe-finally":`error`,"no-unsafe-negation":`error`,"no-unused-expressions":[`error`,{allowShortCircuit:!0,allowTaggedTemplates:!0,allowTernary:!0}],"no-unused-vars":[`error`,{args:`none`,caughtErrors:`none`,ignoreRestSiblings:!0,vars:`all`}],"no-useless-assignment":`off`,"no-useless-backreference":`error`,"no-useless-call":`error`,"no-useless-catch":`error`,"no-useless-computed-key":`error`,"no-useless-constructor":`error`,"no-useless-rename":`error`,"no-var":`error`,"no-with":`error`,"object-shorthand":[`error`,`always`,{avoidQuotes:!0,ignoreConstructors:!1}],"one-var":[`error`,{initialized:`never`}],"prefer-arrow-callback":[`error`,{allowNamedFunctions:!0,allowUnboundThis:!0}],"prefer-const":[`error`,{destructuring:`all`,ignoreReadBeforeAssign:!0}],"prefer-exponentiation-operator":`error`,"prefer-promise-reject-errors":`error`,"prefer-regex-literals":[`error`,{disallowRedundantWrapping:!0}],"prefer-rest-params":`error`,"prefer-spread":`error`,"prefer-template":`error`,"symbol-description":`error`,"unicode-bom":[`error`,`never`],"use-isnan":[`error`,{enforceForIndexOf:!0,enforceForSwitchCase:!0}],"valid-typeof":[`error`,{requireStringLiterals:!0}],"vars-on-top":`error`,yoda:[`error`,`never`],"stylistic/padding-line-between-statements":[`error`,{blankLine:`always`,prev:[`const`,`let`],next:`*`},{blankLine:`any`,prev:[`const`,`let`],next:[`const`,`let`]},{blankLine:`always`,prev:`*`,next:`return`}],...t}}]}function ge(){return[{files:[k],name:`2digits:jsdoc`,plugins:{jsdoc:x},rules:{"jsdoc/check-access":`error`,"jsdoc/check-param-names":`error`,"jsdoc/check-property-names":`error`,"jsdoc/check-tag-names":[`error`,{typed:!0}],"jsdoc/check-types":`error`,"jsdoc/empty-tags":`error`,"jsdoc/implements-on-classes":`error`,"jsdoc/no-defaults":`error`,"jsdoc/no-multi-asterisks":`error`,"jsdoc/require-param":`error`,"jsdoc/require-param-name":`error`,"jsdoc/require-property":`error`,"jsdoc/require-property-description":`error`,"jsdoc/require-property-name":`error`,"jsdoc/require-returns-check":`error`,"jsdoc/require-returns-description":`error`,"jsdoc/require-yields":`error`,"jsdoc/require-yields-check":`error`}}]}function _e(){return[...C[`flat/base`].map(e=>({...e,name:`2digits:jsonc/base`})),{name:`2digits:jsonc/json`,files:[`**/*.json`],...K,rules:{...q(C[`flat/recommended-with-json`])}},{name:`2digits:jsonc/jsonc`,files:[`**/*.jsonc`],...K,rules:{...q(C[`flat/recommended-with-jsonc`])}},{name:`2digits:jsonc/json5`,files:[`**/*.json5`],...K,rules:{...q(C[`flat/recommended-with-json5`])}},{name:`2digits:jsonc/package.json`,...K,files:[`**/package.json`],rules:{"jsonc/sort-array-values":[`error`,{order:{type:`asc`},pathPattern:`^files$`}],"jsonc/sort-keys":[`error`,{order:{type:`asc`},pathPattern:`^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$`},{order:[`types`,`import`,`module`,`require`,`default`],pathPattern:`^exports.*$`}]}},{name:`2digits:jsonc/tsconfig.json`,...K,files:[`**/tsconfig.json`,`**/tsconfig.*.json`,`**/tsconfig-*.json`,`**/jsconfig.json`,`**/jsconfig.*.json`,`**/jsconfig-*.json`],rules:{"jsonc/sort-keys":[`error`,{order:[`$schema`,`extends`,`compilerOptions`,`references`,`files`,`include`,`exclude`],pathPattern:`^$`},{order:`incremental.composite.tsBuildInfoFile.disableSourceOfProjectReferenceRedirect.disableSolutionSearching.disableReferencedProjectLoad.target.lib.jsx.experimentalDecorators.emitDecoratorMetadata.jsxFactory.jsxFragmentFactory.jsxImportSource.reactNamespace.noLib.useDefineForClassFields.moduleDetection.module.rootDir.moduleResolution.baseUrl.paths.rootDirs.typeRoots.types.allowUmdGlobalAccess.moduleSuffixes.allowImportingTsExtensions.resolvePackageJsonExports.resolvePackageJsonImports.customConditions.resolveJsonModule.allowArbitraryExtensions.noResolve.allowJs.checkJs.maxNodeModuleJsDepth.declaration.declarationMap.emitDeclarationOnly.sourceMap.inlineSourceMap.outFile.outDir.removeComments.noEmit.importHelpers.importsNotUsedAsValues.downlevelIteration.sourceRoot.mapRoot.inlineSources.emitBOM.newLine.stripInternal.noEmitHelpers.noEmitOnError.preserveConstEnums.declarationDir.preserveValueImports.isolatedModules.verbatimModuleSyntax.allowSyntheticDefaultImports.esModuleInterop.preserveSymlinks.forceConsistentCasingInFileNames.strict.strictBindCallApply.strictFunctionTypes.strictNullChecks.strictPropertyInitialization.allowUnreachableCode.allowUnusedLabels.alwaysStrict.exactOptionalPropertyTypes.noFallthroughCasesInSwitch.noImplicitAny.noImplicitOverride.noImplicitReturns.noImplicitThis.noPropertyAccessFromIndexSignature.noUncheckedIndexedAccess.noUnusedLocals.noUnusedParameters.useUnknownInCatchVariables.skipDefaultLibCheck.skipLibCheck`.split(`.`),pathPattern:`^compilerOptions$`}]}},...C[`flat/prettier`].map(e=>({...e,name:`2digits:jsonc/prettier`}))]}const K={languageOptions:{parser:w},plugins:{jsonc:S}};function q(e){return Object.fromEntries(e.flatMap(({rules:e})=>Object.entries(e??{})))}const J=[N];function ve(){return[{name:`2digits:markdown/setup`,plugins:{markdown:T}},{name:`2digits:markdown/processor`,files:J,language:`markdown/gfm`,ignores:[`**/*.md/*.md`],processor:ne([T.processors.markdown,re])},{name:`2digits:markdown/parser`,files:J,language:`markdown/gfm`,languageOptions:{parser:be}},{name:`2digits:markdown/rules`,files:J,language:`markdown/gfm`,rules:{"markdown/fenced-code-language":`error`,"markdown/heading-increment":`error`,"markdown/no-empty-links":`error`,"markdown/no-invalid-label-refs":`error`,"markdown/no-missing-label-refs":`error`}}]}async function ye(){let e=await G(import(`typescript-eslint`)),t=await G(import(`@eslint-react/eslint-plugin`)),r=n({...e.configs.disableTypeChecked.rules,...t.configs[`disable-type-checked`].rules},R);return[{name:`2digits:markdown/disables`,files:[P],languageOptions:{parser:e.parser,parserOptions:{project:!1,projectService:!1,ecmaFeatures:{impliedStrict:!0}}},rules:{...r,"no-alert":`off`,"no-console":`off`,"no-labels":`off`,"no-lone-blocks":`off`,"no-restricted-syntax":`off`,"no-undef":`off`,"no-unused-expressions":`off`,"no-unused-labels":`off`,"no-unused-vars":`off`,"node/prefer-global/process":`off`,"ts/consistent-type-imports":`off`,"ts/explicit-function-return-type":`off`,"ts/no-namespace":`off`,"ts/no-redeclare":`off`,"ts/no-require-imports":`off`,"ts/no-unused-expressions":`off`,"ts/no-unused-vars":`off`,"ts/no-use-before-define":`off`,"unicode-bom":`off`}}]}const be={meta:{name:`parser-plain`},parseForESLint:e=>({ast:{body:[],comments:[],loc:{end:e.length,start:0},range:[0,e.length],tokens:[],type:`Program`},scopeManager:null,services:{isPlain:!0},visitorKeys:{Program:[]}})};async function xe(e={}){let{files:t=[A,j],overrides:r={},parserOptions:i}=e,[a,o]=await Promise.all([G(import(`@next/eslint-plugin-next`)),G(import(`@typescript-eslint/parser`))]),s=n({...a.configs.recommended.rules,...a.configs[`core-web-vitals`].rules},R);return[{name:`2digits:next/setup`,plugins:{next:h(a)}},{name:`2digits:next/rules`,files:t,languageOptions:{parser:o,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...i},sourceType:`module`},rules:{...s,"next/no-html-link-for-pages":`off`,...r}},{files:[`**/middleware.ts`,`**/proxy.ts`],name:`2digits:next/proxy`,rules:{"unicorn/prefer-string-raw":`off`}}]}var Se={node:`24.14.1`};function Ce(){return[{files:[k],name:`2digits:node`,settings:{node:{version:Se.node}},plugins:{node:ie},rules:{"node/handle-callback-err":[`error`,`^(err|error)$`],"node/no-deprecated-api":`error`,"node/no-exports-assign":`error`,"node/no-new-require":`error`,"node/no-path-concat":`error`,"node/no-unsupported-features/node-builtins":[`error`,{allowExperimental:!0}],"node/prefer-global/buffer":`error`,"node/prefer-global/process":`error`,"node/prefer-global/text-encoder":`error`,"node/prefer-global/url":`error`,"node/prefer-global/console":`error`,"node/prefer-global/url-search-params":`error`,"node/prefer-global/text-decoder":`error`,"node/process-exit-as-throw":`error`}}]}async function we(){let e=await G(import(`eslint-plugin-pnpm`));return[{name:`2digits:pnpm/package-json`,files:[`package.json`,`**/package.json`],languageOptions:{parser:w},plugins:{pnpm:e},rules:{"pnpm/json-enforce-catalog":`error`,"pnpm/json-prefer-workspace-settings":`error`,"pnpm/json-valid-catalog":`error`}},{name:`2digits:pnpm/pnpm-workspace-yaml`,files:[`pnpm-workspace.yaml`],languageOptions:{parser:await G(import(`yaml-eslint-parser`))},plugins:{pnpm:e},rules:{"pnpm/yaml-no-duplicate-catalog-item":`error`,"pnpm/yaml-no-unused-catalog-item":`error`,"pnpm/yaml-valid-packages":`error`,"pnpm/yaml-enforce-settings":[`error`,{autofix:!0,settings:{catalogMode:`strict`,savePrefix:``,preferWorkspacePackages:!0,cleanupUnusedCatalogs:!0}}]}}]}async function Te(){let[e,t]=await Promise.all([G(import(`eslint-config-prettier`)),G(import(`@stylistic/eslint-plugin`))]);return[{name:`2digits:prettier`,plugins:{stylistic:t},rules:{...e.rules,"tailwindcss/classnames-order":`off`,"stylistic/jsx-newline":[`error`,{prevent:!1}]}}]}async function Ee(e={}){let{files:t=[A,j],overrides:r={},parserOptions:i,tsconfigRootDir:a,reactCompiler:o=!0}=e,[s,c,l,u]=await Promise.all([G(import(`@eslint-react/eslint-plugin`)),G(import(`@typescript-eslint/parser`)),o?G(import(`eslint-plugin-react-compiler`)):Promise.resolve(void 0),G(import(`@stylistic/eslint-plugin`))]),d=s.configs.all.plugins,f=n({...s.configs[`disable-conflict-eslint-plugin-react`].rules,...s.configs[`disable-conflict-eslint-plugin-react-hooks`].rules,...s.configs[`strict-type-checked`].rules},R);return[{name:`2digits:react/setup`,plugins:{stylistic:u,"react-extra":d[`@eslint-react`],...o?{"react-compiler":l}:{}},settings:{react:{version:`detect`}}},{name:`2digits:react/rules`,files:t,languageOptions:{parser:c,parserOptions:{ecmaFeatures:{jsx:!0},tsconfigRootDir:a,projectService:!0,...i},sourceType:`module`},rules:{...f,...o?{"react-compiler/react-compiler":`error`}:{},"react-extra/exhaustive-deps":`error`,"react-extra/purity":`error`,"react-extra/no-unused-class-component-members":`error`,"react-extra/no-unnecessary-use-callback":`error`,"react-extra/no-unnecessary-use-prefix":`error`,"react-extra/no-unnecessary-use-memo":`error`,"react-extra/set-state-in-effect":`error`,"react-extra/use-state":`error`,"react-extra/no-unstable-context-value":`error`,"react-extra/no-unstable-default-props":`error`,"react-extra/no-unused-props":`error`,"react-extra/no-context-provider":`error`,"react-extra/no-forward-ref":`error`,"react-extra/no-use-context":`error`,"react-extra/immutability":`error`,"react-extra/refs":`error`,"react-extra/no-duplicate-key":`error`,"react-extra/dom-no-missing-button-type":`error`,"react-extra/dom-no-missing-iframe-sandbox":`error`,"react-extra/dom-no-unsafe-target-blank":`error`,"react-extra/naming-convention-context-name":`error`,"react-extra/naming-convention-id-name":`error`,"react-extra/naming-convention-ref-name":`error`,"react-extra/prefer-namespace-import":`error`,"react-extra/jsx-no-useless-fragment":`off`,"stylistic/jsx-curly-newline":`off`,"stylistic/jsx-newline":[`error`,{prevent:!1}],"stylistic/jsx-self-closing-comp":`error`,...r}}]}function De(){return[{files:[k],name:`2digits:regexp`,plugins:{regexp:ae},rules:{...oe[`flat/recommended`].rules}}]}function Oe(){return[{files:[k],name:`2digits:sonar`,plugins:{sonar:se},rules:{"sonar/cognitive-complexity":`error`,"sonar/comma-or-logical-or-case":`error`,"sonar/concise-regex":`error`,"sonar/confidential-information-logging":`error`,"sonar/constructor-for-side-effects":`error`,"sonar/content-length":`error`,"sonar/content-security-policy":`error`,"sonar/cookie-no-httponly":`error`,"sonar/cors":`error`,"sonar/csrf":`error`,"sonar/max-switch-cases":`error`,"sonar/no-all-duplicated-branches":`error`,"sonar/no-collapsible-if":`error`,"sonar/no-collection-size-mischeck":`error`,"sonar/no-duplicate-string":[`error`,{threshold:5}],"sonar/no-duplicated-branches":`error`,"sonar/no-element-overwrite":`error`,"sonar/no-empty-collection":`error`,"sonar/no-extra-arguments":`error`,"sonar/no-for-in-iterable":`error`,"sonar/no-gratuitous-expressions":`error`,"sonar/no-identical-conditions":`error`,"sonar/no-identical-expressions":`error`,"sonar/no-identical-functions":`error`,"sonar/no-ignored-return":`error`,"sonar/no-inverted-boolean-check":`error`,"sonar/no-nested-switch":`error`,"sonar/no-nested-template-literals":`error`,"sonar/no-redundant-boolean":`error`,"sonar/no-same-line-conditional":`error`,"sonar/no-small-switch":`error`,"sonar/no-unused-collection":`error`,"sonar/no-use-of-empty-return-value":`error`,"sonar/no-useless-catch":`error`,"sonar/non-existent-operator":`error`,"sonar/prefer-immediate-return":`error`,"sonar/prefer-object-literal":`error`,"sonar/prefer-single-boolean-return":`error`,"sonar/prefer-while":`error`,"sonar/elseif-without-else":`off`,"sonar/no-redundant-jump":`off`}}]}async function ke(e={}){let{files:t=[`**/*.stories.tsx`],overrides:n={},parserOptions:r,storybookDirectory:i=`.storybook`}=e,[a,o]=await Promise.all([G(import(`eslint-plugin-storybook`)),G(import(`@typescript-eslint/parser`))]),s={parser:o,parserOptions:{ecmaFeatures:{jsx:!0},projectService:!0,...r},sourceType:`module`};return[{name:`2digits:storybook/setup`,plugins:{storybook:a}},{name:`2digits:storybook/rules`,files:t,languageOptions:s,rules:{"storybook/await-interactions":`error`,"storybook/context-in-play-function":`error`,"storybook/csf-component":`error`,"storybook/default-exports":`error`,"storybook/hierarchy-separator":`error`,"storybook/meta-inline-properties":`error`,"storybook/no-redundant-story-name":`error`,"storybook/no-stories-of":`error`,"storybook/no-title-property-in-meta":`error`,"storybook/no-uninstalled-addons":`error`,"storybook/prefer-pascal-case":`error`,"storybook/story-exports":`error`,"storybook/use-storybook-expect":`error`,"storybook/use-storybook-testing-library":`error`,"storybook/meta-satisfies-type":`error`,"storybook/no-renderer-packages":`error`,...n}},{name:`2digits:storybook/disables`,files:t,rules:{"sonar/no-duplicate-string":`off`}},{name:`2digits:storybook/config`,files:[`${i}/main.@(js|cjs|mjs|ts)`],languageOptions:s,rules:{"storybook/no-uninstalled-addons":`error`}}]}async function Ae(e={}){let{overrides:t={}}=e,[n,{tailwindFunctions:r},i]=await Promise.all([G(import(`eslint-plugin-tailwindcss`)),G(import(`@2digits/constants`)),a().catch(()=>void 0)]),o=E.file(`tailwind.config.ts`,{last:i})??E.file(`tailwind.config.js`,{last:i});return[{files:[k],name:`2digits:tailwind`,plugins:{tailwindcss:n},settings:{tailwindcss:{callees:r,config:o}},rules:{...n.configs.recommended.rules,...t}}]}async function je(e={}){let{overrides:t={}}=e,r=await G(import(`@tanstack/eslint-plugin-query`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},R);return[{files:[k],name:`2digits:tanstack-query`,plugins:{"tanstack-query":r},rules:{...i,"tanstack-query/prefer-query-options":`error`,...t}}]}async function Y(e={}){let{overrides:t={}}=e,r=await G(import(`@tanstack/eslint-plugin-router`)),i=n(r.configs[`flat/recommended`].at(0)?.rules??{},R);return[{files:[k],name:`2digits:tanstack-router`,plugins:{"tanstack-router":r},rules:{...i,"ts/only-throw-error":[`error`,{allow:[{from:`package`,package:`@tanstack/router-core`,name:`Redirect`}]}],...t}}]}const Me=Object.fromEntries(le.standard.flatMap(({rules:e})=>Object.entries({...e})));function Ne(){return[{name:`2digits:toml`,files:[`**/*.toml`],language:`toml/toml`,plugins:{toml:ce},rules:{...Me,"toml/array-bracket-spacing":[`error`,`never`],"toml/array-element-newline":[`error`,`consistent`],"toml/indent":[`error`,2,{keyValuePairs:0,subTables:0}]}}]}async function Pe(e={}){let{overrides:t={}}=e,n=await G(import(`eslint-plugin-turbo`));return[{files:[k],name:`2digits:turbo`,plugins:{turbo:n},rules:{"turbo/no-undeclared-env-vars":`error`,...t}}]}async function Fe(e={}){let{overrides:n={},parserOptions:r={}}=e,[{plugin:i,configs:a,parser:o},s]=await Promise.all([G(import(`typescript-eslint`)),G(import(`@2digits/eslint-plugin`))]),c=t(a.strictTypeChecked,R),l=Object.fromEntries(c.flatMap(({rules:e})=>Object.entries(e??{})));return[{name:`2digits:typescript/setup`,plugins:{ts:i,"@2digits":s}},{name:`2digits:typescript/rules`,files:[k],languageOptions:{parser:o,parserOptions:{tsconfigRootDir:process.cwd(),projectService:!0,warnOnUnsupportedTypeScriptVersion:!1,...r},sourceType:`module`},rules:{...l,"ts/array-type":[`error`,{default:`generic`,readonly:`generic`}],"ts/restrict-template-expressions":[`error`,{allowNumber:!0}],"ts/ban-ts-comment":[`error`,{"ts-ignore":`allow-with-description`}],"ts/consistent-type-exports":[`error`],"ts/consistent-type-imports":[`error`,{prefer:`type-imports`,disallowTypeAnnotations:!1,fixStyle:`inline-type-imports`}],"ts/no-empty-object-type":[`error`,{allowInterfaces:`with-single-extends`,allowObjectTypes:`never`}],"ts/no-explicit-any":[`error`],"ts/no-import-type-side-effects":[`error`],"ts/no-misused-promises":`off`,"ts/no-confusing-void-expression":`off`,"ts/no-unused-vars":[`error`,{ignoreRestSiblings:!0,argsIgnorePattern:`^_`,varsIgnorePattern:`^_`}],"ts/unbound-method":`off`,...s.configs.recommended.rules,...n}},{name:`2digits:typescript/disables/dts`,files:[`**/*.d.ts`],rules:{"unicorn/no-abusive-eslint-disable":`off`,"no-duplicate-imports":`off`,"no-restricted-syntax":`off`,"ts/no-unused-vars":`off`}},{name:`2digits:typescript/disables/test`,files:[`**/*.{test,spec}.ts?(x)`],rules:{"no-unused-expressions":`off`}},{name:`2digits:typescript/disables/cjs`,files:[`**/*.js`,`**/*.cjs`,`**/*.cts`],rules:{"ts/no-require-imports":`off`,"ts/no-var-requires":`off`}}]}function Ie(){return[{files:[k],name:`2digits:unicorn`,plugins:{unicorn:D},rules:{...D.configs.recommended.rules,"unicorn/no-array-callback-reference":`off`,"unicorn/filename-case":`off`,"unicorn/prefer-module":`off`,"unicorn/prevent-abbreviations":`off`,"unicorn/prefer-ternary":[`error`,`only-single-line`],"unicorn/no-useless-undefined":[`error`,{checkArguments:!1,checkArrowFunctionBody:!1}],"unicorn/prefer-top-level-await":`off`,"unicorn/no-nested-ternary":`off`}}]}async function Le(e={}){let{files:t=[`**/*.{test,spec}.ts?(x)`],overrides:n={},typecheck:r=!0,vitestImports:i}=e,a=await G(import(`@vitest/eslint-plugin`));return[{name:`2digits:vitest/setup`,plugins:{vitest:a}},{name:`2digits:vitest/rules`,files:t,languageOptions:{globals:a.environments.env.globals},settings:{vitest:{typecheck:r,...i?{vitestImports:i}:{}}},rules:{"vitest/consistent-each-for":[`error`,{describe:`for`,suite:`for`,it:`for`,test:`for`}],"vitest/consistent-test-filename":[`error`,{pattern:String.raw`.*\.spec\.[tj]sx?$`,allTestPattern:String.raw`.*\.(test|spec)\.[tj]sx?$`}],"vitest/consistent-test-it":[`error`,{fn:`it`,withinDescribe:`it`}],"vitest/consistent-vitest-vi":[`error`,{fn:`vi`}],"vitest/hoisted-apis-on-top":`error`,"vitest/no-conditional-tests":`error`,"vitest/no-import-node-test":`error`,"vitest/prefer-called-exactly-once-with":`error`,"vitest/prefer-called-once":`error`,"vitest/prefer-describe-function-title":`error`,"vitest/prefer-each":`error`,"vitest/prefer-expect-type-of":`error`,"vitest/prefer-import-in-mock":`error`,"vitest/prefer-to-be-falsy":`error`,"vitest/prefer-to-be-object":`error`,"vitest/prefer-to-be-truthy":`error`,"vitest/require-awaited-expect-poll":`error`,"vitest/require-local-test-context-for-concurrent-snapshots":`error`,"vitest/require-mock-type-parameters":`error`,"vitest/warn-todo":`error`,...n}}]}function Re(){return[{name:`2digits:yaml/setup`,plugins:{yml:O}},{name:`2digits:yaml/base`,...X,rules:{"no-irregular-whitespace":`off`,"no-unused-vars":`off`,"spaced-comment":`off`}},{name:`2digits:yaml/recommended`,...X,rules:{"yml/no-empty-document":`error`,"yml/no-empty-key":`error`,"yml/no-empty-mapping-value":`error`,"yml/no-empty-sequence-entry":`error`,"yml/no-irregular-whitespace":`error`,"yml/no-tab-indent":`error`,"yml/vue-custom-block/no-parsing-error":`error`}},{name:`2digits:yaml/standard`,...X,rules:{"yml/block-mapping":`error`,"yml/block-sequence":`error`,"yml/plain-scalar":`error`,"yml/spaced-comment":`error`}},{name:`2digits:yaml/prettier`,...X,rules:{"yml/block-mapping-colon-indicator-newline":`off`,"yml/block-mapping-question-indicator-newline":`off`,"yml/block-sequence-hyphen-indicator-newline":`off`,"yml/flow-mapping-curly-newline":`off`,"yml/flow-mapping-curly-spacing":`off`,"yml/flow-sequence-bracket-newline":`off`,"yml/flow-sequence-bracket-spacing":`off`,"yml/indent":`off`,"yml/key-spacing":`off`,"yml/no-multiple-empty-lines":`off`,"yml/no-trailing-zeros":`off`,"yml/quotes":`off`}}]}const X={files:[`**/*.y?(a)ml`],languageOptions:{parser:v}};async function ze(e={}){let{overrides:t={}}=e,n=await G(import(`eslint-plugin-zod`));return[{files:[k],name:`2digits:zod`,plugins:{zod:n},rules:{"zod/array-style":[`error`,{style:`function`}],"zod/no-any-schema":`error`,"zod/no-empty-custom-schema":`error`,"zod/no-number-schema-with-int":`error`,"zod/no-optional-and-default-together":[`warn`,{preferredMethod:`default`}],"zod/no-string-schema-with-uuid":`error`,"zod/no-throw-in-refine":`error`,"zod/prefer-enum-over-literal-union":`error`,"zod/prefer-meta":`error`,"zod/prefer-meta-last":`error`,"zod/prefer-string-schema-with-trim":`error`,"zod/consistent-import":[`error`,{syntax:`namespace`}],"zod/require-brand-type-parameter":`error`,"zod/require-schema-suffix":[`warn`,{suffix:`Schema`}],"zod/schema-error-property-style":[`error`,{selector:`Literal,TemplateLiteral`,example:`"This is an error message"`}],...t}}]}function Z(e,t){return typeof e==`boolean`?e:e?.enable??t??!1}function Q(e){if(typeof e==`boolean`||e===void 0)return{};let{enable:t,...n}=e;return n}async function $(t={},...n){let r;t.pnpm===void 0&&(r=a());let o=new e(me(t.ignores),he(t.js),L(),Ce(),V(),ge(),Ie(),Oe(),De(),I(),_e(),Ne(),Re(),ve(),fe());Z(t.css)&&(o=o.append(U(Q(t.css)))),Z(t.depend,!0)&&(o=o.append(W())),Z(t.turbo,i(`turbo`))&&(o=o.append(Pe(Q(t.turbo))));let{overrides:s,...c}=Q(t.ts);return Z(t.ts,i(`typescript`))&&(o=o.append(Fe(Q(t.ts)))),Z(t.react,i(`react`))&&(o=o.append(Ee({...Q(t.react),...c}))),Z(t.next,i(`next`))&&(o=o.append(xe({...Q(t.next),...c}))),Z(t.storybook,z.some(e=>i(e)))&&(o=o.append(ke({...Q(t.storybook),...c}))),Z(t.vitest,i(`vitest`))&&(o=o.append(Le(Q(t.vitest)))),Z(t.tailwind,i(`tailwindcss`))&&(o=o.append(Ae(Q(t.tailwind)))),Z(t.tanstackQuery,i(`react-query`)||i(`@tanstack/react-query`)||i(`@tanstack/react-query-devtools`))&&(o=o.append(je(Q(t.tanstackQuery)))),Z(t.tanstackRouter,i(`@tanstack/react-router`))&&(o=o.append(Y(Q(t.tanstackRouter)))),Z(t.drizzle,i(`drizzle-kit`)||i(`drizzle-orm`))&&(o=o.append(ue(Q(t.drizzle)))),Z(t.zod,i(`zod`))&&(o=o.append(ze(Q(t.zod)))),Z(t.graphql,i(`graphql`))&&(o=o.append(pe(Q(t.graphql)))),Z(t.pnpm,!!await r)&&(o=o.append(we())),o=o.append(...n),i(`prettier`)&&(o=o.append(Te())),o=o.append(ye()),o.renamePlugins(R).toConfigs()}export{$ as default,$ as twoDigits};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2digits/eslint-config",
3
- "version": "5.3.4",
3
+ "version": "5.4.0",
4
4
  "description": "Effortlessly enforce best practices and catch errors with this comprehensive ESLint configuration for TypeScript, featuring popular plugins like @typescript-eslint, eslint-plugin-react, and eslint-plugin-unicorn.",
5
5
  "keywords": [
6
6
  "eslint-config"
@@ -25,17 +25,18 @@
25
25
  "dependencies": {
26
26
  "@eslint-community/eslint-plugin-eslint-comments": "4.7.1",
27
27
  "@eslint-react/eslint-plugin": "4.2.3",
28
- "@eslint/compat": "2.0.4",
28
+ "@eslint/compat": "2.0.5",
29
29
  "@eslint/css": "1.1.0",
30
30
  "@eslint/js": "10.0.1",
31
31
  "@eslint/markdown": "8.0.1",
32
32
  "@graphql-eslint/eslint-plugin": "4.4.0",
33
- "@next/eslint-plugin-next": "16.2.2",
33
+ "@next/eslint-plugin-next": "16.2.3",
34
34
  "@stylistic/eslint-plugin": "5.10.0",
35
35
  "@tanstack/eslint-plugin-query": "5.96.2",
36
36
  "@tanstack/eslint-plugin-router": "1.161.6",
37
- "@typescript-eslint/parser": "8.58.0",
38
- "@typescript-eslint/utils": "8.58.0",
37
+ "@typescript-eslint/parser": "8.58.1",
38
+ "@typescript-eslint/utils": "8.58.1",
39
+ "@vitest/eslint-plugin": "1.6.15",
39
40
  "empathic": "2.0.0",
40
41
  "eslint-config-flat-gitignore": "2.3.0",
41
42
  "eslint-config-prettier": "10.1.8",
@@ -53,10 +54,10 @@
53
54
  "eslint-plugin-react-compiler": "19.1.0-rc.2",
54
55
  "eslint-plugin-regexp": "3.1.0",
55
56
  "eslint-plugin-sonarjs": "4.0.2",
56
- "eslint-plugin-storybook": "10.3.4",
57
+ "eslint-plugin-storybook": "10.3.5",
57
58
  "eslint-plugin-tailwindcss": "3.18.2",
58
59
  "eslint-plugin-toml": "1.3.1",
59
- "eslint-plugin-turbo": "2.9.4",
60
+ "eslint-plugin-turbo": "2.9.5",
60
61
  "eslint-plugin-unicorn": "64.0.0",
61
62
  "eslint-plugin-yml": "3.3.1",
62
63
  "eslint-plugin-zod": "3.5.1",
@@ -66,23 +67,23 @@
66
67
  "local-pkg": "1.1.2",
67
68
  "pkg-types": "2.3.0",
68
69
  "tailwind-csstree": "0.3.0",
69
- "typescript-eslint": "8.58.0",
70
+ "typescript-eslint": "8.58.1",
70
71
  "yaml-eslint-parser": "2.0.0",
71
72
  "@2digits/constants": "1.1.18",
72
- "@2digits/eslint-plugin": "4.0.9"
73
+ "@2digits/eslint-plugin": "4.0.10"
73
74
  },
74
75
  "devDependencies": {
75
76
  "@arethetypeswrong/core": "0.18.2",
76
77
  "@eslint/config-inspector": "1.5.0",
77
78
  "@types/react": "19.2.14",
78
- "@typescript/native-preview": "7.0.0-dev.20260406.1",
79
+ "@typescript/native-preview": "7.0.0-dev.20260408.1",
79
80
  "dedent": "1.7.2",
80
81
  "eslint": "10.2.0",
81
82
  "eslint-typegen": "2.3.1",
82
83
  "publint": "0.3.18",
83
- "react": "19.2.4",
84
- "tinyexec": "1.0.4",
85
- "tinyglobby": "0.2.15",
84
+ "react": "19.2.5",
85
+ "tinyexec": "1.1.1",
86
+ "tinyglobby": "0.2.16",
86
87
  "typescript": "6.0.2",
87
88
  "vite-plus": "0.1.16",
88
89
  "vitest": "npm:@voidzero-dev/vite-plus-test@0.1.16",