@2digits/oxlint-config 0.8.2 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-CrCtQfHL.mjs +2 -0
- package/dist/base-CrCtQfHL.mjs.map +1 -0
- package/dist/base.d.mts +12 -16
- package/dist/base.d.mts.map +1 -0
- package/dist/base.mjs +1 -1
- package/dist/index.d.mts +2064 -4
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -0
- package/dist/typescript-CkY-3Pw0.mjs +2 -0
- package/dist/typescript-CkY-3Pw0.mjs.map +1 -0
- package/dist/typescript.d.mts +24 -3
- package/dist/typescript.d.mts.map +1 -0
- package/dist/typescript.mjs +1 -1
- package/package.json +10 -12
- package/dist/base-Ddkw7kpS.mjs +0 -1
- package/dist/config-CUmtiUXM.d.mts +0 -2033
- package/dist/effect.d.mts +0 -42
- package/dist/effect.mjs +0 -1
- package/dist/typescript-CDMKHDlD.mjs +0 -1
package/dist/effect.d.mts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { t as TwoDigitsConfig } from "./config-CUmtiUXM.mjs";
|
|
2
|
-
//#region src/effect.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Effect rules provided by the `effecttsgo` plugin from `@effect/tsgo`.
|
|
5
|
-
*
|
|
6
|
-
* The plugin is compiled into Oxlint by a binary patch, so this config only works in projects that installed
|
|
7
|
-
* `@effect/tsgo` and ran `effect-tsgo patch --oxlint`. Without the patch Oxlint rejects the whole configuration with
|
|
8
|
-
* `Unknown plugin: 'effecttsgo'`, which is why these rules ship from a dedicated entrypoint instead of the default
|
|
9
|
-
* preset.
|
|
10
|
-
*
|
|
11
|
-
* Every rule needs type-aware linting, hence `options.typeAware`.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```ts
|
|
15
|
-
* // oxlint.config.ts
|
|
16
|
-
* import { withTwoDigits } from '@2digits/oxlint-config';
|
|
17
|
-
* import { effectConfig } from '@2digits/oxlint-config/effect';
|
|
18
|
-
*
|
|
19
|
-
* export default withTwoDigits(effectConfig);
|
|
20
|
-
* ```;
|
|
21
|
-
*
|
|
22
|
-
* @see https://github.com/Effect-TS/tsgo/blob/main/docs/README.md
|
|
23
|
-
*/
|
|
24
|
-
declare const effectConfig: TwoDigitsConfig;
|
|
25
|
-
/**
|
|
26
|
-
* {@link effectConfig}, targeted at the sources that are written with Effect.
|
|
27
|
-
*
|
|
28
|
-
* The rules judge plain TypeScript as well — `async-function`, `process-env` and `node-builtin-import` fire on any file
|
|
29
|
-
* — so pointing them at a package that does not depend on `effect` reports advice that cannot be followed without
|
|
30
|
-
* adopting Effect there. In a repository that mixes Effect and non-Effect packages, name the Effect ones. The plugin
|
|
31
|
-
* itself stays enabled globally because Oxlint only accepts `plugins` and `options` at the top level.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```ts
|
|
35
|
-
* export default withTwoDigits(effectConfigFor(['packages/api/src/**', 'packages/worker/src/**']));
|
|
36
|
-
* ```;
|
|
37
|
-
*
|
|
38
|
-
* @param files Globs selecting the Effect sources.
|
|
39
|
-
*/
|
|
40
|
-
declare function effectConfigFor(files: Array<string>): TwoDigitsConfig;
|
|
41
|
-
//#endregion
|
|
42
|
-
export { effectConfig, effectConfigFor };
|
package/dist/effect.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e={plugins:[`effecttsgo`],options:{typeAware:!0},rules:{"effecttsgo/abort-controller-in-effect":`error`,"effecttsgo/any-unknown-in-error-context":`error`,"effecttsgo/async-function":`error`,"effecttsgo/catch-all-to-map-error":`error`,"effecttsgo/catch-chain-to-first-success-of":`error`,"effecttsgo/catch-tag-to-catch-reason":`error`,"effecttsgo/catch-to-ignore":`error`,"effecttsgo/catch-to-or-else-succeed":`error`,"effecttsgo/catch-unfailable-effect":`error`,"effecttsgo/class-self-mismatch":`error`,"effecttsgo/crypto-random-uuid":`error`,"effecttsgo/crypto-random-uuid-in-effect":`error`,"effecttsgo/deterministic-keys":`error`,"effecttsgo/duplicate-package":`error`,"effecttsgo/effect-do-notation":`error`,"effecttsgo/effect-fn-iife":`error`,"effecttsgo/effect-fn-implicit-any":`error`,"effecttsgo/effect-fn-opportunity":`error`,"effecttsgo/effect-gen-uses-adapter":`error`,"effecttsgo/effect-in-failure":`error`,"effecttsgo/effect-in-void-success":`error`,"effecttsgo/effect-map-flatten":`error`,"effecttsgo/effect-map-void":`error`,"effecttsgo/effect-succeed-with-void":`error`,"effecttsgo/extends-native-error":`error`,"effecttsgo/flat-map-to-map":`error`,"effecttsgo/floating-effect":`error`,"effecttsgo/floating-effect-in-vitest":`error`,"effecttsgo/generic-effect-services":`error`,"effecttsgo/global-console":`error`,"effecttsgo/global-console-in-effect":`error`,"effecttsgo/global-date":`error`,"effecttsgo/global-date-in-effect":`error`,"effecttsgo/global-error-in-effect-catch":`error`,"effecttsgo/global-error-in-effect-failure":`error`,"effecttsgo/global-fetch":`error`,"effecttsgo/global-fetch-in-effect":`error`,"effecttsgo/global-random":`error`,"effecttsgo/global-random-in-effect":`error`,"effecttsgo/global-timers":`error`,"effecttsgo/global-timers-in-effect":`error`,"effecttsgo/instance-of-schema":`error`,"effecttsgo/layer-merge-all-with-dependencies":`error`,"effecttsgo/lazy-effect":`error`,"effecttsgo/lazy-promise-in-effect-sync":`error`,"effecttsgo/leaking-requirements":`error`,"effecttsgo/missed-pipeable-opportunity":`error`,"effecttsgo/missing-effect-context":`error`,"effecttsgo/missing-effect-error":`error`,"effecttsgo/missing-effect-service-dependency":`error`,"effecttsgo/missing-layer-context":`error`,"effecttsgo/missing-pipeable-signature":`warn`,"effecttsgo/missing-return-yield-star":`error`,"effecttsgo/missing-star-in-yield-effect-gen":`error`,"effecttsgo/multiple-catch-tag":`error`,"effecttsgo/multiple-effect-provide":`error`,"effecttsgo/nested-effect-gen-yield":`error`,"effecttsgo/new-promise":`error`,"effecttsgo/new-schema-class":`error`,"effecttsgo/node-builtin-import":`error`,"effecttsgo/non-object-effect-service-type":`error`,"effecttsgo/outdated-api":`error`,"effecttsgo/overridden-schema-constructor":`error`,"effecttsgo/prefer-schema-over-json":`error`,"effecttsgo/prefer-schema-type-property":`error`,"effecttsgo/prefer-typed-schema-decoder":`error`,"effecttsgo/prefer-unsafe-constructor":`error`,"effecttsgo/process-env":`error`,"effecttsgo/process-env-in-effect":`error`,"effecttsgo/promise-in-effect-success":`error`,"effecttsgo/redundant-map-error":`error`,"effecttsgo/redundant-or-die":`error`,"effecttsgo/redundant-schema-tag-identifier":`error`,"effecttsgo/return-effect-in-gen":`error`,"effecttsgo/run-effect-inside-effect":`error`,"effecttsgo/schema-literal-non-finite":`error`,"effecttsgo/schema-number":`error`,"effecttsgo/schema-opaque-instance-member":`error`,"effecttsgo/schema-struct-with-tag":`error`,"effecttsgo/schema-sync-in-effect":`error`,"effecttsgo/schema-union-of-literals":`error`,"effecttsgo/scope-in-layer-effect":`error`,"effecttsgo/service-not-as-class":`error`,"effecttsgo/strict-boolean-expressions":`warn`,"effecttsgo/strict-effect-provide":`warn`,"effecttsgo/sync-to-succeed":`error`,"effecttsgo/try-catch-in-effect-gen":`error`,"effecttsgo/unknown-in-effect-catch":`error`,"effecttsgo/unnecessary-arrow-block":`error`,"effecttsgo/unnecessary-effect-gen":`error`,"effecttsgo/unnecessary-fail-yieldable-error":`error`,"effecttsgo/unnecessary-pipe":`error`,"effecttsgo/unnecessary-pipe-chain":`error`,"effecttsgo/unnecessary-typeof-type":`error`,"effecttsgo/unsafe-effect-type-assertion":`error`}};function t(t){return{plugins:e.plugins,options:e.options,overrides:[{files:t,rules:e.rules}]}}export{e as effectConfig,t as effectConfigFor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{defineConfig as e}from"oxlint";import{ignorePatterns as t}from"@2digits/constants";const n=[`**/*.d.ts`],r=[`**/*.{test,spec}.ts?(x)`],i=[`**/*.js`,`**/*.cjs`,`**/*.cts`],a=e({overrides:[{files:[...n],rules:{"no-duplicate-imports":`off`,"no-undef":`off`,"no-unused-vars":`off`,"import/unambiguous":`off`}},{files:[...r],globals:{afterAll:`readonly`,afterEach:`readonly`,beforeAll:`readonly`,beforeEach:`readonly`,bench:`readonly`,describe:`readonly`,expect:`readonly`,expectTypeOf:`readonly`,it:`readonly`,suite:`readonly`,test:`readonly`,vi:`readonly`},rules:{"no-unused-expressions":`off`}},{files:[...i],rules:{"typescript/no-import-type-side-effects":`off`}}]}),o=e({options:{typeAware:!0},plugins:[`react`,`react-perf`],jsPlugins:[{name:`react-compiler`,specifier:import.meta.resolve(`eslint-plugin-react-compiler`)},{name:`stylistic`,specifier:import.meta.resolve(`@stylistic/eslint-plugin`)}],rules:{"react/button-has-type":`error`,"react/exhaustive-deps":`error`,"react/function-component-definition":[`error`,{namedComponents:`function-declaration`}],"react/iframe-missing-sandbox":`error`,"react/jsx-key":`error`,"react/jsx-no-comment-textnodes":`warn`,"react/jsx-no-constructed-context-values":`error`,"react/jsx-no-script-url":`warn`,"react/jsx-no-target-blank":`error`,"react/jsx-no-useless-fragment":`off`,"react/no-array-index-key":`warn`,"react/no-children-prop":`error`,"react/no-clone-element":`warn`,"react/no-danger":`warn`,"react/no-danger-with-children":`error`,"react/no-did-mount-set-state":`warn`,"react/no-direct-mutation-state":`error`,"react/no-find-dom-node":`error`,"react/no-namespace":`error`,"react/no-redundant-should-component-update":`error`,"react/no-render-return-value":`error`,"react/no-unsafe":`warn`,"react/no-will-update-set-state":`warn`,"react/rules-of-hooks":`error`,"react/self-closing-comp":`error`,"react/void-dom-elements-no-children":`error`,"react-perf/jsx-no-jsx-as-prop":`error`,"react-compiler/react-compiler":`error`,"stylistic/jsx-curly-newline":`off`,"stylistic/jsx-newline":[`error`,{prevent:!1}],"react/checked-requires-onchange-or-readonly":void 0,"react/display-name":`off`,"react/forbid-component-props":void 0,"react/forbid-dom-props":void 0,"react/forbid-elements":void 0,"react/forward-ref-uses-ref":`off`,"react/hook-use-state":`error`,"react/jsx-boolean-value":`off`,"react/jsx-curly-brace-presence":void 0,"react/jsx-filename-extension":`off`,"react/jsx-fragments":`off`,"react/jsx-handler-names":void 0,"react/jsx-max-depth":void 0,"react/jsx-no-duplicate-props":void 0,"react/jsx-no-literals":void 0,"react/jsx-no-undef":void 0,"react/jsx-pascal-case":`off`,"react/jsx-props-no-spread-multi":void 0,"react/jsx-props-no-spreading":void 0,"react/no-did-update-set-state":`off`,"react/no-is-mounted":void 0,"react/no-multi-comp":void 0,"react/no-object-type-as-default-prop":`off`,"react/no-react-children":void 0,"react/no-set-state":void 0,"react/no-string-refs":`off`,"react/no-this-in-sfc":void 0,"react/no-unescaped-entities":void 0,"react/no-unknown-property":`off`,"react/no-unstable-nested-components":`off`,"react/only-export-components":void 0,"react/prefer-es6-class":void 0,"react/prefer-function-component":void 0,"react/react-compiler":void 0,"react/react-in-jsx-scope":void 0,"react/require-render-return":void 0,"react/state-in-constructor":void 0,"react/style-prop-object":void 0,"react-perf/jsx-no-new-array-as-prop":void 0,"react-perf/jsx-no-new-function-as-prop":void 0,"react-perf/jsx-no-new-object-as-prop":void 0}}),s=e({plugins:[`typescript`],options:{typeAware:!0},rules:{"typescript/adjacent-overload-signatures":`error`,"typescript/array-type":[`error`,{default:`generic`,readonly:`generic`}],"typescript/await-thenable":`error`,"typescript/ban-ts-comment":[`error`,{"ts-ignore":`allow-with-description`}],"typescript/ban-tslint-comment":`error`,"typescript/ban-types":void 0,"typescript/class-literal-property-style":`error`,"typescript/consistent-generic-constructors":[`error`,`constructor`],"typescript/consistent-indexed-object-style":[`error`,`record`],"typescript/consistent-return":`off`,"typescript/consistent-type-assertions":[`error`,{assertionStyle:`as`}],"typescript/consistent-type-definitions":[`error`,`interface`],"typescript/consistent-type-exports":[`error`],"typescript/consistent-type-imports":[`error`,{fixStyle:`inline-type-imports`,prefer:`type-imports`,disallowTypeAnnotations:!1}],"typescript/dot-notation":[`error`,{allowKeywords:!0}],"typescript/explicit-function-return-type":void 0,"typescript/explicit-member-accessibility":void 0,"typescript/explicit-module-boundary-types":void 0,"typescript/method-signature-style":[`error`,`property`],"typescript/no-array-delete":`error`,"typescript/no-base-to-string":`error`,"typescript/no-confusing-non-null-assertion":`error`,"typescript/no-confusing-void-expression":`off`,"typescript/no-deprecated":`error`,"typescript/no-duplicate-enum-values":`error`,"typescript/no-duplicate-type-constituents":`error`,"typescript/no-dynamic-delete":`error`,"typescript/no-empty-interface":[`error`,{allowSingleExtends:!0}],"typescript/no-empty-object-type":[`error`,{allowInterfaces:`with-single-extends`,allowObjectTypes:`never`}],"typescript/no-explicit-any":[`error`],"typescript/no-extra-non-null-assertion":`error`,"typescript/no-extraneous-class":`error`,"typescript/no-floating-promises":`error`,"typescript/no-for-in-array":`error`,"typescript/no-implied-eval":`error`,"typescript/no-import-type-side-effects":[`error`],"typescript/no-inferrable-types":`error`,"typescript/no-invalid-void-type":`error`,"typescript/no-meaningless-void-operator":`error`,"typescript/no-misused-new":`error`,"typescript/no-misused-promises":`off`,"typescript/no-misused-spread":`error`,"typescript/no-mixed-enums":`error`,"typescript/no-namespace":`error`,"typescript/no-non-null-asserted-nullish-coalescing":`error`,"typescript/no-non-null-asserted-optional-chain":`error`,"typescript/no-non-null-assertion":`error`,"typescript/no-redundant-type-constituents":`error`,"typescript/no-require-imports":`error`,"typescript/no-restricted-types":void 0,"typescript/no-this-alias":`error`,"typescript/no-unnecessary-boolean-literal-compare":`error`,"typescript/no-unnecessary-condition":`error`,"typescript/no-unnecessary-parameter-property-assignment":`error`,"typescript/no-unnecessary-qualifier":`error`,"typescript/no-unnecessary-template-expression":`error`,"typescript/no-unnecessary-type-arguments":`error`,"typescript/no-unnecessary-type-assertion":`off`,"typescript/no-unnecessary-type-constraint":`error`,"typescript/no-unnecessary-type-conversion":`error`,"typescript/no-unnecessary-type-parameters":`error`,"typescript/no-unsafe-argument":`error`,"typescript/no-unsafe-assignment":`error`,"typescript/no-unsafe-call":`error`,"typescript/no-unsafe-declaration-merging":`error`,"typescript/no-unsafe-enum-comparison":`error`,"typescript/no-unsafe-function-type":`error`,"typescript/no-unsafe-member-access":`error`,"typescript/no-unsafe-return":`error`,"typescript/no-unsafe-type-assertion":`off`,"typescript/no-unsafe-unary-minus":`error`,"typescript/no-useless-default-assignment":`error`,"typescript/no-useless-empty-export":`error`,"typescript/no-var-requires":`error`,"typescript/no-wrapper-object-types":`error`,"typescript/non-nullable-type-assertion-style":`error`,"typescript/only-throw-error":`error`,"typescript/parameter-properties":[`error`,{prefer:`class-property`}],"typescript/prefer-as-const":`error`,"typescript/prefer-enum-initializers":`error`,"typescript/prefer-find":`error`,"typescript/prefer-for-of":`error`,"typescript/prefer-function-type":`error`,"typescript/prefer-includes":`error`,"typescript/prefer-literal-enum-member":`error`,"typescript/prefer-namespace-keyword":`error`,"typescript/prefer-nullish-coalescing":`error`,"typescript/prefer-optional-chain":`error`,"typescript/prefer-promise-reject-errors":`error`,"typescript/prefer-readonly":`error`,"typescript/prefer-readonly-parameter-types":`off`,"typescript/prefer-reduce-type-parameter":`error`,"typescript/prefer-regexp-exec":`error`,"typescript/prefer-return-this-type":`error`,"typescript/prefer-string-starts-ends-with":`error`,"typescript/prefer-ts-expect-error":void 0,"typescript/promise-function-async":void 0,"typescript/related-getter-setter-pairs":`error`,"typescript/require-array-sort-compare":`error`,"typescript/require-await":`error`,"typescript/restrict-plus-operands":[`error`,{allowAny:!1,allowBoolean:!1,allowNullish:!1,allowNumberAndString:!1,allowRegExp:!1}],"typescript/restrict-template-expressions":[`error`,{allowNumber:!0}],"typescript/return-await":[`error`,`error-handling-correctness-only`],"typescript/strict-boolean-expressions":void 0,"typescript/strict-void-return":`off`,"typescript/switch-exhaustiveness-check":`off`,"typescript/triple-slash-reference":`error`,"typescript/unbound-method":`off`,"typescript/unified-signatures":`error`,"typescript/use-unknown-in-catch-callback-variable":`error`}}),c=e({plugins:[`vitest`],settings:{vitest:{typecheck:!0}},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/expect-expect":[`error`,{additionalTestBlockFunctions:[`it`,`it.effect`,`it.scoped`],assertFunctionNames:[`expect`,`expectTypeOf`,`assert`,`assertType`,`assert*`,`*Equal`]}],"vitest/hoisted-apis-on-top":`error`,"vitest/max-expects":`error`,"vitest/max-nested-describe":`error`,"vitest/no-alias-methods":`error`,"vitest/no-commented-out-tests":`error`,"vitest/no-conditional-expect":`error`,"vitest/no-conditional-in-test":`error`,"vitest/no-conditional-tests":`error`,"vitest/no-disabled-tests":`error`,"vitest/no-duplicate-hooks":`error`,"vitest/no-focused-tests":`error`,"vitest/no-hooks":void 0,"vitest/no-identical-title":`error`,"vitest/no-import-node-test":`error`,"vitest/no-importing-vitest-globals":void 0,"vitest/no-interpolation-in-snapshots":`error`,"vitest/no-large-snapshots":void 0,"vitest/no-mocks-import":`error`,"vitest/no-restricted-matchers":void 0,"vitest/no-restricted-vi-methods":void 0,"vitest/no-standalone-expect":[`error`,{additionalTestBlockFunctions:[`it`,`it.effect`,`it.scoped`]}],"vitest/no-test-prefixes":`error`,"vitest/no-test-return-statement":`error`,"vitest/no-unneeded-async-expect-function":`error`,"vitest/prefer-called-exactly-once-with":`error`,"vitest/prefer-called-once":`error`,"vitest/prefer-called-times":void 0,"vitest/prefer-called-with":`error`,"vitest/prefer-comparison-matcher":`error`,"vitest/prefer-describe-function-title":`error`,"vitest/prefer-each":`error`,"vitest/prefer-equality-matcher":`error`,"vitest/prefer-expect-assertions":void 0,"vitest/prefer-expect-resolves":`error`,"vitest/prefer-expect-type-of":`error`,"vitest/prefer-hooks-in-order":`error`,"vitest/prefer-hooks-on-top":`error`,"vitest/prefer-import-in-mock":`error`,"vitest/prefer-importing-vitest-globals":void 0,"vitest/prefer-lowercase-title":`error`,"vitest/prefer-mock-promise-shorthand":`error`,"vitest/prefer-mock-return-shorthand":`error`,"vitest/prefer-snapshot-hint":[`error`,`always`],"vitest/prefer-spy-on":`error`,"vitest/prefer-strict-boolean-matchers":void 0,"vitest/prefer-strict-equal":`error`,"vitest/prefer-to-be":`error`,"vitest/prefer-to-be-falsy":`error`,"vitest/prefer-to-be-object":`error`,"vitest/prefer-to-be-truthy":`error`,"vitest/prefer-to-contain":`error`,"vitest/prefer-to-have-been-called-times":`error`,"vitest/prefer-to-have-length":`error`,"vitest/prefer-todo":`error`,"vitest/require-awaited-expect-poll":`error`,"vitest/require-hook":void 0,"vitest/require-local-test-context-for-concurrent-snapshots":`error`,"vitest/require-mock-type-parameters":`error`,"vitest/require-test-timeout":void 0,"vitest/require-to-throw-message":`error`,"vitest/require-top-level-describe":`error`,"vitest/valid-describe-callback":`error`,"vitest/valid-expect":`error`,"vitest/valid-expect-in-promise":`error`,"vitest/valid-title":[`error`,{ignoreTypeOfDescribeName:!0}],"vitest/warn-todo":`error`,"vitest/padding-around-after-all-blocks":void 0,"vitest/padding-around-test-blocks":void 0}}),l=e({options:{denyWarnings:!0,reportUnusedDisableDirectives:`deny`},categories:{nursery:`off`,pedantic:`off`,correctness:`off`,perf:`off`,style:`off`,restriction:`off`,suspicious:`off`},extends:[s,c,o,a],ignorePatterns:t});export{l as t};
|